Skip to content

Bound provider requests over the whole response, not just headers - #76

Merged
aryanorastar merged 1 commit into
BasedHardware:mainfrom
aryanorastar:fix/provider-full-operation-deadline
Oct 23, 2026
Merged

aryanorastar merged 1 commit into
BasedHardware:mainfrom
aryanorastar:fix/provider-full-operation-deadline

Conversation

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closes the reproduced mechanism from #72. The broader cross-stage answer budget, remainder-bounded retries and fallback wording stay parked under #72.

Customer failure prevented

A reply could take far longer than its configured provider timeout when the model API started a response but kept the body trickling. axios's timeout is cleared once response headers arrive and then relies only on socket inactivity, so a slow body never tripped it.

Change

  • commandcode.js: providerSend wraps the planner, answer and review requests with AbortSignal.timeout(provider.timeout) alongside the existing timeout, so the deadline covers body consumption. An abort is reported as the existing ECONNABORTED timeout error, so retry handling is unchanged and no response text leaks into failure metadata.
  • ROADMAP.md: one entry recording this as implemented and tested locally, not reviewed, compared or deployed.

Evidence

  • Loopback reproduction before: axios timeout: 250 on a trickling body completed after 1413 ms.
  • test/providerDeadline.test.js (6 tests): planner, answer and review each stop at the budget on a trickling body (red before: a 250 ms budget ran ~3.9 s on all three stages); a normal response still completes; the deadline error carries no response text.
  • Full local suite: 884/884.

Not done

No live-eval or latency comparison, no deploy. Opened from a fork because the Railway GitHub App is not installed on the BasedHardware org.

axios's `timeout` is cleared once response headers arrive and then
relies on socket inactivity, so a provider body that keeps trickling
could hold a customer waiting far past the configured budget (BasedHardware#72). Each
planner, answer and review request now also carries a full-operation
abort signal and reports the abort as the existing timeout error shape,
so current retry handling is unchanged.

Red-before loopback tests: a 250 ms budget previously ran ~3.9 s on a
trickling body for all three stages; a normal response still completes;
the error carries no response text. Broader cross-stage budgeting stays
parked under BasedHardware#72.

Co-authored-by: Railway <68434857+railway-app[bot]@users.noreply.github.com>
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