feat(agent): natively resume prior session on cloud resume - #2896
Merged
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(agent): natively resume prior sessi..." | Re-trigger Greptile |
tatoalo
force-pushed
the
fix/modal-vm-failures
branch
from
June 24, 2026 12:51
919aa0e to
72e2235
Compare
tatoalo
marked this pull request as ready for review
June 24, 2026 13:06
Contributor
|
Reviews (2): Last reviewed commit: "feat(agent): natively resume prior sessi..." | Re-trigger Greptile |
Cloud task resumes restored conversation context by flattening the prior log into a summary blob and replaying it as a synthetic prompt. Instead, recover the prior Claude session id from the run_started notification, hydrate its JSONL (warm from a filesystem snapshot, or rebuilt from the log), and resumeSession so the SDK continues the real conversation. The new user message is then a plain continuation. The summary path remains as a last-resort fallback. Reuse the already-loaded resume conversation when hydrating the JSONL so the prior run's log is not fetched twice, and share the post-prompt turn handling between the native and summary resume paths.
tatoalo
force-pushed
the
fix/modal-vm-failures
branch
from
June 24, 2026 13:13
72e2235 to
86cda4c
Compare
skoob13
approved these changes
Jun 25, 2026
skoob13
left a comment
Contributor
There was a problem hiding this comment.
Thanks, PostHog AI is unblocked:love_letter:
| : [ | ||
| { | ||
| type: "text", | ||
| text: "Continue from where you left off. The user is waiting for your response.", |
Contributor
There was a problem hiding this comment.
Is there a case when we need a resume message?
Contributor
Author
There was a problem hiding this comment.
The old plimbing is still needed for the fallback path where native resume is unavailable, for example no prior session id, JSONL hydration failed. Kinda defensive but still worth keeping for the moment imho
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.
Problem
we used to resume restored context by flattening the prior conversation into a markdown summary and replaying it as a synthetic
You are resuming a previous conversation…prompt. That is lossy (token-budget truncation, tool results clipped) and the agent continued from a recap rather than the real thread.Changes
Resume the real session instead of replaying a summary