Repository navigation
Conversation
🦋 Changeset detectedLatest commit: dd3e588 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: |
7Sageer
previously approved these changes
Nov 5, 2026
7Sageer
approved these changes
Nov 5, 2026
6 tasks done
This was referenced Nov 10, 2026
Closed
Closed
Merged
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
修复 #4719 的 P2 评论 指出的遗漏:不支持动态工具加载的模型分支仍读取初始旧定义。
模型不支持动态工具加载时,工具的同名更新仍会使用初始快照中的旧参数。运行中更新工具或恢复已有会话后,模型可能继续按旧定义调用工具。本 PR 让这类请求也使用当前有效的同名定义。
Bug Reproduction Steps
payload。payload;另外注册一个新的 runtime 工具。tool_use=true、dynamically_loaded_tools=false的请求解析工具列表。回归同时覆盖当前状态和序列化后恢复的旧状态,不需要模型网络请求。
Root Cause
defaultToolsForDisclosure(false)直接读取initialTools(),绕过了 #4719 已添加的同名定义更新逻辑,因此不支持动态加载的请求仍停留在旧快照。Code Changes
复用现有的有效工具解析:初始名称优先采用
current的同名定义,缺少当前定义时继续保留原初始定义。给该解析方法增加一个布尔参数,在不披露动态工具的请求中排除真正新增的 runtime 工具。生产修改只有三个行级变化;权限过滤、
select_tools关闭和动态历史剥离继续沿用已有路径。历史工具变更提醒同步改为以本次请求提供的工具定义为准;继续禁止
select_tools,保留运行时新增不可加载及已移除工具可能不可用的提醒。Behavior Changes and Affected Users
select_tools与历史select_tools,剥离请求中的动态声明已有测试文件增加当前状态、恢复状态两种回归,检查新参数、新增 runtime 排除、权限过滤、
select_tools不公开,以及持久化状态和历史保持不变。108 项聚焦测试、Core 类型检查和注释检查全部通过;局部类型感知 lint 为 0 错误,6 条警告均来自未修改的现有语句。验证边界:没有请求线上模型,也没有复测真实用户原会话。
后续提醒文案更新复用了现有测试,
dynamicTools.test.ts12 项通过;没有重复运行无关测试。验证
pnpm -C packages/agent-core-v2 exec vitest run test/agent/toolSelect/toolSelectService.test.ts test/agent/toolSelect/dynamicTools.test.ts --config vitest.config.tspnpm -C packages/agent-core-v2 exec tsc --noEmit -p tsconfig.jsonoxlint --type-awarenode scripts/check-no-comments.mjsgit diff --checkChecklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.这是已合入 #4719 的后续修复,目前未关联已获维护者
/approve的 issue。没有新增命令、配置或需要同步的公开文档。