agent: align subagent tool surface with runtime#4514
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
|
Follow-up pushed in e79f4c1. What changed:
Verified:
|
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.
Summary
task、run_skill、read_skill、install_skill、install_source、explore、research、review、security_review,避免 subagent 递归启动新的 agent 工作流。wait、bash_output、kill_shell。bash包装为 foreground-only:schema 不再暴露run_in_background;普通前台命令仍正常执行;如果仍传入run_in_background=true,会返回明确的 subagent 专用错误。tasksubagent、skill subagent,以及直接 CLI review subagent 路径。Why
Subagent 当前不注入后台 job manager,因此它无法真正启动或管理跨 turn 的后台任务。之前 subagent 可能继承 parent registry 中的
wait、bash_output、kill_shell,也可能看到包含run_in_background的bashschema。结果是模型会认为这些能力可用,但调用时只能在jobs.FromContext处失败,出现泛化的background execution is not available in this context之类错误。这违反了“工具 schema 应代表真实可用能力”的原则。本次改动让 subagent 的工具说明与实际 runtime 能力一致:不可用的后台 job 工具不再出现在工具列表里;
bash只声明前台能力;误传后台参数时返回更明确的错误,提示应运行前台命令或让 parent agent 启动后台任务。Result