Skip to content

Add global --timeout flag for per-request timeout#32

Open
paulius-krutkis-dcd wants to merge 3 commits into
wire-batch-flagsfrom
cli-timeout
Open

Add global --timeout flag for per-request timeout#32
paulius-krutkis-dcd wants to merge 3 commits into
wire-batch-flagsfrom
cli-timeout

Conversation

@paulius-krutkis-dcd

Copy link
Copy Markdown
Collaborator

Adds a global --timeout <ms> flag exposing the SDK's per-request timeout (default 180000, the SDK default).

  • Applies to every command and to each item in a batch run.
  • A timed-out request surfaces as TimeoutError → exit 6; in batch mode it becomes a per-item error record without aborting the run.
  • Invalid values rejected as a usage error (exit 2).

Threaded through createDecodoClient(token, schema, timeoutMs) and read from the root options in both the single and batch scrape paths.

Stacked on wire-batch-flags (the batch feature) since it touches run-target-scrape.ts; review/merge the batch stack first. Scope-wise this is part of A7 (error handling) rather than A6.

Note on retries (deliberately not added)

--max-retries was considered and left out. scraper-api already retries the actual scrape against the target inside a single billed request (e.g. unblocker-service retries on content-not-found; the SDK itself does not retry and maps 429→RateLimitError directly). Client-side retries would only add transport-level resilience (429/5xx/network) while risking duplicate billing, so they're deferred. --timeout has no such downside.

Expose the SDK's request timeout as a global --timeout <ms> flag (default
180000, the SDK default). Applies to every command and to each item in a
batch run; a timed-out request surfaces as TimeoutError (exit 6) and, in
batch mode, as a per-item error record without aborting the run.

Invalid values are rejected as a usage error (exit 2).
paulius-krutkis-dcd and others added 2 commits June 11, 2026 10:59
- Bump @decodo/sdk-ts ^2.1.1 → ^2.1.2
- Pass integrationHeader: INTEGRATION_HEADER ("cli") to DecodoClient
- Remove TODO(SCR-3150) comment — SDK now supports integrationHeader
- Update auth-validation test to expect x-integration: cli

Co-Authored-By: Oz <oz-agent@warp.dev>
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