You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provider timeout is silently ignored on non-streaming Workers AI calls #131
The timeout option has no effect on non-streaming generateResponse calls through the Workers AI binding. The adapter applies it only when opening a stream.
Reproduction
@stackbilt/[email protected], in a deployed Worker with a real AI binding, on 2026-10-31:
In source, timeout appears in src/providers/cloudflare.ts only at line 1428, in the streaming path. HTTP providers enforce it through BaseProvider's request method, but the binding call at line 772 has no deadline.
Why it matters
A caller who sets timeout reasonably expects a bound on the call. Here, a stuck binding call has no package-level limit, and nothing signals that the setting was ignored. The README documents that binding calls can't be aborted, and that stream timeouts cover opening only. It doesn't say the non-streaming case has no deadline.
Expected
Race the binding call against timeout and throw TimeoutError, noting that the underlying work can't be cancelled and may still be billed. If that's not wanted, document clearly that timeout doesn't apply to this path.
Relationship to existing issues
Related to the deadline items in #110 and #116, which cover absolute deadlines and non-streaming body deadlines. Filed separately because this is a specific setting with no effect, and has a small fix.
Scope
Two deployed calls, plus reading the source on main. Our application handles this with its own deadline.
Non-streaming Cloudflare Workers AI binding calls now enforce the configured provider timeout and raise TimeoutError when the binding exceeds it. Successful calls clear the timer, and the existing streaming timeout behavior remains unchanged.
Validated with npm test (791 tests), npm run typecheck, npm run build, and npm run test:worker-import.
Activity
mikemikimike commentedon Oct 31, 2026
Implemented in PR #132: #132
Non-streaming Cloudflare Workers AI binding calls now enforce the configured provider timeout and raise
TimeoutErrorwhen the binding exceeds it. Successful calls clear the timer, and the existing streaming timeout behavior remains unchanged.Validated with
npm test(791 tests),npm run typecheck,npm run build, andnpm run test:worker-import.