Skip to content

fix(subagents): preserve short ids across reloads - #86

Merged
tt-a1i merged 1 commit into
mainfrom
codex/issue-63-session-id-sequence
Aug 23, 2026
Merged

fix(subagents): preserve short ids across reloads#86
tt-a1i merged 1 commit into
mainfrom
codex/issue-63-session-id-sequence

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Closes #63

What changed

  • restore sa-N and btw-N high-water marks from the current Pi session branch on session_start
  • append an invisible, versioned Session watermark after every successful spawn
  • migrate existing sessions by recognizing legacy spawn/result entries when no watermark exists
  • initialize both manager counters from the restored values

Why

The manager already avoided reuse during one extension runtime. The actual collision boundary was /reload: Pi retains the transcript while the OpenPI runtime and its in-memory counters restart at zero. A stale sa-1 prefix could then resolve to a different child. Keeping the high-water mark in Pi Session entries preserves Pi as the lifecycle source of truth and does not alter model context or tool schemas.

Validation

  • bun run check
  • bun run test — 822 Node tests + 30 Vitest tests, 0 failures
  • focused ID/session tests — 26/26

@tt-a1i
tt-a1i merged commit 8f8903a into main Aug 23, 2026
2 checks passed
@tt-a1i
tt-a1i deleted the codex/issue-63-session-id-sequence branch August 23, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subagent short ids are recycled across delegation rounds — stale prefixes can target the wrong child

1 participant