Skip to content

feat(coding-agent): add durable subagent state storage - #120

Merged
Issacboy123 merged 2 commits into
mainfrom
feat/persist-subagent-state
Aug 28, 2026
Merged

Issacboy123 merged 2 commits into
mainfrom
feat/persist-subagent-state

Conversation

@Issacboy123

Copy link
Copy Markdown
Contributor

Summary

This PR lays the storage groundwork for subagents to survive when a saved parent session is closed and reopened. It gives each parent a safe place for child histories and records which subagents belong to the currently selected session branch. It also validates saved data so one damaged or conflicting child record does not prevent other children from being recovered later.

Reasoning

Storing complete snapshots as reserved parent-session entries reuses existing JSONL branch semantics and lets the newest entry, including an empty reset barrier, fully mask older state. Keeping child files beneath a parent-owned namespace prevents them from appearing in normal session discovery, while independent record validation allows usable siblings to survive corrupt or conflicting data. The child-header durability seam remains internal because it exists only to support dependent work admission.

Changes

  • Added the versioned diffex.subagents roster codec with strict field validation and additive-field tolerance.
  • Added latest-selected-branch lookup, empty-roster masking, and isolation for malformed children, duplicate names, and shared child IDs.
  • Added parent-owned child-session storage with UUIDv7 validation, path containment, link rejection, and child header, parent identity, and leaf verification.
  • Added an internal synchronous child-header persistence helper.
  • Added focused coverage for roster masking and validation, owned-path safety, listing exclusion, identity checks, leaf checks, and header durability.

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-state branch from 92dfa94 to db07c97 Compare August 25, 2026 14:36
@Issacboy123
Issacboy123 force-pushed the feat/persist-subagent-state branch from db07c97 to 45aaa94 Compare August 27, 2026 10:54
@Issacboy123
Issacboy123 force-pushed the feat/persist-subagent-state branch from 45aaa94 to 3b34cb7 Compare August 27, 2026 23:11
@Issacboy123
Issacboy123 merged commit 283d0a1 into main Aug 28, 2026
2 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