Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 0b07df4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
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. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b07df447d
ℹ️ 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".
| const removed = lifecycle.removed.filter((name) => declaredDynamicTools.delete(name)); | ||
| if (removed.length === lifecycle.removed.length) { | ||
| const text = lifecycle.added.some((name) => lifecycle.removed.includes(name)) | ||
| ? wrapSystemReminder(renderLoadableToolsAnnouncement(lifecycle.added, lifecycle.removed)) |
There was a problem hiding this comment.
Update the request-shaping contract for projected reminders
This branch replaces part.text when projecting persisted same-name replacement announcements, but the LLM design contract at packages/agent-core-v2/docs/en/llm.md:67 still says that shapeActiveHistory narrows lifecycle metadata without rewriting the reminder text. Update that contract to distinguish the projected normalization from the unchanged persisted history; otherwise it documents an invariant that this fix intentionally breaks.
AGENTS.md reference: AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
`bun scripts/upstream-ledger.mjs --refresh` at upstream/main 4eb2919 added 126 rows, so every open upstream commit and every PR it references now has a ledger row: 0/596, down from 125 at 8bf8ba3 and 126 at the fetched tip. The refresh only reads `upstream/main ^ main`, so the three release-2.6.2 commits named by the mission (MoonshotAI#4875/MoonshotAI#4905/MoonshotAI#4922) gained rows with the refresh's row shape. Settled with live probes in this tree: - ported: MoonshotAI#5533 (docs 2.8.1 changelog), MoonshotAI#4875 (registry search_url and feedback_url plus the feedback service), MoonshotAI#4905 (Kimi upload status validation in packages/core), MoonshotAI#4922 (swarm task events in sessionTaskFeed), MoonshotAI#5438 (unload only declared dynamic tools), MoonshotAI#5592 (dynamic tool replacement order), MoonshotAI#5595 (append-log known length), MoonshotAI#5573 (skill roots for every work dir), MoonshotAI#5576 (date reminder cwd comparison), MoonshotAI#5618 (session titles for skill openers), MoonshotAI#5638 (frozen loop tool baseline), MoonshotAI#5626 (legacy turn-input origins) - partial: MoonshotAI#5505 (processLiveness source and consumers present; the upstream unit test file was never carried), MoonshotAI#5571 (program-resume and OSC 7577 present; the upstream test helper was never carried), MoonshotAI#5532 (gitService half present; fsService still leaks the environment lease at fsService.ts:1133 and :1267), MoonshotAI#5557 (app-client icon registry kept; the move to app-ui was never carried) - not-applicable: MoonshotAI#4655 (upstream reverted auto review in MoonshotAI#5649), MoonshotAI#5333 (PLAYBOOK:111 deliberate flat experimental flags) M39's "likely present" list was checked, not trusted: MoonshotAI#5438 is present (upstream test passes), MoonshotAI#5487 is not (nativeStartSettleMs/leg.nativeSettled absent), MoonshotAI#5635 is not (ToolsSettled absent), MoonshotAI#5429 needs a visual probe. The remaining 194 pending rows stay open with their reasons; no feature was ported and no upstream-drift allowlist entry was added. Verification: verify -> 332 closed rows, 332 carry every file of their PR; 317 probes pass, 2 foreign-runner skips, 0 fail; a second verify is byte-identical (ledger sha256 cbf53638...). Probe tests 29 pass; bun run lint and node scripts/checks/ratchet.mjs green.
Requirement or Bug
同名动态工具的定义更新会同时产生 removed 和 added。当前公告先说新增、再说移除,并要求不要选择被移除的名字;模型可能因此拒绝重新加载实际可用的新定义。本 PR 使公告与注册表的移除后新增语义一致,并在请求投影中修正已保存的同名替换公告。
Bug Reproduction Steps
select_tools加载并调用某个动态 MCP 工具。Root Cause
注册状态与公告折叠已经按 removed→added 处理同名替换,模型看到的文字顺序却相反。旧文案的禁止选择指令也没有说明后续新增可以恢复可加载状态。
Code Changes
unload_tools和重新select_tools加载 schema 的流程保留。Behavior Changes and Affected Users
必要回归验证公告顺序、原记录不变、无关内容保留、
unload_tools及新 schema 重新加载。真实模型已验证新会话同名更新、冷恢复,以及大更新前会话先加载旧定义、升级后更新和冷恢复调用。**验证边界:**一个此前已积累错误拒绝回复的会话仍沿用旧结论,没有重新选择工具;修正后的公告已到达模型。因此本 PR 修正公告与投影,不承诺所有已有错误回复历史都会自动恢复,也不改写这些历史回复。
Validation
pnpm exec vitest run --reporter=agent packages/agent-core-v2/test/agent/toolSelect/dynamicTools.test.ts packages/agent-core-v2/test/agent/toolSelect/toolSelectService.test.tspnpm exec vitest run --reporter=agent packages/agent-core-v2/test/agent/toolSelect/toolSelect.e2e.test.ts:17 条引擎回归通过,前述单测 109 条通过。pnpm exec tsc -p packages/agent-core-v2/tsconfig.json --noEmitpnpm lintpnpm run check:duplication 46beafd3da53441749d6d0ceadebad7f75b320e8Checklist
/approve). No linked issue; reproduction and scope are documented above.gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. No configuration or usage changes.