Skip to content

Add statusCode and finalUrl to fetch results - #147

Merged
NikhilShahi merged 2 commits into
mainfrom
claude/fetch-status-code
Nov 19, 2026
Merged

NikhilShahi merged 2 commits into
mainfrom
claude/fetch-status-code

Conversation

@NikhilShahi

@NikhilShahi NikhilShahi commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The API is adding two fields to fetch results: the HTTP status of the page that was read and the URL it ended on after redirects. This adds them to the SDK types so callers can tell an error or block page from real content without casting.

Changes

  • FetchResponseData (single fetch) and PageData (batch fetch and web crawl pages) gain optional statusCode?: number and finalUrl?: string.
  • Type-contract test covering both fields on both types.
  • Bump version to 1.5.6.

Both fields are optional: the API omits them when the browser received no response. The SDK passes response JSON through unchanged, so this is a types-only change.

Validation

  • yarn lint passes.
  • yarn build passes.
  • npx vitest run tests/unit/public-types-contract.test.ts passes (8 tests).
  • yarn typecheck reports one error in tests/unit/session-web-bot-auth-proxy-routes.test.ts, which is also present on main without this change.
  • yarn test: 895 of 896 pass. The one failure is a timeout in tests/integration/computer-action.test.ts; that file also fails on main locally (three timeouts there), so it looks like a local flake rather than this change.

Should be released once the API change that returns these fields is live.

🤖 Generated with Claude Code


Note

Low Risk
Types-only SDK update with optional fields and a contract test; no runtime or auth/data-path changes.

Overview
Aligns SDK types with new API fields on fetch responses so callers can distinguish blocks/redirects without casting. Optional statusCode and finalUrl are added to FetchResponseData (single fetch) and PageData (batch scrape and crawl), with JSDoc noting they may be absent when there was no browser response or on older cached results.

A public type-contract test locks in the optional shapes, and the package version is bumped to 1.5.6. Runtime behavior is unchanged—the SDK still forwards API JSON as-is.

Reviewed by Cursor Bugbot for commit 40bf794. Bugbot is set up for automated code reviews on this repo. Configure here.

The API now returns the HTTP status of the fetched page and the URL it
ended on after redirects, for fetch, batch fetch and web crawl. Add both
as optional fields on FetchResponseData and PageData so callers can tell
an error or block page from real content without casting.

Bump version to 1.5.6.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@AHarmlessPyro

AHarmlessPyro commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@NikhilShahi
NikhilShahi added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit b1a33c6 Nov 19, 2026
3 checks passed
@NikhilShahi
NikhilShahi deleted the claude/fetch-status-code branch November 19, 2026 22:39
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.

2 participants