fix(serve): compute resume banner for created, reactivated, and forked sessions#6435
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 18, 2026 01:06
…d sessions build_agent_factory now computes the resume-visibility banner (spec-068 section 13.5, AC-24) from the session's replayed message history in its async prefix and returns it alongside the build_agent closure, instead of never computing it. SessionActor::spawn stores it on SessionActorHandle::pending_resume_banner; GET /sessions/:id/events renders it exactly once via the existing claim_resume_banner guard, subscribing to the session's output broadcast before sending so a not-yet-attached client cannot miss it. A forked session's banner never shows a "last active" timestamp: ForkEngine already stamps the new child's row with the current time as part of its own bookkeeping, which would otherwise read back as a misleading "last active just now" on a session nobody has resumed yet. This matches the no-timestamp banner already shown for brand-new sessions. Closes #6425 Closes #6426
bug-ops
force-pushed
the
fix/6425-serve-fork-resume-banner
branch
from
July 18, 2026 01:07
7f48e74 to
25b303a
Compare
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
build_agent_factorynow computes the resume-visibility banner (spec-068 section 13.5, AC-24) from the session's already-replayed message history, in its existing async prefix, and returns it alongside thebuild_agentclosure — previously nothing on this path ever calledSessionResumeInfo::from_messages.SessionActor::spawnstores the computed banner on a newSessionActorHandle::pending_resume_bannerfield;GET /sessions/:id/eventsrenders it exactly once via the existingclaim_resume_banner()guard, subscribing to the session's output broadcast before sending so a client that hasn't attached yet can never miss it. This givesclaim_resume_banner()its first production call site.ForkEngine::forkstamps the new child session's row with the current time as part of its own bookkeeping, which would otherwise read back as a misleading "last active just now" on a session nobody has actually resumed yet. This matches the no-timestamp banner already shown for brand-new sessions created viaPOST /sessions.build_agent_factory: session create, session reactivate, and session fork.Closes #6425
Closes #6426
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 14276 passed, 0 failed, 35 skippedcargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"— 19 passed, 0 failedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links") — cleanbuild_agent_factory->SessionActor->events_session_handler, fork-specific banner (copied message count, no "last active" timestamp),show_banner = falsenegative path, persistence-disabled negative path,reactivate_session's own path.local/testing/playbooks/session-resume-history.mdand.local/testing/coverage-status.mdupdated (main repo)