Skip to content

feat(coding-agent): persist subagent lifecycle state - #115

Merged
Issacboy123 merged 2 commits into
feat/persist-subagent-statefrom
feat/persist-subagent-lifecycle
Aug 28, 2026
Merged

Issacboy123 merged 2 commits into
feat/persist-subagent-statefrom
feat/persist-subagent-lifecycle

Conversation

@Issacboy123

@Issacboy123 Issacboy123 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR makes newly started subagent work durable in saved parent sessions. Before a child begins provider work, Diffex now saves enough information to find that child and understand how it was configured after a restart. Later status and history updates are also recorded, while in-memory and unsaved sessions continue to behave as temporary sessions.

Reasoning

The root-local factory and existing controller lifecycle are the narrowest ownership boundaries for choosing durable storage and recording state. Requiring the child header and queued roster before spawn acceptance prevents accepted work from becoming undiscoverable after restart. Later transitions remain best effort so a persistence failure does not make live controller state untruthful or halt already accepted work; strict admission failures instead restore the prior parent leaf.

Changes

  • Made the root-local child-session factory choose parent-owned storage for persisted parents and retain in-memory storage elsewhere.
  • Captured the child model, thinking level, built-in tools, and harness revision with each roster record.
  • Gated spawn acceptance on a durable child header and queued full-roster snapshot before scheduling provider work.
  • Persisted later status and child-leaf changes best effort and surfaced write failures through existing error and diagnostic paths.
  • Persisted queued and running children as interrupted during graceful disposal, while still disposing after a snapshot failure.
  • Added regressions for strict spawn ordering, admission rollback, lifecycle snapshots, graceful disposal, diagnostics, and unchanged in-memory, disabled, and unsaved behavior.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-persistence.test.ts test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/agent-session-harness-version.test.ts test/session-manager/fork-branch.test.ts test/session-selector-path-delete.test.ts
  • npm run check

@Issacboy123 Issacboy123 added enhancement New feature or request coding-agent labels Aug 25, 2026
@Issacboy123 Issacboy123 self-assigned this Aug 25, 2026
@Pepps233
Pepps233 force-pushed the feat/persist-subagent-lifecycle branch from 228eacb to b941e78 Compare August 25, 2026 14:36
@Pepps233
Pepps233 self-requested a review August 25, 2026 14:55
@Issacboy123
Issacboy123 force-pushed the feat/persist-subagent-lifecycle branch from b941e78 to 29d33e0 Compare August 27, 2026 10:54
@Issacboy123
Issacboy123 force-pushed the feat/persist-subagent-lifecycle branch from 29d33e0 to 2877a2e Compare August 27, 2026 23:11
@Issacboy123
Issacboy123 merged commit 8b79658 into main Aug 28, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants