Skip to content

fix(chat): keep staged conversation history consistent - #4844

Merged
reachjalil merged 1 commit into
devfrom
fix/thread-history-consistency
Sep 10, 2026
Merged

reachjalil merged 1 commit into
devfrom
fix/thread-history-consistency

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Summary

Follow-up to #4838: partial conversation history must not be mistaken for a complete timeline.

  • Seed preview message/part baselines so live deltas advance immediately, without seeding authoritative status, todos, admission, or full history.
  • Wait for complete, owner-bound history before restoring reverted messages, avoiding cancellation of the only full read.
  • Resolve Branch boundaries against a fresh uncapped snapshot, not a singleton preview or stale cached tail. Ignore callbacks after navigation; reject missing branch messages rather than copying the entire session.
  • Withhold reverted preview content until full history establishes the visible timeline. Failed loads show an actionable Retry instead of an indefinite spinner.

The composer remains mounted and usable. Full history, newer live output, and neighboring session state remain intact. Reverted conversations deliberately wait for full history rather than guessing message ordering.

Verification

Candidate: 4b5f5e496885272196bec1492f44831cbff99782, based on dev at fb3bc5b219ec3904baeeefc9738930b2bcb7d096. Commit signature verified.

Passed from apps/app:

pnpm exec bun test --isolate ./tests/session-history.test.tsx ./tests/session-sync-permissions.test.ts ./tests/session-render-state.test.ts
pnpm typecheck
  • 81 passed, 0 failed, 0 skipped, 6,013 assertions; exit 0.
  • App typecheck and git diff --check: exit 0.
  • Coverage includes pending/full/failed reads, stale-cache Branch, buffered and subsequent deltas, Restore, owner changes, and reverted suffixes.
  • The existing session-full-history-on-open journey gains a baseline branch-boundary/source-preservation assertion after complete loading. This does not claim to exercise the partial-window race.

Proof verdict: Incomplete

Exact-head real-app evidence has not been run or published. The authored journey still needs:

pnpm evals:e2e session-full-history-on-open

Delayed preview/Restore/Branch races across both engines have focused hook/sync coverage, not real-app proof. No latency improvement is claimed.

An earlier diagnostic invocation of the legacy scripts/session-render-state.test.ts encountered a stale formatter import and unresolved formatter expectations. That invocation is not counted as passing or classified as pre-existing; the unrelated import was left unchanged. Primary verification uses the active tests above.

Scope

Independent correctness PR targeting dev. Reading-position/Find changes and backfill/composer performance are separate follow-ups. No permanent history truncation, render eviction, provider behavior changes, or background-task suspension. Required repository CI is unchanged.

@vercel

vercel Bot commented Sep 10, 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 10, 2026 8:40pm UTC
openwork-den Ready Ready Preview Sep 10, 2026 8:40pm UTC
openwork-diagnostics Ready Ready Preview Sep 10, 2026 8:40pm UTC
openwork-landing Ready Ready Preview, v0 Sep 10, 2026 8:40pm UTC

@github-actions

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 1. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (83943 ms), confidentiality-review (131816 ms), spec-provenance-review (57368 ms), desktop-den-sync-review (170897 ms).

Blockers

  • None.

Advisories

  • 4G8-RQG · medium · spec-provenance-review · evals/specs/session-full-history-on-open.e2e.test.ts:108

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@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 (4b5f5e496885272196bec1492f44831cbff99782). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 4b5f5e496885272196bec1492f44831cbff99782 · selected evidence

Open review report

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 4b5f5e49 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-app — 4b5f5e49 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-den — 4b5f5e49 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — 4b5f5e49 Deployed Sep 10, 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