Give subagents per-run transcripts, resume, persisted notices, and the Background request field (N2 WP5) #90

Merged
weichen merged 1 commits from feature/n2-subagent-wp5 into main 2026-10-07 14:25:04 +00:00
Owner

Why: child runs had no independent transcript, no resume path (sealed interrupted only), in-memory completion notices lost on restart, and the subagent Background declaration had no consumer.

What:

  • Per-run transcript dirs: request.json at spawn, transcript.jsonl + done.json at finish, partial flush on InterruptRunning (auxiliary — write failures never abort spawns).
  • ResumeInterruptedChildren: interrupted child runs with a stored request re-spawn as background runs at startup with the original task plus the prior transcript path in the hint; done/resumed markers keep it idempotent; pre-WP5 runs stay sealed.
  • Notices persist in pending_notices (migration v17, both dialects): persist on enqueue, delete on successful delivery, LoadPendingNotices at startup.
  • squadadapter delegate factory honors Request.Background (Agent-Native#29) with a sync fallback when the host lacks background support.

Evidence: go test -count=1 ./... green; acceptance tests for transcript files, resume respawn idempotence, and notice redelivery.

Impact: new aux directory tree under the workspace root; restart behavior changes intentionally (resume + notice redelivery) and is recorded in the N2 card.

Refs: Agent-Native#29, Agent-Squad#33, Agent-System-Documents#42

Why: child runs had no independent transcript, no resume path (sealed interrupted only), in-memory completion notices lost on restart, and the subagent Background declaration had no consumer. What: - Per-run transcript dirs: request.json at spawn, transcript.jsonl + done.json at finish, partial flush on InterruptRunning (auxiliary — write failures never abort spawns). - ResumeInterruptedChildren: interrupted child runs with a stored request re-spawn as background runs at startup with the original task plus the prior transcript path in the hint; done/resumed markers keep it idempotent; pre-WP5 runs stay sealed. - Notices persist in pending_notices (migration v17, both dialects): persist on enqueue, delete on successful delivery, LoadPendingNotices at startup. - squadadapter delegate factory honors Request.Background (Agent-Native#29) with a sync fallback when the host lacks background support. Evidence: go test -count=1 ./... green; acceptance tests for transcript files, resume respawn idempotence, and notice redelivery. Impact: new aux directory tree under the workspace root; restart behavior changes intentionally (resume + notice redelivery) and is recorded in the N2 card. Refs: Agent-Native#29, Agent-Squad#33, Agent-System-Documents#42
weichen added 1 commit 2026-10-07 14:23:54 +00:00
Why: child runs had no independent transcript, no resume path (sealed
interrupted only), in-memory completion notices lost on restart, and
the subagent Background declaration had no consumer.
Evidence: go test -count=1 ./... green; TestSubagentTranscriptFilesWritten
(request/transcript/done files), TestResumeInterruptedChildrenRespawns
(re-spawn with original task + transcript-path hint, resumed.json
idempotent), TestNoticesPersistAndRedeliverAfterRestart (persist →
reload → deliver → delete), migration v17 pending_notices with up/down
on both dialects.
Impact: per-run transcript dirs under the workspace root (auxiliary,
write failures never abort spawns); interrupted children with a stored
request re-spawn as background runs at startup (pre-WP5 runs stay
sealed); notices survive restart; delegate factory honors
Request.Background with a sync fallback when the host lacks background
support.
Refs: Agent-Native#29, Agent-Squad#33, N2 plan WP5
weichen merged commit 7980a8a219 into main 2026-10-07 14:25:04 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#90