Skip to content

fix(cli): veadk agentkit shows no subcommands on Typer ≥ 0.26#605

Merged
zakahan merged 1 commit into
mainfrom
fix/agentkit-reexport-typer-compat
Jun 12, 2026
Merged

fix(cli): veadk agentkit shows no subcommands on Typer ≥ 0.26#605
zakahan merged 1 commit into
mainfrom
fix/agentkit-reexport-typer-compat

Conversation

@yaozheng-fang

Copy link
Copy Markdown
Collaborator

Symptom

veadk agentkit --help lists no commands (only --help) in environments with a newer Typer — every re-exported AgentKit subcommand (build/config/deploy/runtime/…) disappears.

Root cause

cli_agentkit.py re-exports the AgentKit CLI's subcommands behind an isinstance gate:

agentkit_commands = get_command(agentkit_typer_app)
if isinstance(agentkit_commands, click.Group):   # ← False on Typer ≥ 0.26
    for cmd_name, cmd in agentkit_commands.commands.items():
        agentkit.add_command(cmd, name=cmd_name)

Since Typer 0.26 a TyperGroup is no longer a click.Group subclass, so the guard silently evaluates False and the loop never runs — the agentkit group ends up empty. It worked on Typer 0.21 (where the isinstance held) but breaks on 0.26.7. Unrelated to the recent harness changes; this was a latent bug the version bump exposed.

Fix

Drop the isinstance gate and iterate by duck-typing on .commands (always present on a TyperGroup):

for cmd_name, cmd in getattr(agentkit_commands, "commands", {}).items():
    agentkit.add_command(cmd, name=cmd_name)

Verification

  • Typer 0.21.1: veadk agentkit lists all 13 commands (unchanged).
  • Typer 0.26.7: the fixed logic now yields all 14 commands (was 0).
  • ruff + pyright clean; full suite green (272 passed).

🤖 Generated with Claude Code

…stance gate

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).
@zakahan zakahan merged commit da7ac38 into main Jun 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants