Repository navigation
revert: remove default_swarm_mode config and restore swarm enter reminder - #5409
Conversation
|
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4957865848
ℹ️ 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".
| .on(SwarmModeExit, () => false) | ||
| .on(ContextAppendMessage, (s, e) => isActiveSwarmReminder(e.message) || s) | ||
| .on(ContextSpliced, (s, e) => { | ||
| if (e.deleteCount !== 0) return s; |
There was a problem hiding this comment.
Re-arm the reminder after history deletion
When compaction, context clearing, or replaceHistory removes the injected swarm reminder, the resulting ContextSpliced has a nonzero deleteCount, so this branch preserves swarmReminderDeliveredKey as true. The reminder service deliberately invokes providers again after compaction, but SwarmInjection.reminder() then returns undefined because it still considers the reminder delivered, leaving an active swarm without its workflow instructions. Recompute or clear the delivered state when the splice removes the reminder; the generic reminder tests already establish that reminders swallowed by compaction must be re-injected.
AGENTS.md reference: AGENTS.md:L116-L116
Useful? React with 👍 / 👎.
| "packages/agent-core-v2/test/features/skill/activateSkill.test.ts": 16, | ||
| "packages/agent-core-v2/test/features/skill/catalog/skill-tool-manager.test.ts": 19, | ||
| "packages/agent-core-v2/test/features/skill/skill.test.ts": 2, | ||
| "packages/agent-core-v2/test/features/swarm/swarm.test.ts": 3, |
There was a problem hiding this comment.
Replace the legacy model doubles instead of raising the baseline
This raises the ratchet specifically to permit the three new ctx.mockNextResponse(...) calls in the restored swarm reconciliation test. scripts/checks/test-doubles.mjs classifies those calls as legacy engine doubles and requires new cases to use the shared scripted testkit so model steps and strict verification remain consistent; increasing the baseline makes lint accept the new debt instead of enforcing that migration. Rewrite this test with the prescribed testkit fixture and leave the baseline unchanged.
AGENTS.md reference: AGENTS.md:L163-L163
Useful? React with 👍 / 👎.
|
|
||
| private reminder(): ContextInjectionResult<SwarmModeInjectionDisclosure> | undefined { | ||
| const trigger = this.options.getTrigger(); | ||
| if (trigger === null || trigger === 'tool' || this.options.isReminderDelivered()) return undefined; |
There was a problem hiding this comment.
Neutralize the reminder when swarm mode exits
After /swarm off or the automatic exit of a one-shot /swarm <task>, getTrigger() becomes null, so this provider emits nothing while the previously injected user message remains in every later model request. That message still says the agent is in swarm mode and directs it to call AgentSwarm, even though the tool now rejects the call because the mode is off; the slash command itself is not sent to the model as a counter-instruction. Emit an inactive/exit reminder or remove the active reminder when exiting, as the Plan and Tower mode injectors do.
AGENTS.md reference: AGENTS.md:L200-L202
Useful? React with 👍 / 👎.
4957865 to
05a6cb5
Compare
commit: |
Requirement or Bug
应发版要求,从
release/2026-11-25撤回 #5352(2b1b095f3bbf),不在本次发版中引入default_swarm_mode配置,并恢复进入 swarm 模式时的提醒。main分支不包含 #5352,本次只回滚 release 分支。Bug Reproduction Steps
N/A(回滚尚未发布到 npm 的特性提交)。
Root Cause
N/A(回滚提交)。
Code Changes
已 rebase 到
release/2026-11-25最新 tip(3ee3e4a7,ci: release packages (#5349))之上,对2b1b095f3bbf(#5352)做反向回滚:default_swarm_mode配置定义、会话创建时默认进入 swarm 模式的逻辑,以及 TUI 启动、Desktop 设置页、app-core daemon 映射、node-sdk 配置读写和 kap-server/config接口中的对应字段。enter-reminder.md与 swarm 注入/操作逻辑,进入 swarm 模式时重新注入提醒。packages/node-sdk/src/config/schema.ts和packages/kap-server/src/protocol/rest-config.ts中提取的公共配置字段结构(仅移除其中的 swarm 字段),避免把重复代码带回分支导致check:duplication失败。packages/kap-server/test/apiSurface.test.ts的HOST_CONTRACTdigest,匹配移除default_swarm_mode后的契约。关于版本与 CHANGELOG:
3ee3e4a7已将 #5352 的 7 个 changeset 消费进2.8.0的各包CHANGELOG.md(npm 当前最新仍为2.7.3,2.8.0尚未发布)。若合入本 PR 后直接重发2.8.0,需同步删掉各包CHANGELOG.md2.8.0小节里的 #5352 条目;若改发2.8.1,则需补一条 patch changeset。请发版维护者确认采用哪种方式。Behavior Changes and Affected Users
default_swarm_mode配置项config.toml、GET/POST /api/v1/config、SDK、Desktop 设置页支持default_swarm_mode,开启后新会话默认进入 swarm 模式release/2026-11-25canary 构建上配置过default_swarm_mode = true的用户/swarm或使用输入框开关enter-reminder.md,开启 swarm 模式不再注入提醒enter-reminder.md及注入逻辑,进入 swarm 模式时按原逻辑注入提醒受影响模块与验证情况:
agent-core-v2(swarm 配置、会话生命周期、提示词注入)、node-sdk、kap-server、app-core、app-i18n、Desktop 设置页、TUI 启动逻辑。pnpm lint与check:duplication通过;按要求未运行单元测试与类型检查。Checklist
/approve).(回滚 feat: add default_swarm_mode config and remove the swarm mode enter reminder #5352)gen-changesetsskill, or this PR needs no changeset.(feat: add default_swarm_mode config and remove the swarm mode enter reminder #5352 的 changeset 已被3ee3e4a7消费,CHANGELOG 处理方式见上文,待发版维护者确认)gen-docsskill, or this PR needs no doc update.(配置文档已随回滚恢复原状)