Create GlobalSessionRegistry for centralized session storage#766
Closed
cyrusagent wants to merge 3 commits intomainfrom
Closed
Create GlobalSessionRegistry for centralized session storage#766cyrusagent wants to merge 3 commits intomainfrom
cyrusagent wants to merge 3 commits intomainfrom
Conversation
…YPACK-725) Implements Phase 1 of CYPACK-724 architectural refactor. Creates new GlobalSessionRegistry class that centralizes session storage across all repositories, enabling cross-repository session lookups for orchestrator workflows. Key features: - Session CRUD operations (create, get, update, delete, getAll) - Entry management (add, get, update entries) - Parent-child session mapping for orchestrator workflows - EventEmitter with lifecycle events (sessionCreated, sessionUpdated, sessionCompleted) - Serialization/deserialization (v3.0 format) - Cleanup method for removing old sessions - Comprehensive unit tests (45 tests) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add changelog entry for GlobalSessionRegistry implementation with PR link. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix TypeScript error in updateEntry method by ensuring type and content fields are never undefined when applying partial updates. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This was referenced Jan 16, 2026
Contributor
Author
|
Closing - work merged into final PR #773 |
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
Implements Phase 1 of CYPACK-724 architectural refactor. Creates a new
GlobalSessionRegistryclass that centralizes session storage across all repositories, enabling cross-repository session lookups for orchestrator workflows.Currently, sessions are stored per-repository in
AgentSessionManager. When a parent orchestrator in Repository A creates a child issue in Repository B, the child cannot find the parent session because sessions are siloed. TheGlobalSessionRegistrysolves this by owning ALLCyrusAgentSessionobjects globally.Implementation
Core Features
createSession,getSession,updateSession,deleteSession,getAllSessionsaddEntry,getEntries,updateEntryfor conversation historysetParentSession,getParentSessionId,getChildSessionIdsfor orchestrator workflowssessionCreated,sessionUpdated,sessionCompletedserializeState,restoreStatewith v3.0 format for persistencecleanup(maxAgeMs)to remove old sessionsData Structures
sessions: Map<string, CyrusAgentSession>- all sessions keyed by session IDentries: Map<string, CyrusAgentSessionEntry[]>- all entries keyed by session IDchildToParentMap: Map<string, string>- child session ID → parent session IDTesting
Comprehensive unit tests with 45 test cases covering:
All tests passing ✅
Files Changed
packages/edge-worker/src/GlobalSessionRegistry.ts- Main implementationpackages/edge-worker/test/GlobalSessionRegistry.test.ts- Comprehensive testspackages/edge-worker/src/index.ts- Export GlobalSessionRegistry and typesCHANGELOG.internal.md- Document internal changesMigration Notes
This is Phase 1 of the refactor - introducing the class with full functionality and tests. Future phases will:
No breaking changes in this PR - the new class is isolated and not yet integrated.
Closes CYPACK-725