Skip to content

fix(app): bound archive verification before the window timeout - #5014

Merged
yomgui merged 5 commits into
devfrom
fix/archive-pinned-session-hang
Sep 16, 2026
Merged

yomgui merged 5 commits into
devfrom
fix/archive-pinned-session-hang

Conversation

@yomgui

@yomgui yomgui commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Problem

Archive verification could outlive the five-second mailbox receipt. SDK Request signals were overwritten; stalled bodies could keep archive pending. Healthy pinned archives pass even with production reverted: pin causality and the original first no-window response remain unproven.

Change

Bound agent archives at 3.5 seconds (human: 15 seconds), preserve cancellation, prevent late preflight PATCHes, distinguish verification failure from uncertain writes, and release busy/hold state. Preserve pin preferences and working-session safeguards.

Oracle decision

No oracle change or streaming exception. CI used Bun 1.3.14, whose Request clone retains the input signal for an explicit null override; Bun 1.4.0 does not. Forward the explicit override through the wrapper. Keep the new non-streaming assertion unchanged; streams remain untimed.

Matrix / verification

Pinned UI / cross-workspace affordance / unpin→archive / no focused session / held body / no late PATCH / same-app recovery: Passed; revert-fails confirmed.

  • pnpm evals:e2e session-archive-pinned --local --engine v1: 1 passed.
  • pnpm evals:pr specs/session-archive-deadline.test.ts: 1 passed; 110 native tests.
  • pnpm --filter @openwork/app test:core on CI Bun: 292 passed.

New head: 7c1b47326; regenerated head-matching evidence below. The requested test -- opencode-stream-timeout actually runs 254 files and has eight broader failures, documented without claiming pre-existing status.

RCA: reports/rca-archive-pinned-session-hang-2026-09-14.md. Do not merge.

@vercel

vercel Bot commented Sep 15, 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 16, 2026 6:46pm UTC
openwork-den Ready Ready Preview Sep 16, 2026 6:46pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
openwork-diagnostics Ignored Ignored Preview Sep 16, 2026 6:46pm UTC
openwork-landing Ignored Ignored Preview Sep 16, 2026 6:46pm UTC

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. 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 (97002 ms), confidentiality-review (143347 ms), spec-provenance-review (210221 ms), desktop-den-sync-review (211065 ms), design-spec-review (239769 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 4
  • Distinct heads in retained window: 4
  • 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: 4/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[bot]
diff-warden Bot previously approved these changes Sep 15, 2026

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

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 15, 2026

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0ee8898
Status:🚫  Build failed.

View logs

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

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

@yomgui

yomgui commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Test evidence — archive deadlines settle stalled reads and uncertain writes, preserve caller cancellation, and retain pin and working-session contracts — 0/0 screenshots passed · 1 assertion

SHA eb24c33 · engine v1

✅ 0/0 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending

verdict unknown · 0 user observations · 0 probes · steps 0/0

ℹ️ ASSERTION — 1. Bounded preflight never sends a late PATCH; uncertain PATCH is not reported as cancellation; holds and busy state recover; caller signals and pin state survive

bun test --isolate tests/session-archive-agent-contract.test.tsx tests/opencode-stream-timeout.test.ts tests/opencode-session-native.test.ts tests/session-management-store.test.ts
Exit: 0
bun test v1.4.0 (34cbb9a40)

tests/session-management-store.test.ts:
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.

117 pass
0 fail
876 expect() calls
Ran 117 tests across 4 files. [26.05s]

  • ✅ PASS Bounded preflight never sends a late PATCH; uncertain PATCH is not reported as cancellation; holds and busy state recover; caller signals and pin state survive — bun test --isolate tests/session-archive-agent-contract.test.tsx tests/opencode-stream-timeout.test.ts tests/opencode-session-native.test.ts tests/session-management-store.test.ts
    Exit: 0
    bun test v1.4.0 (34cbb9a40)

tests/session-management-store.test.ts:
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.
[zustand persist middleware] Unable to update item 'openwork.react.sessionManagement', the given storage is currently unavailable.

117 pass
0 fail
876 expect() calls
Ran 117 tests across 4 files. [26.05s]


Test run created 2026-09-16T18:59:42.111Z · Source: evals/results/test-runs/2026-09-16T18-59-42-111Z-archive-deadlines-settle-stalled-reads-and-uncertain-writes-preserve-caller-canc/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 5014 --test-run 2026-09-16T18-59-42-111Z-archive-deadlines-settle-stalled-reads-and-uncertain-writes-preserve-caller-canc

@yomgui

yomgui commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Test evidence — pinned idle sessions archive from the sidebar and mailbox without a focused session; held preflight fails promptly without a late PATCH and recovers — ✅ passed

SHA eb24c33 · engine v1

✅ passed · 5 expectations passed · 0 failed · 0 pending

[world] desktop(local) · mock(mcp) · workspace(/tmp/openwork-session-archive-1789585233156-64963-a) · [seed:raw] evalIn() ×22
[probe] hash
[user] see(text=What do you need done?)
[agent] run(session.pin) · run(session.list_sessions)
[probe] eventually(pin state is exposed to agents)
[user] see(text=Pinned) · hover(testId=sidebar-session-ses_f5468675affe12f9oYpw3Z1qdl) · testId=session-archive-ses_f5468675affe12f9oYpw3Z1qdl · click(testId=session-archive-ses_f5468675affe12f9oYpw3Z1qdl)
[probe] eventually(archive persisted in the owning engine)
[user] notSee(testId=sidebar-session-ses_f5468675affe12f9oYpw3Z1qdl) · notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[agent] run(session.pin) · run(session.list_sessions)
[probe] eventually(pin state is exposed to agents)
[agent] desktopApi(POST /experimental/ui-control/request)
[probe] eventually(archive persisted in the owning engine)
[user] notSee(testId=sidebar-session-ses_f5468674fffeZyATv2lSCONBWd) · notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[agent] run(session.pin) · run(session.list_sessions)
[probe] eventually(pin state is exposed to agents)
[agent] run(session.pin) · run(session.list_sessions)
[probe] eventually(pin state is exposed to agents)
[user] hover(testId=sidebar-session-ses_f54686742ffeub7kcz150fQ5Jt) · testId=session-archive-ses_f54686742ffeub7kcz150fQ5Jt · click(testId=session-archive-ses_f54686742ffeub7kcz150fQ5Jt)
[probe] eventually(archive persisted in the owning engine)
[user] notSee(testId=sidebar-session-ses_f54686742ffeub7kcz150fQ5Jt) · notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[agent] desktopApi(POST /experimental/ui-control/request)
[probe] eventually(candidate restored)
[user] see(testId=sidebar-session-ses_f54686742ffeub7kcz150fQ5Jt)
[agent] run(session.pin) · run(session.list_sessions)
[probe] eventually(pin state is exposed to agents)
[user] notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[agent] desktopApi(POST /experimental/ui-control/request)
[user] see(testId=sidebar-session-ses_f54686742ffeub7kcz150fQ5Jt)
[agent] run(session.list_sessions)
[user] notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[probe] eventually(released preflight stays inert for two seconds)
[user] notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
[agent] desktopApi(POST /experimental/ui-control/request)
[probe] eventually(archive persisted in the owning engine)
[user] notSee(testId=sidebar-session-ses_f54686742ffeub7kcz150fQ5Jt) · notSee(text=This session is still working)
[probe] hash
[user] see(text=What do you need done?)
steps 1 ✅ a pinned idle session archives through the UI while no conversation is focused (14.7s) · 2 ✅ a pinned idle session in another workspace archives through the real mailbox (14.4s) · 3 ✅ unpin then archive also completes through the UI without opening a session (15.3s) · 4 ✅ restore and pin the fault candidate without navigating (4.2s) · 5 ✅ a held messages body returns structured verification_failed before the five-second mailbox deadline (7.1s) · 6 ✅ releasing the stalled read cannot send a late archive PATCH; a fresh mailbox request succeeds (18.6s)
verdict passed · 22 user observations (see ×11, notSee ×11) · 19 probes · steps 6/6

ℹ️ ASSERTION — 1. Pinned archive completes without a focused conversation

Owning-engine archive persisted, sidebar row disappeared, unrelated sessions stayed idle/unarchived, no abort or dialog, route and surface list stayed sessionless.

  • ✅ PASS Pinned archive completes without a focused conversation — Owning-engine archive persisted, sidebar row disappeared, unrelated sessions stayed idle/unarchived, no abort or dialog, route and surface list stayed sessionless.

ℹ️ ASSERTION — 2. Pinned cross-workspace archive completes through the real mailbox

HTTP 200; elapsed 554.5726250000007 ms; persisted archive, no unrelated mutation, no navigation or dialog.

  • ✅ PASS Pinned cross-workspace archive completes through the real mailbox — HTTP 200; elapsed 554.5726250000007 ms; persisted archive, no unrelated mutation, no navigation or dialog.

ℹ️ ASSERTION — 3. Unpin then archive also succeeds

Candidate changed pinned:true to pinned:false, then archived through the UI with no focused conversation; unrelated sessions were preserved.

  • ✅ PASS Unpin then archive also succeeds — Candidate changed pinned:true to pinned:false, then archived through the UI with no focused conversation; unrelated sessions were preserved.

ℹ️ ASSERTION — 4. Held preflight fails through the requesting channel before five seconds

HTTP 200; elapsed 3606.7060000000056 ms; verification_failed; zero additional PATCHes or session mutations, pin retained.

  • ✅ PASS Held preflight fails through the requesting channel before five seconds — HTTP 200; elapsed 3606.7060000000056 ms; verification_failed; zero additional PATCHes or session mutations, pin retained.

ℹ️ ASSERTION — 5. No late PATCH and no restart needed for mailbox recovery

Released preflight stayed inert for two seconds. A new request on the same app/mailbox completed in 451.8062079999945 ms with exactly one successful PATCH; unrelated sessions and route unchanged.

  • ✅ PASS No late PATCH and no restart needed for mailbox recovery — Released preflight stayed inert for two seconds. A new request on the same app/mailbox completed in 451.8062079999945 ms with exactly one successful PATCH; unrelated sessions and route unchanged.

Test run created 2026-09-16T19:00:09.815Z · Source: evals/results/test-runs/2026-09-16T19-00-09-814Z-pinned-idle-sessions-archive-from-the-sidebar-and-mailbox-without-a-focused-sess/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 5014 --test-run 2026-09-16T19-00-09-814Z-pinned-idle-sessions-archive-from-the-sidebar-and-mailbox-without-a-focused-sess

@yomgui

yomgui commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Final-head verification: Passed at eb24c33. Local isolated dev Electron lane (explicitly authorized): pnpm evals:e2e session-archive-pinned --local --engine v1 exited 0, 1 passed / 0 failed / 0 skipped. pnpm evals:pr specs/session-archive-deadline.test.ts exited 0, 1 passed / 0 failed / 0 skipped; native suites 117 passed / 0 failed. Both exact-head receipts are in the test-evidence comments. The wrapper publisher displays verdict unknown for the app-less wrapper, but its exit/result and recorded assertion are passing. Merge gate checked: openwork-tests-required PASS, Warden APPROVED at this exact SHA, no failed required checks, zero review threads, every branch commit signed and signed off, no .github/ .warden/ or warden.toml changes in the PR diff. This fixes deadline/cancellation containment, not a proven cause of the original installed UI timeout. Follow-up RCA is investigating real renderer connection pressure and mailbox liveness separately.

@yomgui
yomgui merged commit d16d4a1 into dev Sep 16, 2026
38 checks passed
@yomgui
yomgui deleted the fix/archive-pinned-session-hang branch September 16, 2026 19:17

This branch was successfully deployed

4 active (2 outdated) deployments
Preview – openwork-den — eb24c339 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-app — eb24c339 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-diagnostics — 0ee88980 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-landing — 32f1242e Deployed Sep 15, 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