diff --git a/CHANGELOG.md b/CHANGELOG.md index ed64cfacd..ad39b2d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Only write entries that are worth mentioning to users. ## Unreleased - Core: Add `--add-dir` CLI option and `/add-dir` slash command to expand the workspace scope with additional directories — added directories are accessible to all file tools (read, write, glob, replace), persisted across sessions, and shown in the system prompt +- Core: Fix `CHANGELOG.md` not found error in PyInstaller binary by deferring file read until first access, preventing startup failure when the bundled executable cannot locate the changelog file - Shell: Add `Ctrl-O` keyboard shortcut to open the current input in an external editor (`$VISUAL`/`$EDITOR`), with auto-detection fallback to VS Code, Vim, Vi, or Nano - Shell: Add `/editor` slash command to configure and switch the default external editor, with interactive selection and persistent config storage - Shell: Add `/new` slash command to create and switch to a new session without restarting Kimi Code CLI @@ -103,7 +104,7 @@ Only write entries that are worth mentioning to users. - Rust: Move the Rust implementation to `MoonshotAI/kimi-agent-rs` with independent releases; binary renamed to `kimi-agent` - Core: Preserve session id when reloading configuration so the session resumes correctly - Shell: Fix session replay showing messages that were cleared by `/clear` or `/reset` -- Web: Fix approval request states not updating when session is interrupted or cancelled +- Web: Fix approval-request states not updating when session is interrupted or cancelled - Web: Fix IME composition issue when selecting slash commands - Web: Fix UI not clearing messages after `/clear`, `/reset`, or `/compact` commands @@ -121,7 +122,7 @@ Only write entries that are worth mentioning to users. - Web: Fix authentication token persistence by switching from sessionStorage to localStorage with 24-hour expiry - Web: Add server-side pagination for session list with virtualized scrolling for better performance - Web: Improve session and work directories loading with smarter caching and invalidation -- Web: Fix WebSocket errors during history replay by checking connection state before sending +- Web: Fix WebSocket disconnect when creating new sessions - Web: Git diff status bar now shows untracked files (new files not yet added to git) - Web: Restrict sensitive APIs only in public mode; update origin enforcement logic @@ -171,7 +172,7 @@ Only write entries that are worth mentioning to users. - Shell: Add `/login` and `/logout` slash commands for login and logout - CLI: Add `kimi login` and `kimi logout` subcommands -- Core: Fix subagent approval request handling +- Core: Fix subagent approval-request handling ## 0.88 (2026-01-26) @@ -237,7 +238,7 @@ Only write entries that are worth mentioning to users. - Skills: Add project-level skills support, discovered from `.agents/skills/` (or `.kimi/skills/`, `.claude/skills/`) - Skills: Unified skills discovery with layered loading (builtin → user → project); user-level skills now prefer `~/.config/agents/skills/` - Shell: Support fuzzy matching for slash command autocomplete -- Shell: Enhanced approval request preview with shell command and diff content display, use `Ctrl-E` to expand full content +- Shell: Enhanced approval-request preview with shell command and diff content display, use `Ctrl-E` to expand full content - Wire: Add `ShellDisplayBlock` type for shell command display in approval requests - Shell: Reorder `/help` to show keyboard shortcuts before slash commands - Wire: Return proper JSON-RPC 2.0 error responses for invalid requests @@ -262,7 +263,7 @@ Only write entries that are worth mentioning to users. - Tool: Make `ReadFile` tool description reflect model capabilities for image/video support - Tool: Fix TypeScript files (`.ts`, `.tsx`, `.mts`, `.cts`) being misidentified as video files -- Shell: Allow slash commands (`/help`, `/exit`, `/version`, `/changelog`, `/feedback`) in shell mode +- Shell: Allow slash commands (`/help`, `/exit`, `/version`, `/changelog`, `/mcp`) in shell mode - Shell: Improve `/help` with fullscreen pager, showing slash commands, skills, and keyboard shortcuts - Shell: Improve `/changelog` and `/mcp` display with consistent bullet-style formatting - Shell: Show current model name in the bottom status bar @@ -347,7 +348,6 @@ Only write entries that are worth mentioning to users. - Lib: Add `KimiToolset.load_mcp_tools` method to load MCP tools - Lib: Move `MCPTool` from `kimi_cli.tools.mcp` to `kimi_cli.soul.toolset` - Lib: Add `InvalidToolError`, `MCPConfigError` and `MCPRuntimeError` -- Lib: Make the detailed Kimi Code CLI exception classes extend `ValueError` or `RuntimeError` - Lib: Allow passing validated `list[fastmcp.mcp_config.MCPConfig]` as `mcp_configs` for `KimiCLI.create` and `load_agent` - Lib: Fix exception raising for `KimiCLI.create`, `load_agent`, `KimiToolset.load_tools` and `KimiToolset.load_mcp_tools` - LLM: Add provider type `vertexai` to support Vertex AI @@ -438,7 +438,7 @@ Only write entries that are worth mentioning to users. ## 0.57 (2025-11-20) - LLM: Fix Google GenAI provider when thinking toggle is not on -- UI: Improve approval request wordings +- UI: Improve approval-request wordings - Tool: Remove `PatchFile` tool - Tool: Rename `Bash`/`CMD` tool to `Shell` tool - Tool: Move `Task` tool to `kimi_cli.tools.multiagent` module @@ -633,7 +633,7 @@ Only write entries that are worth mentioning to users. - Add `/debug` meta command to debug the context - Add auto context compaction -- Add approval request mechanism +- Add approval-request mechanism - Add `--yolo` option to automatically approve all actions - Render markdown content for better readability @@ -841,7 +841,7 @@ Only write entries that are worth mentioning to users. - Session history file can be specified via `_history_file` parameter when creating a new session -## 0.15.0 (2025-09-26) +## 0.15.0 (2025-09-29) - Improve tool robustness diff --git a/docs/en/release-notes/changelog.md b/docs/en/release-notes/changelog.md index fd15829c7..04bfbef9a 100644 --- a/docs/en/release-notes/changelog.md +++ b/docs/en/release-notes/changelog.md @@ -5,6 +5,7 @@ This page documents the changes in each Kimi Code CLI release. ## Unreleased - Core: Add `--add-dir` CLI option and `/add-dir` slash command to expand the workspace scope with additional directories — added directories are accessible to all file tools (read, write, glob, replace), persisted across sessions, and shown in the system prompt +- Core: Fix `CHANGELOG.md` not found error in PyInstaller binary by deferring file read until first access, preventing startup failure when the bundled executable cannot locate the changelog file - Shell: Add `Ctrl-O` keyboard shortcut to open the current input in an external editor (`$VISUAL`/`$EDITOR`), with auto-detection fallback to VS Code, Vim, Vi, or Nano - Shell: Add `/editor` slash command to configure and switch the default external editor, with interactive selection and persistent config storage - Shell: Add `/new` slash command to create and switch to a new session without restarting Kimi Code CLI @@ -96,7 +97,7 @@ This page documents the changes in each Kimi Code CLI release. - Rust: Move the Rust implementation to `MoonshotAI/kimi-agent-rs` with independent releases; binary renamed to `kimi-agent` - Core: Preserve session id when reloading configuration so the session resumes correctly - Shell: Fix session replay showing messages that were cleared by `/clear` or `/reset` -- Web: Fix approval request states not updating when session is interrupted or cancelled +- Web: Fix approval-request states not updating when session is interrupted or cancelled - Web: Fix IME composition issue when selecting slash commands - Web: Fix UI not clearing messages after `/clear`, `/reset`, or `/compact` commands @@ -114,7 +115,7 @@ This page documents the changes in each Kimi Code CLI release. - Web: Fix authentication token persistence by switching from sessionStorage to localStorage with 24-hour expiry - Web: Add server-side pagination for session list with virtualized scrolling for better performance - Web: Improve session and work directories loading with smarter caching and invalidation -- Web: Fix WebSocket errors during history replay by checking connection state before sending +- Web: Fix WebSocket disconnect when creating new sessions - Web: Git diff status bar now shows untracked files (new files not yet added to git) - Web: Restrict sensitive APIs only in public mode; update origin enforcement logic @@ -164,7 +165,7 @@ This page documents the changes in each Kimi Code CLI release. - Shell: Add `/login` and `/logout` slash commands for login and logout - CLI: Add `kimi login` and `kimi logout` subcommands -- Core: Fix subagent approval request handling +- Core: Fix subagent approval-request handling ## 0.88 (2026-01-26) @@ -230,7 +231,7 @@ This page documents the changes in each Kimi Code CLI release. - Skills: Add project-level skills support, discovered from `.agents/skills/` (or `.kimi/skills/`, `.claude/skills/`) - Skills: Unified skills discovery with layered loading (builtin → user → project); user-level skills now prefer `~/.config/agents/skills/` - Shell: Support fuzzy matching for slash command autocomplete -- Shell: Enhanced approval request preview with shell command and diff content display, use `Ctrl-E` to expand full content +- Shell: Enhanced approval-request preview with shell command and diff content display, use `Ctrl-E` to expand full content - Wire: Add `ShellDisplayBlock` type for shell command display in approval requests - Shell: Reorder `/help` to show keyboard shortcuts before slash commands - Wire: Return proper JSON-RPC 2.0 error responses for invalid requests @@ -255,7 +256,7 @@ This page documents the changes in each Kimi Code CLI release. - Tool: Make `ReadFile` tool description reflect model capabilities for image/video support - Tool: Fix TypeScript files (`.ts`, `.tsx`, `.mts`, `.cts`) being misidentified as video files -- Shell: Allow slash commands (`/help`, `/exit`, `/version`, `/changelog`, `/feedback`) in shell mode +- Shell: Allow slash commands (`/help`, `/exit`, `/version`, `/changelog`, `/mcp`) in shell mode - Shell: Improve `/help` with fullscreen pager, showing slash commands, skills, and keyboard shortcuts - Shell: Improve `/changelog` and `/mcp` display with consistent bullet-style formatting - Shell: Show current model name in the bottom status bar @@ -340,7 +341,6 @@ This page documents the changes in each Kimi Code CLI release. - Lib: Add `KimiToolset.load_mcp_tools` method to load MCP tools - Lib: Move `MCPTool` from `kimi_cli.tools.mcp` to `kimi_cli.soul.toolset` - Lib: Add `InvalidToolError`, `MCPConfigError` and `MCPRuntimeError` -- Lib: Make the detailed Kimi Code CLI exception classes extend `ValueError` or `RuntimeError` - Lib: Allow passing validated `list[fastmcp.mcp_config.MCPConfig]` as `mcp_configs` for `KimiCLI.create` and `load_agent` - Lib: Fix exception raising for `KimiCLI.create`, `load_agent`, `KimiToolset.load_tools` and `KimiToolset.load_mcp_tools` - LLM: Add provider type `vertexai` to support Vertex AI @@ -431,7 +431,7 @@ This page documents the changes in each Kimi Code CLI release. ## 0.57 (2025-11-20) - LLM: Fix Google GenAI provider when thinking toggle is not on -- UI: Improve approval request wordings +- UI: Improve approval-request wordings - Tool: Remove `PatchFile` tool - Tool: Rename `Bash`/`CMD` tool to `Shell` tool - Tool: Move `Task` tool to `kimi_cli.tools.multiagent` module @@ -582,7 +582,7 @@ This page documents the changes in each Kimi Code CLI release. - Add `/debug` meta command to debug the context - Add auto context compaction -- Add approval request mechanism +- Add approval-request mechanism - Add `--yolo` option to automatically approve all actions - Render markdown content for better readability @@ -724,7 +724,7 @@ This page documents the changes in each Kimi Code CLI release. - Session history file can be specified via `_history_file` parameter when creating a new session -## 0.15.0 (2025-09-26) +## 0.15.0 (2025-09-29) - Improve tool robustness diff --git a/docs/zh/release-notes/changelog.md b/docs/zh/release-notes/changelog.md index 98308c38e..0a3eb64c4 100644 --- a/docs/zh/release-notes/changelog.md +++ b/docs/zh/release-notes/changelog.md @@ -5,6 +5,7 @@ ## 未发布 - Core:新增 `--add-dir` CLI 选项和 `/add-dir` 斜杠命令,支持将额外目录添加到工作区范围——添加的目录可被所有文件工具(读取、写入、glob、替换)访问,跨会话持久化保存,并在系统提示词中展示 +- Core:修复 PyInstaller 打包的二进制文件中 `CHANGELOG.md` 找不到的错误,通过将文件读取延迟到首次访问时执行,防止打包的可执行文件因找不到 changelog 文件而导致启动失败 - Shell:新增 `Ctrl-O` 快捷键,在外部编辑器中编辑当前输入内容(`$VISUAL`/`$EDITOR`),支持自动检测 VS Code、Vim、Vi 或 Nano - Shell:新增 `/editor` 斜杠命令,可交互式配置和切换默认外部编辑器,设置持久保存到配置文件 - Shell:新增 `/new` 斜杠命令,无需重启 Kimi Code CLI 即可创建并切换到新会话 diff --git a/src/kimi_cli/ui/shell/slash.py b/src/kimi_cli/ui/shell/slash.py index b644a8997..75809983a 100644 --- a/src/kimi_cli/ui/shell/slash.py +++ b/src/kimi_cli/ui/shell/slash.py @@ -12,7 +12,7 @@ from kimi_cli.session import Session from kimi_cli.soul.kimisoul import KimiSoul from kimi_cli.ui.shell.console import console -from kimi_cli.utils.changelog import CHANGELOG +from kimi_cli.utils.changelog import get_changelog from kimi_cli.utils.datetime import format_relative_time from kimi_cli.utils.slashcmd import SlashCommand, SlashCommandRegistry @@ -366,7 +366,7 @@ def changelog(app: Shell, args: str): from kimi_cli.utils.rich.columns import BulletColumns renderables: list[RenderableType] = [] - for ver, entry in CHANGELOG.items(): + for ver, entry in get_changelog().items(): title = f"[bold]{ver}[/bold]" if entry.description: title += f": {entry.description}" diff --git a/src/kimi_cli/utils/changelog.py b/src/kimi_cli/utils/changelog.py index 053e7b1cb..2d3f0bfa0 100644 --- a/src/kimi_cli/utils/changelog.py +++ b/src/kimi_cli/utils/changelog.py @@ -103,6 +103,17 @@ def format_release_notes(changelog: dict[str, ReleaseEntry], include_lib_changes return "\n".join(parts).strip() -CHANGELOG = parse_changelog( - (Path(__file__).parent.parent / "CHANGELOG.md").read_text(encoding="utf-8") -) +_cached_changelog: dict[str, ReleaseEntry] | None = None + + +def get_changelog() -> dict[str, ReleaseEntry]: + """Lazily load and parse the changelog on first access.""" + global _cached_changelog + if _cached_changelog is None: + path = Path(__file__).parent.parent / "CHANGELOG.md" + try: + _cached_changelog = parse_changelog( + path.read_text(encoding="utf-8")) + except FileNotFoundError: + _cached_changelog = {} + return _cached_changelog