Repository navigation
fix(workspace): complete session-id remap (relationships + pins) at reload/switch sites (#248) - #274
Merged
Merged
Conversation
From the codebase-wide id-coherence audit. replaceSession (reload /
provider-switch / resume / rewind) and reloadAgentSessions ('reload all')
mint fresh session ids but only remapped the tile tree, detached/dispatch
focus, and tiled lanes — NOT the SessionMeta relationship pointers
(linkedParentId / orchestrationParentId / orchestrationRootId) or the pinned
list. So a linked/orchestration CHILD of a reloaded agent kept pointing at
the dead parent id (rendering top-level, breaking parent-scoped orchestration
reads), and a pinned agent silently dropped out of the Pinned section on
reload. Only rehydrate handled relationships.
- Move remapSessionMetaRelationships to a neutral src/.../workspace/idRemap.ts
(avoids a persistence<->actions import cycle) and add remapSessionsRelationships
(remap pointers across a whole sessions record) + remapPinnedSessionIds.
- Apply both at replaceSession and reloadAgentSessions. rehydrate now imports
the shared helper (re-exported for its historical import path).
Deferred to their own follow-ups (documented in the PR): switchProvider's
malformed synthetic ClaudeEntry (needs the transcript-translation contract
investigated, not a safe ride-along), spotlight/reader 'follow on remap'
(cross-slice; already sanity-hook-cleared), undoClose relationship preservation
(deeper: restored sessions get meta from spawn(), which drops relationships
entirely), and UiShell transient modal ids.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the codebase-wide id-coherence audit you asked for. Closes the remaining incomplete-remap gaps of the same class as #266/#267/#271/#272/#273.
Bug
replaceSession(reload / provider-switch / resume / rewind) andreloadAgentSessions("reload all") mint fresh session ids but only remapped the tile tree, detached/dispatch focus, and tiled lanes — not:linkedParentId/orchestrationParentId/orchestrationRootId). A linked/orchestration child of a reloaded agent kept pointing at the now-dead parent id → renders top-level, and parent-scoped orchestration MCP reads break.pinnedSessionIds— a pinned agent that got a fresh id silently dropped out of the Pinned section.Only
rehydratehandled relationship pointers (viaremapSessionMetaRelationships).Fix
src/renderer/src/workspace/idRemap.ts(avoids a persistence↔actions import cycle), housing the movedremapSessionMetaRelationshipsplusremapSessionsRelationships(remap pointers across a whole sessions record — so a session whose id changed has every other session's pointer to it updated) andremapPinnedSessionIds.replaceSessionandreloadAgentSessions.rehydratenow imports the shared helper (re-exported there for its historical import path).Scope / deferrals (deliberate, with rationale)
Kept to the clearly-correct, in-store, unmitigated fixes. Explicitly deferred to their own follow-ups:
switchProvidermalformed syntheticClaudeEntry(missinguuid/parentUuid/timestamp) — real, but needs the transcript-translation/resume contract investigated first; not a safe ride-along in a state-coherence PR.useSpotlight/ReaderModeSanity(UX polish, not correctness).undoCloserelationship preservation — deeper issue: restored sessions get their meta fromspawn(), which doesn't carry relationship fields at all.The audit also gave a clean bill to the IPC subscription layer and confirmed no other
updateRuntime-class "method called but not exposed" bugs.Verification
npm run buildgreen.No new test files (repo convention).