feat(cli): add official wire file support and build-web command#1455
Conversation
| restrict_sensitive_apis=restrict_sensitive_apis, | ||
| lan_only=lan_only, | ||
| ) |
There was a problem hiding this comment.
🔴 Missing ctx.invoked_subcommand guard causes build-web subcommand to never execute
The web() callback decorated with @cli.callback(invoke_without_command=True) unconditionally calls run_web_server(), which is a blocking call (it runs uvicorn.run() at src/kimi_cli/web/app.py:534). When a user runs kimi web build-web, Typer invokes the group callback first, so the web server starts and blocks forever — the build_web() command never executes. The established pattern in this codebase is to guard with if ctx.invoked_subcommand is not None: return, as done in src/kimi_cli/cli/__init__.py:325.
(Refers to lines 176-197)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 067b4408a3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @cli.command(name="build-web") | ||
| def build_web( |
There was a problem hiding this comment.
Skip web callback when running build-web subcommand
This subcommand is registered under the same Typer/Click group whose callback unconditionally starts run_web_server, and there is no ctx.invoked_subcommand guard here; in Click groups, callbacks run before subcommands, so kimi web build-web will enter the server path first and the new build command will not run as intended. The top-level CLI already handles this pattern by returning early when a subcommand is invoked (src/kimi_cli/cli/__init__.py:325), so this should do the same.
Useful? React with 👍 / 👎.
Related Issue
Resolve #(issue_number)
Description
Checklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.