refactor(core): move projected Session reads into Store - #46075
Merged
Conversation
This was referenced Aug 29, 2026
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.
Why
Session's public service still implements collection SQL and pagination even
though SessionStore already owns projected Session and message reads. That mixes
storage details with public policy, such as rejecting an unknown Session before
looking up a message cursor.
What Changes
Move the existing list and message queries into SessionStore. Session keeps the
public result wrapper and the existence check; callers see the same behavior.
Session.list(){ data }, newest updated Session first, no implicit Core limit(time_updated, id)boundary; previous pages retain requested orderSession.messages({ sessionID })[]for an existing SessionSession.messagesfails withNotFoundError, even with a missing cursorMessageDecodeErrorSession re-exports the same
ListInputschema now defined by SessionStore. TheStore depends on canonical Schema contracts, not on the public Session service.
Scope
Only projected list/message reads and their regression coverage. Fork and move
keep their existing Database access. This follows #46019 and does not depend on
the separate standalone skill-activation cleanup.
Verification
Initial validation at
bc922b8ac5:Focused Core: 67 passed, 0 failed across five files. Full Core: 3,977 passed,
40 skipped, 0 failed across 226 files. SDK: 26 passed, 0 failed. Server:
45 passed, 3 skipped, 0 failed. All three package typechecks passed.
All 33 pre-push typecheck tasks passed at
bc922b8ac5.Three simplify passes reviewed the complete diff for reuse, quality, and
efficiency and found no actionable changes. Formatting, both Effect AST scans,
and diff checks passed. Oxlint reported zero errors and eight warnings on
unchanged code.
After integrating
v2at171947787c, including the confirmed test-race fix in#46083, the focused Core suite again passed 67/67 and all 33 pre-push
typecheck tasks passed at
b76c23d6dd. The refactor diff is byte-identical tothe reviewed version; only its base changed. The diff-viewer suite also passed
91/91 on this integration: