fix: avoid runtime check rpc - #432
Conversation
|
commit: |
03324ff to
b7ffda0
Compare
There was a problem hiding this comment.
💡 Codex Review
kimi-code/packages/agent-core/src/rpc/core-impl.ts
Lines 191 to 194 in 03324ff
When Git Bash is missing on Windows, the new startup path relies on createSession() to surface the Kaos failure, but this call has already created and indexed the session directory before getKaos() runs below. That leaves a failed, empty session in listSessions()/kimi -c results and can later be selected/resumed even though startup never succeeded; move the Kaos/runtime check before sessionStore.create() or roll the store entry back on this failure.
kimi-code/apps/kimi-code/src/cli/run-prompt.ts
Lines 280 to 281 in 03324ff
For a fresh headless prompt on Windows with Git Bash missing and no configured model, startup now reaches requireConfiguredModel() before it ever calls into createSession(), so the user gets the “No model configured” error instead of the Git Bash preflight error and cannot follow the suggested kimi login flow until the shell runtime is fixed. If the runtime check is going to live on session creation, this path still needs to probe it before model validation or otherwise preserve the preflight behavior for first-run users.
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Related Issue
No linked issue; follow-up to #430.
Problem
The Windows Git Bash preflight merged in #430 added a dedicated
checkRuntimeEnvironmentmethod through CoreAPI, the SDK RPC client, andKimiHarness. That made the fix wider than necessary because the shell runtime is already a core session dependency.What changed
Removed the dedicated runtime-check RPC and harness method, and stopped calling it from CLI startup. The Git Bash failure still surfaces from core when creating or resuming a session through the lazy Kaos initialization path. Added core regression coverage for create and resume failures, and adjusted CLI tests so they no longer mock the removed API.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.