feat(state): multi-session pipeline state isolation#2
Merged
Conversation
Per-session state caching prevents concurrent sessions from corrupting each other's pipeline stage. rebuildAndCache dual-writes per-session + global cache, loadState prefers per-session, currentSessionId no longer reads cross-session state.json, task ID derives maxId from event log, duplicate IDs are conflict-annotated instead of silently dropped. - Sanitize session IDs in filenames (path traversal prevention) - Fix stage.ts loadState bypass for apex status / MCP status - Stale per-session cache cleanup in apex init (7-day TTL) - 11 new tests in session-isolation.test.ts Co-Authored-By: Claude Opus 4.6 (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.
Summary
rebuildAndCache("state")dual-writes per-session + global cache;loadState()prefers per-sessioncurrentSessionId()no longer reads cross-sessionstate.json; session IDs sanitized for path safetytaskCreate()derives maxId from event log (not stale cache); duplicate IDs conflict-annotatedapex init(7-day TTL)Test plan
session-isolation.test.ts— all passAPEX_SESSION_IDsee isolated stagesapex statusreads per-session cache (stage.ts fix)Artifacts
docs/specs/multi-session-state-isolation.mddocs/brainstorms/session-isolation-requirements.mddocs/plans/session-isolation-plan.mddocs/execution/session-isolation-log.mddocs/reviews/session-isolation-review.md🤖 Generated with Claude Code