Skip to content

fix(session): preserve live progress when switching threads - #4658

Merged
benjaminshafii merged 1 commit into
devfrom
fix/thread-switch-freshness
Sep 9, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
fix/thread-switch-freshness

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Summary

Switching back to a cached conversation must not roll back completed work or duplicate streamed text.

  • Match dynamic tools by call identity and preserve terminal results against stale input states, while allowing fresh snapshot results.
  • Order todo hydration by snapshot fetch time; cached reapplication cannot overwrite newer live updates. Unmarked snapshots retain their first-observed time.
  • Flush session deltas against the existing transcript before cumulative hydration. Reconcile early deltas when the snapshot declares their exact part and retain undeclared parts.
  • Extend the existing render-state and session-sync tests; no new test files or scheduling changes.

Verification

Verdict: Incomplete — runtime journey proof not run. Opened ready for review as requested; this is not a claim of merge readiness.

Candidate: ac5b478, rebased onto dev at bd1b31c.

Passed (exit 0):

pnpm --filter @openwork/app exec bun test --isolate ./tests/session-render-state.test.ts ./tests/session-sync-permissions.test.ts

60 passed, 0 failed, 0 skipped. Before the fix, the targeted additions produced 5 failures reproducing tool rollback, todo rollback, and duplicate text for declared and undeclared parts. Tests also verify newer snapshots, distinct tool identities, continued deltas, and retention of unknown parts.

Passed: git diff --check origin/dev...HEAD.

Deferred: full typecheck, app runtime journey, and evidence publication. No external provisioning was performed. The existing evals/specs/streamed-markdown-answer.e2e.test.ts owns the streaming journey; a deterministic mid-stream thread-switch assertion remains missing. Follow-up runtime command: pnpm evals:e2e streamed-markdown-answer after extending that assertion. Unit tests are not runtime proof.

Scope

Existing text-length merge semantics and run-status hydration remain unchanged. No changes to the original checkout, no deployment, and no merge.

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 9, 2026 1:26am UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 9, 2026 1:26am UTC
openwork-diagnostics Skipped Skipped Sep 9, 2026 1:26am UTC
openwork-landing Skipped Skipped v0 Sep 9, 2026 1:26am UTC

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (ac5b478a9017edb33307c0a701b33a4f85fa5e8a). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Passed · 1/1 tests · 2/2 assertions · 0 images

Commit ac5b478a9017edb33307c0a701b33a4f85fa5e8a · selected evidence

Open review report

@benjaminshafii
benjaminshafii merged commit cac94b0 into dev Sep 9, 2026
27 checks passed

This branch was successfully deployed

1 active and 3 inactive deployments
Preview – openwork-app — ac5b478a Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-den — ac5b478a Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-diagnostics — ac5b478a Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-landing — ac5b478a Deployed Sep 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants