Skip to content

fix(serve): compute resume banner for created, reactivated, and forked sessions#6435

Merged
bug-ops merged 1 commit into
mainfrom
fix/6425-serve-fork-resume-banner
Jul 18, 2026
Merged

fix(serve): compute resume banner for created, reactivated, and forked sessions#6435
bug-ops merged 1 commit into
mainfrom
fix/6425-serve-fork-resume-banner

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • build_agent_factory now 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 the build_agent closure — previously nothing on this path ever called SessionResumeInfo::from_messages.
  • SessionActor::spawn stores the computed banner on a new SessionActorHandle::pending_resume_banner field; 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 client that hasn't attached yet can never miss it. This gives claim_resume_banner() its first production call site.
  • A forked session's banner never shows a "last active" timestamp: ForkEngine::fork stamps 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 via POST /sessions.
  • Covers all three entry points that funnel through build_agent_factory: session create, session reactivate, and session fork.

Closes #6425
Closes #6426

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 14276 passed, 0 failed, 35 skipped
  • cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler" — 19 passed, 0 failed
  • Rustdoc gate (RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links") — clean
  • New regression tests: exactly-once banner delivery across two concurrent/sequential attaches, end-to-end banner computation through build_agent_factory -> SessionActor -> events_session_handler, fork-specific banner (copied message count, no "last active" timestamp), show_banner = false negative path, persistence-disabled negative path, reactivate_session's own path
  • .local/testing/playbooks/session-resume-history.md and .local/testing/coverage-status.md updated (main repo)

@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate size/XL Extra large PR (500+ lines) labels Jul 18, 2026
@bug-ops
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
bug-ops force-pushed the fix/6425-serve-fork-resume-banner branch from 7f48e74 to 25b303a Compare July 18, 2026 01:07
@bug-ops
bug-ops merged commit 3493156 into main Jul 18, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6425-serve-fork-resume-banner branch July 18, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant