-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(shell): include session id in kimi export hint on errors #2034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f57c9b9
a212d4d
25dc8e1
924e6bc
bea071b
c85d6eb
1cd9416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ This page documents the changes in each Kimi Code CLI release. | |
|
|
||
| ## Unreleased | ||
|
|
||
| - Shell: Error hints now include the specific session ID in the `kimi export` command and surface the direct support email address `code@moonshot.ai` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Manual edit of auto-generated English changelog violates docs/AGENTS.md rule The Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| - Core: Add `skip_yolo_prompt_injection` config option to suppress the system reminder normally injected when yolo mode is active — useful when building custom applications on top of `KimiSoul` that do not need the non-interactive mode hint | ||
| - Kimi: Add `KIMI_MODEL_THINKING_KEEP` environment variable that forwards its value verbatim to the Moonshot API as `thinking.keep`, enabling Preserved Thinking (e.g. `export KIMI_MODEL_THINKING_KEEP=all` to retain historical `reasoning_content` across turns); effective only for Moonshot models supporting Preserved Thinking (e.g. `kimi-k2.6` / `kimi-k2-thinking`), unset or empty string preserves the previous behavior and omits the field, and the override only applies when the current model is actually in thinking mode so the API never receives a `thinking.keep` without the companion `thinking.type`. Note that `keep=all` increases input tokens and API cost because history reasoning is resent | ||
| - Kosong: Fix `Kimi.with_extra_body` silently dropping previously set `thinking.type` when a later call added another `thinking.*` field — the `thinking` sub-dict is now merged field-by-field instead of shallow-replaced, so composing `with_thinking(...)` with `with_extra_body({"thinking": {...}})` preserves both contributions | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -951,10 +951,16 @@ def _on_view_ready(view: Any) -> None: | |
| else: | ||
| console.print(f"[red]LLM provider error: {e}[/red]") | ||
| if not isinstance(e, APIStatusError) or e.status_code not in (401, 402, 403): | ||
| session_id = ( | ||
| self.soul.runtime.session.id if isinstance(self.soul, KimiSoul) else None | ||
| ) | ||
| export_cmd = f"kimi export {session_id}" if session_id else "kimi export" | ||
|
kermanx marked this conversation as resolved.
kermanx marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The hint builds Useful? React with 👍 / 👎. |
||
| console.print( | ||
| "[dim]If this persists, run [bold]kimi export[/bold] and send the " | ||
| "exported data to support for assistance. " | ||
| "Please do not share the exported file publicly.[/dim]" | ||
| "[dim]If this persists, run the " | ||
| f"[bold]{export_cmd}[/bold] command in your terminal " | ||
| "and send the exported data to " | ||
| "[link=mailto:code@moonshot.ai]code@moonshot.ai[/link] " | ||
| "for assistance. Please do not share the exported file publicly.[/dim]" | ||
| ) | ||
| except MaxStepsReached as e: | ||
| logger.warning("Max steps reached: {n_steps}", n_steps=e.n_steps) | ||
|
|
@@ -973,9 +979,12 @@ def _on_view_ready(view: Any) -> None: | |
| console.print("[red]Interrupted by user[/red]") | ||
| except Exception as e: | ||
| logger.exception("Unexpected error:") | ||
| session_id = self.soul.runtime.session.id if isinstance(self.soul, KimiSoul) else None | ||
| export_cmd = f"kimi export {session_id}" if session_id else "kimi export" | ||
|
kermanx marked this conversation as resolved.
|
||
| console.print( | ||
| f"[red]Unexpected error: {e}[/red]\n" | ||
| "[dim]Run [bold]kimi export[/bold] and send the exported data to support " | ||
| f"[dim]Run [bold]{export_cmd}[/bold] and send the exported data to " | ||
| "[link=mailto:code@moonshot.ai]code@moonshot.ai[/link] " | ||
| "for assistance. Please do not share the exported file publicly.[/dim]" | ||
|
kermanx marked this conversation as resolved.
|
||
| ) | ||
| raise # re-raise unknown error | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.