Files
ai-artifacts/projects/dotfiles/050-pi-subagents-fork-context-task.md
2026-08-01 14:05:09 -04:00

1.3 KiB

status, parent, blocked-by, tags
status parent blocked-by tags
open 027-pi-subagents-implementation-spec-task
046-pi-subagents-minimal-tracer-bullet-task
ticket/task/afk

Implement fork context mode

Question

Add fork context mode so a spawn can give the worker the parent active-branch transcript snapshot and delegated-role wrapper while independent context remains clean by default.

What to build

Implement the second version-one context mode. A forked worker should start from the active branch session snapshot and receive a small delegated-role wrapper with the per-call prompt. Independent workers should remain transcript-clean. Named agents that declare allowedContexts should reject disallowed spawn overrides.

Acceptance criteria

  • fork serializes the parent session header and active branch entries into a child-startable session.
  • The forked worker receives the parent active-branch context plus the delegated request wrapper.
  • independent workers still do not receive parent transcript context.
  • allowedContexts rejects disallowed context overrides.
  • Tests or manual checks distinguish forked and independent context visibility.

Implementation Notes

Do not summarize, strip tool output, or compact before spawning. Let child Pi handle normal compaction.