Repository navigation
A stalled provider call holds the mutation lock for the whole Library - #76
Merged
Merged
Conversation
A Run holds the single mutation lock while it awaits the Provider, and the fetch Transport set no timeout, so a Provider that accepted the connection and then stalled blocked every later status write, rule run and import. - The fetch Transport now gives each attempt a deadline (default 5 minutes) covering both the request and the body read, combined with the caller's signal. A stall fails with a readable TimedOutError and is not retried. - Reader Runs forward the Run's signal to the Transport, and useRuns gives Reader and Audit Runs their own controllers, so Cancel run reaches them. - Tests through the send seam for a Provider that never responds, one that ignores its signal, and one that stalls mid-body; storage tests that an aborted Reader or Audit Run stores nothing and frees the queue. The queue ordering is unchanged: a Run still never interleaves with a status write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 26, 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.
Closes #46.
What changed
src/wire/transport.ts: each attempt now runs under a deadline (requestTimeoutMs, default 5 minutes). The deadline covers thefetchand the body read, is combined with the caller's signal, and starts inside the concurrency gate, so time spent queued does not count. A stall fails with a newTimedOutError: "The X Connection did not respond within 5 minutes. Try again, or check that the Provider is up." It is not retried. The timer is a plainsetTimeoutthat is cleared when the attempt settles, and the promise is raced against the abort, so a request that ignores its signal still ends.src/core/reader.ts/src/storage/readerAccounts.ts: Reader Runs accept asignaland pass it to the Transport. Before this,readSectionsent no signal at all.src/runs/useRuns.ts: Reader and Audit Runs each get anAbortController.cancelRunaborts them along with the model-pass controller. A cancelled Reader or Audit Run shows "Run cancelled."Acceptance criteria
fetchWithRetryhas a request timeout combined with the caller's signal, surfaced as a readable error rather than a hang. Verified bytransport.test.ts› "request timeout (A stalled provider call holds the mutation lock for the whole Library #46)", which covers a stalled request, a request that ignores its signal, a body that stalls mid-stream, a cancel that is still reported as a cancel, a Connection test, and the timer being cleared.clearReaderAccounts/clearAuditAccounts) then goes through.send(ModelRequest)seam that a Provider which never responds fails with a timeout rather than blocking. Verified.pnpm test(1005 passed),pnpm typecheck,pnpm run gatesandpnpm buildall pass. No Dexie migration, no findings-schema change, no new affordance, no DOM test layer.Open question
The issue gives no timeout value. I chose 5 minutes so that a slow reasoning model on a long Document is not cut off. It is one constant (
DEFAULT_REQUEST_TIMEOUT_MS) if you want a different value.🤖 Generated with Claude Code
Generated by Claude Code