From 7f1313c8c323a63f6ad4daef7da4653b151e4676 Mon Sep 17 00:00:00 2001 From: "fangyaozheng@bytedance.com" Date: Fri, 12 Jun 2026 11:14:49 +0800 Subject: [PATCH] fix(cli): re-export AgentKit subcommands without the click.Group isinstance gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Typer 0.26 a TyperGroup is no longer a click.Group subclass, so the `isinstance(agentkit_commands, click.Group)` guard evaluated False and the loop re-exporting AgentKit's subcommands never ran — `veadk agentkit` showed no commands at all on newer Typer. Iterate `getattr(..., 'commands', {})` by duck-typing instead, which works across Typer versions (verified on 0.21.1 and 0.26.7). --- veadk/cli/cli_agentkit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/veadk/cli/cli_agentkit.py b/veadk/cli/cli_agentkit.py index dd4cfa3f..63453f4e 100644 --- a/veadk/cli/cli_agentkit.py +++ b/veadk/cli/cli_agentkit.py @@ -25,6 +25,9 @@ def agentkit(): agentkit_commands = get_command(agentkit_typer_app) -if isinstance(agentkit_commands, click.Group): - for cmd_name, cmd in agentkit_commands.commands.items(): - agentkit.add_command(cmd, name=cmd_name) +# Re-export the AgentKit CLI's subcommands under `veadk agentkit`. Iterate by +# duck-typing on `.commands` rather than gating on `isinstance(..., click.Group)`: +# since Typer 0.26 a TyperGroup is no longer a click.Group subclass, so the +# isinstance check silently evaluates False and drops every command. +for cmd_name, cmd in getattr(agentkit_commands, "commands", {}).items(): + agentkit.add_command(cmd, name=cmd_name)