Repository navigation
fix(kap-server): apply swarm mode from prompt submissions - #4460
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 43d2eff 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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
RealKai42
approved these changes
Oct 27, 2026
Merged
6 tasks done
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 4, 2026
The behaviour of MoonshotAI#4421 has been in the requester since 94397aa, but its suite still asserted only that the lowered system message lost its `tools` field, which a message kept in place would also satisfy. Assert instead that no system message survives and the history keeps its length, and rename the case after what it protects. Also settle ten ledger rows that were already implemented here: MoonshotAI#3733, MoonshotAI#4413, MoonshotAI#4418, MoonshotAI#4421, MoonshotAI#4435, MoonshotAI#4460, MoonshotAI#4465, MoonshotAI#4516, MoonshotAI#4523, MoonshotAI#4532 and the MoonshotAI#4558 test calibration, each with a probe over the suite that pins it. Two rows carried a probe without a test-name selector (MoonshotAI#4557, MoonshotAI#4558), which aborted `--verify` for every other row; MoonshotAI#4557 is a changelog sync and now carries a manual probe.
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.
Requirement or Bug
Related: #3830。本 PR 只覆盖其中的 Swarm 首轮失效;Plan 与 goal 由独立 PR 处理。
Bug Reproduction Steps
swarm_mode: true。GET /api/v1/sessions/{session_id}/status,或观察首轮是否注入 Swarm 模式。swarm_mode: false,首轮未进入 Swarm;再次通过 session profile 开启后才正常。Root Cause
promptSubmissionSchema已接受swarm_mode,desktop / web 首轮也已经携带该字段,但POST /sessions/{session_id}/prompts只应用 model、thinking、permission 等覆盖项,从未读取swarm_mode。本 PR 是根本修复:在 prompt 入队前应用该字段,而不是要求客户端额外先发一次 profile 更新。
Code Changes
POST /sessions/{id}/prompts validate media references and skills resolve the target agent apply profile / model / thinking / permission + if swarm_mode is present and differs from current state + enter or exit Swarm before submitting the prompt submit the promptswarm_mode已生效;plan_mode与 goal 字段不在本 PR 范围内。Behavior Changes and Affected Users
swarm_modeswarm_mode,即保持本次提交不改变 Swarmswarm_modeplan_mode、goal_objective、goal_controlpackages/kap-serverprompt 提交路由。true不重复 enter、false能 exit,以及 enter/exit 均早于 prompt submit;既有 prompt 测试覆盖字段省略时的旧行为。Validation
pnpm exec vitest run packages/kap-server/test/prompts.test.ts --maxWorkers=1:72/72 通过。pnpm --filter @moonshot-ai/kap-server typecheck:通过。pnpm exec oxlint packages/kap-server/src/routes/prompts.ts packages/kap-server/test/prompts.test.ts:0 error;仅有 2 个测试文件既有 warning。node scripts/check-no-comments.mjs:通过。pnpm --filter kimi-code-docs run build:通过。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.