Subagents launched via the task tool run as sub-sessions with their own session_id. Because every SessionFs RPC carries session_id, and the standard create_session_fs_handler factory binds a fresh SessionFsProvider per session_id, a subagent's SessionFs scope is disjoint from the parent's. The parent's spilled tool outputs are therefore unreachable from the subagent.
This breaks any flow where the parent agent escalates to task after an "Output too large… Saved to: /session-state/temp/X.txt" spill. The subagent's response in our trace:
The file path /session-state/temp/1776981956649-copilot-tool-output-nf0exj.txt does not exist in the current environment. The directory structure you referenced doesn't appear to be available.
This is independent of #1091: even if the spill template stopped referencing tools the consumer disabled, task would still be referenced as a fallback (the spill suggests "tools like grep, head/tail, view, ... or jq"), and task is structurally unable to reach a parent-session file because its sub-session has its own SessionFs scope.
Reproduction
- Provide a custom
SessionFsProvider via create_session_fs_handler, with a factory that binds per session.session_id (the standard pattern).
- Register a custom tool that returns >32KB so it triggers spill.
- Prompt the parent agent to invoke that tool, then to delegate (e.g. "use the task tool to summarize the result").
- Parent agent calls the tool → spill writes to its
{base}/{parent_session_id}/session-state/temp/X.txt. Parent invokes task with the spill path in the prompt. Subagent's SessionFs scope is {base}/{subagent_session_id}/; the file at the parent's path is not visible. Subagent reports the file doesn't exist.
Possible fixes (any one works)
- Don't reference
task in the spill template — it's structurally never a valid read tool for a parent-session file.
- Share SessionFs scope across all sessions in the same
task tree (or at least for paths under session_state_path).
- Provide a per-task-tree workspace handle distinct from per-session SessionFs.
Related
Versions
Reproduced on github-copilot-sdk 0.3.0 with bundled Copilot CLI 1.0.36-0. Walked the changelogs through CLI 1.0.40-0 (latest pre-release) — no spill-related fixes shipped, so this is current behavior.
Subagents launched via the
tasktool run as sub-sessions with their ownsession_id. Because every SessionFs RPC carriessession_id, and the standardcreate_session_fs_handlerfactory binds a freshSessionFsProviderper session_id, a subagent's SessionFs scope is disjoint from the parent's. The parent's spilled tool outputs are therefore unreachable from the subagent.This breaks any flow where the parent agent escalates to
taskafter an "Output too large… Saved to: /session-state/temp/X.txt" spill. The subagent's response in our trace:This is independent of #1091: even if the spill template stopped referencing tools the consumer disabled,
taskwould still be referenced as a fallback (the spill suggests "tools like grep, head/tail, view, ... or jq"), andtaskis structurally unable to reach a parent-session file because its sub-session has its own SessionFs scope.Reproduction
SessionFsProviderviacreate_session_fs_handler, with a factory that binds persession.session_id(the standard pattern).{base}/{parent_session_id}/session-state/temp/X.txt. Parent invokestaskwith the spill path in the prompt. Subagent's SessionFs scope is{base}/{subagent_session_id}/; the file at the parent's path is not visible. Subagent reports the file doesn't exist.Possible fixes (any one works)
taskin the spill template — it's structurally never a valid read tool for a parent-session file.tasktree (or at least for paths undersession_state_path).Related
Versions
Reproduced on
github-copilot-sdk0.3.0 with bundled Copilot CLI 1.0.36-0. Walked the changelogs through CLI 1.0.40-0 (latest pre-release) — no spill-related fixes shipped, so this is current behavior.