Conversation
🦋 Changeset detectedLatest commit: d553c86 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c305d4436b
ℹ️ 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 target: ToolAvailabilityTarget = { | ||
| isSubagentPreview: true, | ||
| environment: this.environment, | ||
| }; |
There was a problem hiding this comment.
Avoid filtering subagent tools by the caller environment
When the experimental environment argument sends a subagent to a different environment, this preview evaluates capability-gated tools against the caller's binding instead. SessionSubagentService.spawn resolves that argument into a separate child binding before activation, so a caller in a process-only environment will have Read/Edit omitted from the Agent description even when the selected target has fs (and a filesystem-capable caller can advertise them for a process-only target). Do not use the caller environment to prune descriptions when the eventual subagent environment is selectable.
Useful? React with 👍 / 👎.
| return this.knownToolReferences().filter( | ||
| (ref) => !contributionNames.has(ref.name) || available.has(ref.name), | ||
| ); |
There was a problem hiding this comment.
Preserve user-tool overrides in subagent descriptions
When a user registers a tool named WebSearch while no web-search provider is configured, the registry keeps that user tool and SessionSubagentService inherits it into the child. This filter nevertheless sees the built-in WebSearch contribution, marks it unavailable, and removes the name even though the live registry entry is the user tool. Consequently profiles that allow WebSearch are described as lacking a tool the subagent will actually receive. Base the availability filter on the live entry/source, not merely on a same-named contribution.
Useful? React with 👍 / 👎.
c305d44 to
fca3586
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Requirement or Bug
子 agent 的工具描述可能列出实际无法启用的工具,例如未配置搜索服务时仍宣称可以使用 WebSearch。
Bug Reproduction Steps
Agent工具描述中的子 agent 工具名单,其中仍包含 WebSearch。关闭 WaitFor 或缺少工具所需的运行环境能力时,也会出现相同问题。
Root Cause
工具激活会检查贡献的
when条件和运行环境能力,但描述生成只枚举静态贡献。描述与激活现在复用同一套可用性判断,并继续按目标 profile 应用工具策略。媒体工具单独按可选或强制子模型的能力生成候选项,显式工具名单和未声明
tools的自定义 profile 共用此结果。这样父模型支持图片、强制子模型为纯文本时,不会从父工具注册表误带入 ReadMediaFile;父模型为纯文本而子模型支持媒体时,也能正确列出它。用户提供的同名媒体工具优先保留。select_tools还检查动态工具 flag 和可选或强制子模型的能力,避免未声明tools的自定义 profile 列出实际不可用的工具。Code Changes
子 agent 继续继承调用方的运行环境;模型选择策略和 MCP 通配符匹配规则不变。
Behavior Changes and Affected Users
Tools: all或all except ...tools的自定义 agent 用户select_toolstools的自定义 agent 用户,含父子模型能力不同的配置现有工具描述测试覆盖 provider 缺失与恢复、WaitFor、NotifyUser、运行环境能力、用户覆盖、profile 权限差异、媒体模型配置及 step hooks 后的刷新;相关 loop 快照和 compaction token 断言同步更新。新增 6 组
select_tools描述测试,覆盖关闭 flag、缺少能力、父子能力不同和强制子模型;其中 3 组在修复前失败、修复后通过。验证:
Checklist
gen-changesetsskill;沿用已有 CLI patch changeset,同一项工具描述修复无需重复条目。gen-docsskill;配置语义和使用方式不变,无需额外文档更新,受影响的内置指引已在此 PR 修改。