Conversation
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to improve import organization and reduce circular dependencies by:
- Moving the
KimiCLIclass fromsrc/kimi_cli/__init__.pyto a new dedicatedsrc/kimi_cli/app.pymodule - Relocating
InputFormatandOutputFormattype definitions fromkimi_cli.ui.printtokimi_cli.cli - Converting top-level imports in
cli.pyandagent.pyto lazy imports to break circular dependencies
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/kimi_cli/init.py | Removed entire KimiCLI class definition (now empty/deleted) |
| src/kimi_cli/app.py | New file containing the relocated KimiCLI class with identical implementation |
| src/kimi_cli/cli.py | Added InputFormat/OutputFormat type definitions and converted several top-level imports to lazy imports within the kimi() function |
| src/kimi_cli/ui/print/init.py | Removed InputFormat/OutputFormat definitions and now imports them from kimi_cli.cli instead |
| src/kimi_cli/soul/agent.py | Converted fastmcp and MCPTool imports to lazy imports within _load_mcp_tools() function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return self._runtime.session | ||
|
|
||
| @contextlib.contextmanager | ||
| def _app_env(self) -> Generator[None]: |
There was a problem hiding this comment.
The Generator type hint is incomplete. It should specify all three type parameters: Generator[None, None, None] representing the yielded type, the send type, and the return type.
| def _app_env(self) -> Generator[None]: | |
| def _app_env(self) -> Generator[None, None, None]: |
| Args: | ||
| session (Session): A session created by `Session.create` or `Session.continue_`. | ||
| yolo (bool, optional): Approve all actions without confirmation. Defaults to False. | ||
| stream (bool, optional): Use stream mode when calling LLM API. Defaults to True. |
There was a problem hiding this comment.
The mcp_configs parameter is missing from the docstring. It should be documented with its type, purpose, and default value.
| stream (bool, optional): Use stream mode when calling LLM API. Defaults to True. | |
| stream (bool, optional): Use stream mode when calling LLM API. Defaults to True. | |
| mcp_configs (list[dict[str, Any]] | None, optional): List of MCP configuration dictionaries to use when loading the agent. Defaults to None. |
|
Is that true? |
time uv run kimi --help~0.7s → ~0.09s
~0.86s → ~0.66s
~0.86s → ~0.60s
Fix #20