Repository navigation
fix(threads): keep provider failures with their own turn - #530
Merged
Merged
Conversation
Keep late old-turn failure footers above newer running work and prevent advisory idle activity from idling an active turn. Present provider JSON notices as readable, redacted summaries with details on demand. Default new proxy connections to HTTP streaming to avoid Responses WebSocket interrupt races while preserving explicit transport choices. Fixes: #72 Related: #527
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
Retrying a failed turn now sends exactly **Continue**, without copying the original request into the user bubble. Once a later turn starts, the older failure becomes a compact title and **Show details** entry. Its explanation, hints, recovery actions and retry feedback disappear immediately, using the existing feed anchoring without a height animation. Queued messages do not hide actions before dispatch. Mobile gets the same compact historical failure entry through JS-only changes. It already has no retry/settings buttons in thread failure cards. No native configuration or dependencies changed. ## Session recovery Existing provider sessions retain their own context. The worker saves the latest substantive request privately in its SQLite journal, surviving event ACKs and restarts. If Retry needs a fresh Codex session because its rollout is missing, or a fresh Claude session because its transcript is missing, the request is supplied as developer/system context with a reminder to inspect completed side effects. The user message stays **Continue**. Grok requires a successful session load and has no silent empty-session fallback. This fallback restores the saved request, not a complete lost provider transcript. Requests predating this worker change have no private recovery copy. ## Validation - Rebased onto `dev` at `a73e5c1bf`. Resolved the mobile `TimelineTurn` conflict by retaining #554's `TimelineDisclosure`, UI-thread anchoring and local group state. Historical failure state now passes through `ThreadTimeline`'s memoized cell, including its equality check, so an older card updates when a new turn starts. Web retains #554's `VirtualFeed.keep` behavior for the latest summary. No disclosure or motion changes were reverted. - `bun install` and `bun run gen:check` pass on the final head. Focused worker tests pass: **5 tests, 28 assertions**, covering native session resumption, missing-rollout recovery, journal ACKs/restarts, repeated retries, request replacement and thread isolation. The emitted user message is exactly **Continue** and excludes the prior request. No web UI tests added. - After conflict resolution, `bun run format`, `bun run lint`, mobile typecheck, `bun install`, generated-code checks and the 5 focused tests pass. GitHub CI runs the final head's static checks, build and full test shards. The full local `check:tmp` was not repeated, as requested. - Real-browser review used an isolated gateway/PostgreSQL fixture, scripted worker, and the real web BFF/SSE. Checked light and dark at **1440 × 900** and **390 × 844**: initial failure recovery actions; Retry bubble exactly **Continue**; compact historical failure during streaming; latest failure retaining actions; and working **Show details**. Sending an ordinary new message also removes older actions. No horizontal overflow. Frame sampling around Retry kept the failure title at **y = 212 px** while its card changed directly from **148 px to 56 px**, with no intermediate height animation. Navigation cancellation logged a thread-watch warning; subsequent streams and sends succeeded. - EAS production-profile fingerprints match final head and `dev`, generated with identical checkout paths and installed dependencies: iOS **`6ddec9ef559ee0095ac33e94ff9418a942053b17`**, Android **`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`**. No native-device visual review is claimed. The browser tab, web server, gateway and disposable database were stopped after review. - Repeated the real-browser failure-card check after conflict resolution at 1280 × 800 light and 390 × 844 dark: **Continue** only, compact older cards during a new turn/streaming, working details, latest failure recovery actions, and no horizontal overflow. Recomputed both EAS fingerprints against this new base; both hashes above remain identical. All disposable processes and the browser tab were stopped again. ## Copy audit — docs/copy.md §8 - **Continue the previous request after the failed turn. Check what was already done before repeating anything with side effects. Previous request: <original prompt>** → **Continue**. One imperative, one word, sentence case, no duplicated request or internal jargon in the user bubble. - Reused **Could not finish this turn**, **Show details**, **Copy error details** and existing action labels. Historical failures stop asking for action after work resumes; technical details remain available on demand. No new glossary terms, empty states, confirmations, duplicate facts or humor. Text supplies meaning independently of color or icons. - Visual copy audit: checked the short **Continue** bubble, a multiline original request, and wrapping failure explanation/action labels at desktop and phone widths, light and dark. Changed failure copy contains no interpolated user names. Existing long labels stay within the phone width; historical entries retain their title and disclosure. History inspection (`git log -S`) identifies #94 as the source of the long Retry message. #530 changed failure grouping/presentation but did not introduce that text. Fixes: #94 Related: #530
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a failed Codex turn receives late output after a background wake-up starts, its work is grouped above the new turn but its failure footer can remain at the bottom. Keep the footer with its own work, and prevent advisory idle/systemError activity from idling a thread that still has a running turn.
Codex
errornotifications already map to diagnostic notices, includingwillRetry: false; onlyturn/completeddetermines the outcome. Preserve that contract and genuine terminal failures. Web and mobile now show readable provider error summaries with redacted JSON behind Show details, including previously saved notices.Transport investigation
turn/steerfor steering andturn/interruptfor Stop. Steering is not interrupt + restart.response.interruptover Responses WebSockets, including during its default instant-interrupt steering path. CLIProxyAPI has a documented late-interrupt race that returns this 400 and can poison the next response. Sources and the distinction from a missing WebSocket capability are indocs/proxies.md.worker_shutdownmeans background processes stopped for a worker restart/deploy. The existing recovery tests and new gRPC regression cover the resulting wake-up. It does not establish that the restart caused the provider error. Without incident events and the proxy version, the screenshot's exact sequence remains unconfirmed.Validation
worker_shutdownwake-up and repeated late terminal/activity events. Existing Codex mapping/turn-boundary, proxy, worker-restart, background-task, durability and report-order files also passed individually.check:tmpran once with concurrency limited to 1: 2,221 passed, 163 skipped and 2 failed across 408 files; the temp-directory check was clean. Both failures passed on targeted reruns: the existing launch expectation needed the new explicitsupports_websockets=falseargument, andworker-profile-env.test.tsneeded myCANOPY_LIVE=0invocation override removed (the fixture checks exact inherited environment keys). No production change was required for either. The full suite was not repeated. Opt-in live inference was skipped; the real Codex app-server/fake-inference connection-resume test passed.Copy audit (§8)
response.interruptis retained as the provider's literal message, not an invented user-facing term. Summaries and details redact endpoints and credentials.Fixes: #72
Related: #527