Repository navigation
fix(session): narrow recovery to stalled requests after sleep - #4477
reachjalil wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
|
Verified PR commit: Test evidence — an-in-flight-task-recovers-after-sleep-without-restarting-a-canceled-task — ✅ passed✅ 0/1 screenshots passed · 0 expectations passed · 0 failed · 0 pending
[world] mock(mcp) · desktop(local) · workspace(/tmp/openwork-suspended-turn-1788571336056) · [seed:raw] evalIn() ×6 ⚪ UNVALIDATED — 1. an-in-flight-task-recovers-after-sleep-without-restarting-a-canceled-task artifact 1
Test run created 2026-09-05T01:22:15.508Z · Source: Test evidence — an-authenticated-model-can-call-connect-with-recovery-enabled — ✅ passed✅ 0/1 screenshots passed · 0 expectations passed · 0 failed · 0 pending
[world] mock(mcp) · desktop(local) · workspace(/tmp/openwork-suspended-turn-1788571460561) · [seed:raw] evalIn() ×6 · mock(mcp) · desktop(local) · workspace(/tmp/openwork-authenticated-connect-1788571500172) · [seed:raw] evalIn() ×5 ⚪ UNVALIDATED — 1. an-authenticated-model-can-call-connect-with-recovery-enabled artifact 1
Test run created 2026-09-05T01:24:20.011Z · Source: |
| expect(await world.completionKinds(stoppedTurnPrompt)).toEqual(["quiet"]); | ||
| await user.click({ text: "Stopped turn", exact: true }); | ||
| await user.see("Run task"); | ||
| await user.notSee({ text: stoppedTurnReply }, { timeoutMs: 1_000 }); | ||
|
|
There was a problem hiding this comment.
Canceled-task assertion ends before the recovery grace period
The new canceled-task witness can still pass if the aborted request is retried 30 seconds after resume, because the spec checks completion kinds immediately and observes the UI for only one second.
Evidence
guardProviderFetchschedules a retry failure 30,000 ms after the resume monitor fires when a request remains silent.- The spec asserts
completionKinds(stoppedTurnPrompt)immediately after the other task finishes, then waits only 1,000 ms withuser.notSee. - A canceled request whose abort cleanup is broken could therefore be reissued after that assertion and still satisfy the claimed “without restarting a canceled task” behavior.
- Keep the canceled-task witness under observation through the full post-resume grace period before asserting that its completion list remains
['quiet'].
Identified by Warden · spec-provenance-review · 5AL-GUZ
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (86f39c0ea641d1ab7317e8850082da8a338fa656). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Deploying openwork with
|
| Latest commit: |
d988f73
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1c91af8e.openwork.pages.dev |
| Branch Preview URL: | https://fix-narrow-sleep-recovery.openwork.pages.dev |
|
Closing: this branch was a narrowing follow-up to #4470, which #4484 reverted in full. The offline-UI cleanup here is already on dev through that revert, and the remaining change would reintroduce the reverted provider fetch hook rather than build on current dev. Recovery for a request that stalls after laptop sleep is still needed and will be addressed in a fresh change against current dev that leaves provider auth transport untouched. |
Disposition: Incomplete, retained open
Reviewed head
d988f73f04caecd77759c8c081c04565e46d4a32againstdev@858414c41c63a22eecfe331d17f3f5dd348dfc6f. The branch is unchanged and not synchronized or safe to merge. Its merge base is2a3b4296fd9566e07410ab1eeaff9e0da51ec205(#4470), not current dev.Do not restore the provider transport hook merely to resolve conflicts. Do not close this as redundant: current code does not establish equivalent recovery of a still-running request after sleep.
Code comparison
6d179f00acf322b1d46f4e30793615b0bb158296) reverted fix(session): restore connection recovery without breaking provider auth #4470, deleting the provider guard, registration, packaging entries, recovery fixture and suspend journey. The offline-UI and background-retention removals in this PR are already present through that revert; they are no longer a useful increment.guardProviderFetch(fetch, resumeMonitor)throughprovider.options.fetchforopenworkandlpr_*. Restoring those deleted files and their registration is a reintroduction of the reverted mechanism, not a mechanical narrowing of current dev. The managed-ID/custom-fetch guards avoid the original broad OAuth-provider overwrite, but do not prove all managed auth-loader transports safe. Emergency revert: session connection recovery (#4470) #4484 itself explicitly left the reported connection failure's cause unproven.54a7f0fa978de95806b78cec1d35ec89b7a2ba2c) now bounds managed gateway headers/body and SSE idle reads, preserves partial work, and cancels upstream. Seeee/apps/inference/src/proxy.ts,chat-response.ts, anddocs/managed-response-reliability.md. Those server-side deadlines do not detect a silent desktop-to-gateway socket following laptop sleep; they never replay generation.0857e81d897b97bc7b10b35c0b2193ec3328dab3) recovers verified unfinished tasks after server restart.apps/server/src/task-recovery.tsloads the startup set from persisted running records, observes already-active runs without re-prompting, and requires startup eligibility before issuing recovery. An engine still reporting busy after sleep does not enter that restart-only path.apps/app/src/components/chat/message-list.tsxrevalidates stalled activity without aborting or resubmitting it. This is honest feedback, not replacement socket recovery.The residual useful outcome is bounded recovery of a managed request that is demonstrably stuck after resume, without changing auth transport or duplicating work. The current comparison proves neither that this gap is solved nor that the old hook is safe to restore. That blocks both a redundancy closure and a safe code sync in this update.
Review finding
The unresolved canceled-task witness is valid: the old suspend journey observes cancellation before the full 30-second post-resume grace expires. A replacement journey must keep the stopped task under observation beyond the complete grace window, then assert no additional provider request or tool execution. No review thread was marked resolved.
Verification
The old local result at
86f39c0ea641d1ab7317e8850082da8a338fa656is historical, not proof for current dev or the current PR head. No merge, deployment, review request or branch deletion is included.