Skip to content

docs(task-resource): strengthen resume arg emphasis for subagent dialogue#14

Open
ngoclam9415 wants to merge 1 commit into
developfrom
docs/task-resource-resume-emphasis
Open

docs(task-resource): strengthen resume arg emphasis for subagent dialogue#14
ngoclam9415 wants to merge 1 commit into
developfrom
docs/task-resource-resume-emphasis

Conversation

@ngoclam9415
Copy link
Copy Markdown
Contributor

Summary

resume on TaskResource.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.

  • Dynamic tool description (_build_task_description): promoted resume from one bullet inside Usage notes to a dedicated === CRITICAL === section with an explicit NEW-vs-EXISTING decision rule and the failure mode named outright ("brand-new subagent with ZERO memory").
  • Placeholder docstring (task() signature): expanded the resume: 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 Task invocation) 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

  • Visually inspect the rendered Task tool description in a live session (any agent that registers a TaskResource) — confirm the === CRITICAL === block appears.
  • Confirm no test regressions: uv run pytest (no test changes, but smoke-check).
  • (Optional, behavioral) Observe whether calling agents pass resume more reliably on follow-up turns after this lands.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant