docs(task-resource): strengthen resume arg emphasis for subagent dialogue#14
Open
ngoclam9415 wants to merge 1 commit into
Open
docs(task-resource): strengthen resume arg emphasis for subagent dialogue#14ngoclam9415 wants to merge 1 commit into
resume arg emphasis for subagent dialogue#14ngoclam9415 wants to merge 1 commit into
Conversation
…alogue `resume` is the only mechanism for multi-turn dialogue with a subagent, but the calling agent often skips it — spawning fresh subagents that lose all prior context. Promote it from one bullet in `Usage notes` to a dedicated `=== CRITICAL ===` section in the dynamic tool description, with an explicit NEW-vs-EXISTING decision rule. Expand the placeholder docstring's `resume:` arg from one line to a paragraph covering channel role, failure mode of omission, and when to legitimately omit. Pure docstring change — no behavioral or API impact.
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
resumeonTaskResource.task()is the only channel for multi-turn dialogue with a subagent — but in practice the calling agent often ignores it and re-spawns fresh subagents that lose all prior context. This is a docstring-only fix to make the parameter impossible to overlook._build_task_description): promotedresumefrom one bullet insideUsage notesto a dedicated=== CRITICAL ===section with an explicit NEW-vs-EXISTING decision rule and the failure mode named outright ("brand-new subagent with ZERO memory").task()signature): expanded theresume:arg from one sentence to a paragraph covering its role as the primary dialogue channel, what happens with vs without it, and when omission is legitimate.No behavioral or API change. Pure documentation.
Why this is worth the token cost
The dynamic tool description (rendered to every calling LLM on every
Taskinvocation) grew by ~250 tokens. Justified — the failure mode it prevents (re-explaining context to a fresh subagent, or the subagent re-doing work) costs far more in per-call tokens and latency.Test plan
Tasktool description in a live session (any agent that registers aTaskResource) — confirm the=== CRITICAL ===block appears.uv run pytest(no test changes, but smoke-check).resumemore reliably on follow-up turns after this lands.