Skip to content

fix(session): isolate pending deltas during thread hydration - #4676

Merged
reachjalil merged 1 commit into
devfrom
fix/stale-thread-hydration
Sep 9, 2026
Merged

reachjalil merged 1 commit into
devfrom
fix/stale-thread-hydration

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Summary

Follow up on #4658, which already landed the original stale-thread hydration fix.

  • Key pending deltas by session, message, and part so overlapping identifiers cannot mix text between threads.
  • Keep cumulative part updates from discarding another thread’s queued deltas, and skip pending-part reconciliation when the buffer is empty.
  • Allow an existing todo query without data to hydrate while keeping conservative timestamp-tie handling.
  • Extend existing regression tests for cross-session isolation, unchanged snapshot input, cached reapplication, terminal tool identity, and duplicate-free tool merges.

Verification: Incomplete

Tested head: d83be707ab87badbe657c10bf996fa95f6f85899.
Rebased onto dev at d6eff8a5aeb0ffc44c0890352a36c6775cf7150f; the already-merged changes from #4658 are not duplicated.

pnpm --filter @openwork/app exec bun test --isolate ./tests/session-render-state.test.ts ./tests/session-sync-permissions.test.ts
  • Passed: 60 tests, 0 failed, 0 skipped; exit 0 on the rebased head.
  • Passed: git diff --check origin/dev...HEAD.
  • The added overlapping-identity cases reproduced cross-session text contamination before the scope repair.
  • These are deterministic component regressions, not runtime journey proof.
  • Deferred: exact-head @openwork/testkit runtime evidence. No new runtime resources were provisioned. Broad suites and E2E were not run.
  • Missing coverage: the existing evals/specs/streamed-markdown-answer.e2e.test.ts needs a mid-stream thread-return assertion that exercises cached hydration, preserves completed tools and todos, and shows each text fragment exactly once without affecting the neighboring thread. The runtime spec is unchanged in this PR.

Runtime verification entry point, once the missing assertion and test resources are available:

pnpm evals:e2e streamed-markdown-answer

Timestamp ties intentionally favor existing todo data; snapshots without a recorded fetch start use their first hydration time.

@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:07pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 9, 2026 1:07pm UTC
openwork-diagnostics Skipped Skipped Sep 9, 2026 1:07pm UTC
openwork-landing Skipped Skipped v0 Sep 9, 2026 1:07pm 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 (d83be707ab87badbe657c10bf996fa95f6f85899). 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 d83be707ab87badbe657c10bf996fa95f6f85899 · selected evidence

Open review report

@reachjalil
reachjalil merged commit 9b5a591 into dev Sep 9, 2026
27 checks passed

This branch was successfully deployed

1 active and 3 inactive deployments
Preview – openwork-app — d83be707 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-diagnostics — d83be707 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-den — d83be707 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-landing — d83be707 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.

1 participant