feat(cli): foreground-only web servers, deprecated kimi server kill - #1967
Conversation
🦋 Changeset detectedLatest commit: 7753eff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
11cf1c8 to
d8c6f76
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11cf1c802c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (typeof parsed.pid !== 'number') return undefined; | ||
| return { | ||
| pid: parsed.pid, |
There was a problem hiding this comment.
Validate legacy lock PIDs before signaling
When <KIMI_CODE_HOME>/server/lock is corrupt (pid: 0 or negative) or stale after the OS has reused the recorded PID, this accepts the value as long as it is a number and the command later sends SIGTERM/SIGKILL to it. On POSIX, 0/negative PIDs have process-group semantics, and a reused positive PID may belong to an unrelated user process, so kimi server kill can terminate the wrong process. Please only accept positive safe integer PIDs and verify the process still matches the recorded legacy server (for example via start time/entry) before signaling.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@moonshot-ai/kimi-code": patch | |||
There was a problem hiding this comment.
Mark removed web subcommands as breaking
This changeset declares a patch release while the same change removes kimi web kill and kimi web ps, so existing scripts invoking those CLI commands will fail after what semver advertises as a safe patch upgrade. The repository rules explicitly classify removed commands/arguments as major-version changes; either keep deprecated stubs for this release or make this a confirmed major changeset.
Useful? React with 👍 / 👎.
commit: |
- the /web slash command now always starts a new server instead of offering to reuse a running one - remove the kimi web kill and kimi web ps subcommands; foreground servers stop with Ctrl+C - keep kimi server kill as a deprecated fallback that only stops servers started by a version before 0.28.0 (recorded in the legacy server lock)
d8c6f76 to
7753eff
Compare
Related Issue
No linked issue — the problem is explained below.
Problem
After the
kimi webcommand tree made every server a foreground process, the daemon-era management surface lost its purpose, but two gaps remained:/webcommand still offered to attach the session to an already-running server, keeping a second, harder-to-reason-about handoff path.kimi web kill/kimi web psmanage background instances that the foreground model no longer creates, while the servers that actually need a kill path — background servers left behind by builds before 0.28.0, recorded in the legacy~/.kimi-code/server/lock— were invisible to them.What changed
/webnow always starts a new server: the TUI exits and the current process becomes the server in the foreground, then opens the session deep link once it is listening. The instance picker is gone.kimi web killandkimi web ps; foreground servers stop with Ctrl+C, and the ready banner plus the--dangerous-bypass-authwarning now say so.kimi web rotate-tokenis kept.kimi server killas the one working command of the deprecatedkimi servertree: it only stops servers started by a version before 0.28.0 (best-effortPOST /api/v1/shutdown, then SIGTERM → SIGKILL on the pid recorded in the legacy lock, sweeping the lock file once the process is confirmed dead), and prints a deprecation notice with the 0.28.0 cutoff on every run.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.