kimi-code: first-class agent with usage + resume#50
Open
fkesheh wants to merge 3 commits into
Open
Conversation
Adds the standalone Kimi Code CLI as a harness alongside the existing kimi provider-flavor (distinct products — OAuth CLI vs claude-CLI-on- Moonshot). One registry entry + buildKimiCodeCommand drives every derived bridge union; UI/sibling-CLI mirrors updated by hand (picker, model aliases k3/kimi-for-coding[-highspeed], badge, command branch, LoopHarness). Launches the absolute $HOME/.kimi-code/bin/kimi (installer only adds it to .zshrc, which zsh -l -c skips), --yolo auto-approve, -m model; TUI takes no positional prompt (promptAsCliArg:false, typed after launch like opencode). grok-shaped limits: no hooks/workflow/provider-env; resume + usage extraction deferred to follow-ups.
Usage: collect SessionUsage from ~/.kimi-code sessions — resolve the session dir via session_index.jsonl by workingDir+createdAt, sum usage.record events across all agents' wire.jsonl (inputOther/output/ inputCacheRead/inputCacheCreation → the four token classes, per-model). kimi-code now reports usage like claude/codex. Resume: buildKimiCodeCommand gains resume→'-c' (continue the workdir's session), threaded through BuildCommandInput like claude's --resume; canResumeStoredSession returns true for kimi-code, so resurrection after a bridge restart continues the actual kimi conversation. No native id field needed — kimi resume is workdir-based.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the standalone Kimi Code CLI (
code.kimi.com/kimi-code) as a first-class agent harness, distinct from the existingkimiprovider-flavor (OAuth CLI vs claude-CLI-on-Moonshot — both kept). Two commits; bridge 519 tests + UI 110 green.What it supports
How
buildKimiCodeCommanddrives every derived bridge union (ShellType/LoopHarness/etc.); UI + sibling CLIs mirror it by hand (picker, model dropdown, badge, LoopHarness)."$HOME/.kimi-code/bin/kimi"— the installer only adds the bin to.zshrc(interactive), but ftown launches viazsh -l -c(non-interactive login) which skips it, so a barekimiwould fail to resolve.--yoloauto-approve,-m <model>;promptAsCliArg:false(its TUI takes no positional prompt —-pis one-shot only — so the prompt is typed after launch, like opencode).~/.kimi-code/sessions/.../wire.jsonlusage.recordevents (resolved viasession_index.jsonlby workingDir+createdAt, summed across main + sub-agents) into the sameSessionUsageshape as claude/codex — shows in the terminal header, session rows, andftown-sessions usage.-c(no native-id capture needed):canResumeStoredSessionreturns true, so resurrection after a restart continues the actual conversation.All verified against real
~/.kimi-codedata on the dev machine (session index,state.json,usage.recordshapes).Stacked conceptually on #49 (usage/security/e2e), which is already merged to main.
🤖 Generated with Claude Code