Repository navigation
Align Alexandria CLI timeouts with the 120-second API deadline - #279
Open
developersdigest wants to merge 1 commit into
Open
developersdigest wants to merge 1 commit into
developersdigest wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
src/commands/alexandria.tsmishandles non-JSON HTTP failures, causing users to see a JSON parse error instead of the actual HTTP status and retry metadata; parse failures as an empty body before constructing the error response.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/alexandria.ts">
<violation number="1" location="src/commands/alexandria.ts:230">
P2: Non-JSON HTTP failures bypass the `response` object below, so users receive a JSON parse error instead of the HTTP status and retry metadata. Parse failures as an empty body before constructing the error response.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| redirect: 'error', | ||
| signal: AbortSignal.timeout(timeout + 30_000), | ||
| }); | ||
| const body = await response.json(); |
Contributor
There was a problem hiding this comment.
P2: Non-JSON HTTP failures bypass the response object below, so users receive a JSON parse error instead of the HTTP status and retry metadata. Parse failures as an empty body before constructing the error response.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/alexandria.ts, line 230:
<comment>Non-JSON HTTP failures bypass the `response` object below, so users receive a JSON parse error instead of the HTTP status and retry metadata. Parse failures as an empty body before constructing the error response.</comment>
<file context>
@@ -207,19 +206,52 @@ export async function requestAlexandria(
+ redirect: 'error',
+ signal: AbortSignal.timeout(timeout + 30_000),
});
+ const body = await response.json();
+ if (!response.ok || !body?.success) {
+ throw Object.assign(
</file context>
Suggested change
| const body = await response.json(); | |
| const body = await response.json().catch(() => ({})); |
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.
Alexandria CLI calls currently time out after 80 seconds because the SDK transport still assumes a 50-second execution deadline. The API now allows 120 seconds after firecrawl/firecrawl#4728, so valid requests can outlive the CLI connection.
Send Alexandria requests directly to
/v2/scrapewith a default and maximum execution timeout of 120 seconds, plus 30 seconds for response delivery. Preserve explicit shorter timeouts, request IDs, receipts, error metadata, and retry guidance. Transport failures are not automatically retried. This bypass is scoped to Alexandria because the latest published SDK still hard-codes the shorter transport limit.Validation: build and TypeScript check pass; 47 Alexandria CLI integration tests and four timeout/recovery tests pass. The updated build was installed locally; no npm release was published. This fixes the premature client timeout, not upstream deadline failures.
Summary by cubic
Fixes Alexandria CLI calls timing out after 80 seconds by bypassing the SDK's hard-coded transport limit and sending requests directly to
/v2/scrapewith the API's 120-second execution deadline.Written for commit f9d3720. Summary will update on new commits.