feat(server): default to kap-server and remove the v1 server package - #1617
Conversation
🦋 Changeset detectedLatest commit: b5582db The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
598c816 to
1872b81
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 598c8161bd
ℹ️ 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".
| port: options.port, | ||
| logLevel: options.logLevel, | ||
| logger, | ||
| debugEndpoints: options.debugEndpoints, |
There was a problem hiding this comment.
Restore debug routes before making kap-server default
Now that this path unconditionally boots @moonshot-ai/kap-server, --debug-endpoints no longer mounts the three /api/v1/debug/prompts/... routes: packages/kap-server/src/routes/registerApiV1Routes.ts accepts debugEndpoints but never registers a debug route, and its debug non-loopback test documents that the option is currently a no-op. packages/server-e2e/scripts/run-docker-e2e.sh still starts pnpm dev:server -- --debug-endpoints, and scenarios 04/10/12 call those debug URLs, so the default docker e2e flow now gets 404s where the legacy server used to provide the introspection/mutation endpoints.
Useful? React with 👍 / 👎.
commit: |
8568575 to
4e2d4a1
Compare
- kimi server run / kimi web now boot kap-server (agent-core-v2 engine) unconditionally; the KIMI_CODE_EXPERIMENTAL_FLAG gate on the server path is gone (the kimi -p print-mode gate stays) - move the OS service manager (svc: launchd/systemd/schtasks) from packages/server into packages/kap-server and export it there - repoint the CLI server subcommands, tests, and dev scripts at kap-server; relabel the web dev backend presets default/multi - delete packages/server and update workspace bookkeeping (flake.nix, pnpm-lock.yaml, changeset ignore docs, AGENTS.md, agent-core-dev skill)
Scenarios 04-stateless-controls, 10-prompt-queue-steer and 12-send-and-cancel assert through the /api/v1/debug/prompts/* introspection routes, which only the deleted v1 server mounted — kap-server's --debug-endpoints is a documented no-op, so these scenarios can only 404 now. The vitest e2e files using the same surface already skip when it is absent.
4e2d4a1 to
b5582db
Compare
Related Issue
No linked issue — the problem is explained in the next section.
Problem
The repo carried two server implementations behind an experimental flag: the legacy v1 server (
packages/server, backed byagent-core) and kap-server (packages/kap-server, backed byagent-core-v2).kimi server run/kimi webbooted v1 by default and only routed to kap-server whenKIMI_CODE_EXPERIMENTAL_FLAGwas set. kap-server has reached/api/v1wire parity (it shares the@moonshot-ai/protocolschemas and passes the full e2e surface), so keeping the v1 package around doubles maintenance and leaves ambiguity about which engine is the product.What changed
kimi server run/kimi webnow boot kap-server unconditionally; the experimental gate on the server path is removed. All existing CLI options are forwarded as before, and the daemon idle-shutdown wiring (connection-count driven) is preserved. Thekimi -pprint-mode v2 gate andKIMI_CODE_EXPERIMENTAL_MULTI_SERVERare intentionally untouched.svc: launchd / systemd / schtasks behindkimi server installand friends) — was moved topackages/kap-server/src/svctogether with its tests, and re-exported from the kap-server public surface, so CLI call sites only change their import source.run,kill,ps,rotate-token, daemon/lifecycle plumbing) now import from@moonshot-ai/kap-server; the@moonshot-ai/serverdependency is dropped andpackages/serveris deleted.flake.nixpath/name lists,pnpm-lock.yaml, changeset docs, root dev scripts (dev:v1removed;dev:servernow boots kap-server), kimi-web dev-proxy presets relabeleddefault/multi, and the agent-core-dev skill docs now treat the protocol schema plus the existing kap-server routes as the/api/v1contract source of truth./api/v1keeps the same protocol schemas, and/api/v1/metacontinues to reportbackend: "v2".Verification: kap-server typecheck + 607 tests (including the 60 migrated svc tests), apps/kimi-code typecheck + 460 CLI tests, apps/kimi-web typecheck, oxlint (0 errors), the nix workspace sync check, and a smoke boot of
kimi server runwith no env flags that returnedbackend: "v2"from/api/v1/meta.Checklist
gen-changesetsskill, or this PR needs no changeset. (.changeset/kap-server-default-engine.md:@moonshot-ai/kimi-codeminor,@moonshot-ai/kap-serverpatch)gen-docsskill, or this PR needs no doc update. (env-var docs stay accurate: the flag still gateskimi -pand the tool-select master switch)