Skip to content

fix(pi): persist migrated pi() session entries - #330

Merged
eersnington merged 1 commit into
stack/feat-pi-expose-the-pi-session-to-actor-code-as-c-pi-twupltryfrom
stack/fix-pi-persist-migrated-pi-session-entries-sqmnmyvr
Oct 5, 2026
Merged

eersnington merged 1 commit into
stack/feat-pi-expose-the-pi-session-to-actor-code-as-c-pi-twupltryfrom
stack/fix-pi-persist-migrated-pi-session-entries-sqmnmyvr

Conversation

@eersnington

@eersnington eersnington commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

A session stored by an older pi-coding-agent format is migrated in memory on every load, and its rows stay in the old format. This rewrites them once.

Before After
Load a session in an older format SessionManager migrates it in memory, on every load rewritten once, in one transaction
Stored pi_entry rows and header version old format current format
if ((stored.header.version ?? 1) >= CURRENT_SESSION_VERSION) return stored;
const entries = structuredClone(toFileEntries(stored));
migrateSessionEntries(entries); // Pi's own migration
// rewrite pi_entry and pi_session.header_json in one transaction
  • Uses Pi's own migrateSessionEntries. No migration of our own.
  • Stored sessions stay on the format the running pi-coding-agent writes, so a session format change upgrades every actor's storage once, on its next wake.

This is part 11 of 11 in a stack:

@eersnington
eersnington force-pushed the stack/feat-pi-expose-the-pi-session-to-actor-code-as-c-pi-twupltry branch from 84fbb11 to a0f6027 Compare October 5, 2026 18:53
@eersnington
eersnington force-pushed the stack/fix-pi-persist-migrated-pi-session-entries-sqmnmyvr branch from 92d2d90 to 2a34966 Compare October 5, 2026 18:53
@eersnington

Copy link
Copy Markdown
Member Author

send it

@eersnington
eersnington merged commit e70d9bc into stack/feat-pi-expose-the-pi-session-to-actor-code-as-c-pi-twupltry Oct 5, 2026
2 of 6 checks passed
@eersnington
eersnington deleted the stack/fix-pi-persist-migrated-pi-session-entries-sqmnmyvr branch October 5, 2026 19:00
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.

1 participant