refactor(server): separate provider history reads from interactive resume#2388
Open
dwyanewang wants to merge 2 commits into
Open
refactor(server): separate provider history reads from interactive resume#2388dwyanewang wants to merge 2 commits into
dwyanewang wants to merge 2 commits into
Conversation
dwyanewang
marked this pull request as ready for review
July 24, 2026 09:00
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
Follow-up to #2348.
This separates read-only provider history access from interactive session resume:
AgentClient.readSessionHistory()contract with a narrow history context;AgentResumeSessionOptionsand the"interactive" | "history"purpose plumbing;resumeSession()eager and interactive, including invalid-session validation before the first prompt;Provider history reads now avoid interactive MCP/Paseo tool setup, prompts, subscriptions, aborts, and native archive mutations. Any temporary process or server acquisition is owned and released by the history operation on both success and failure.
Provider behavior
thread/read; nothread/resumesession/loadwithmcpServers: []; resume-only providers do not invoke interactive resumesession.get/session.messages, with acquisition release on every failure boundaryArchive and concurrency behavior
archivedAtand provider-native archive state unchanged.Review scope
This is intentionally cross-provider because the old history purpose was part of the shared
AgentClientcontract. Splitting the provider migrations would either leave some archived providers unavailable or retain an interactive-resume fallback.Roughly half of the added lines are regression tests. There are no protocol schema changes.
Maintainer feedback confirmed that one atomic cross-provider PR is preferred, so this is ready for review.
Verification
Focused tests passed for:
Static/build verification:
npm run typechecknpm run lintnpm run format:checknpm run build:servergit diff --checkThe full test suite was not run locally per repository guidance.
Closes #2364.