Skip to content

fix(browser): send extraction schemas under json_schema - #2034

Merged
cjol merged 1 commit into
mainfrom
fix-2029-browser-tools
Aug 4, 2026
Merged

fix(browser): send extraction schemas under json_schema#2034
cjol merged 1 commit into
mainfrom
fix-2029-browser-tools

Conversation

@cjol

@cjol cjol commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR fixes Browser Run schema extraction by sending schemas under response_format.json_schema and aligning the exported Quick Action type and examples with the service contract. Fixes #2029.

Why

  • browser_extract accepts a model-facing schema, but forwarded it to Browser Run as response_format.schema. Browser Run requires response_format.json_schema, so every schema-based extraction failed with HTTP 400.
  • The implementation and exported type followed an outdated Browser Run documentation example. The unit test used a fake binding and asserted the same incorrect payload, so it could not detect the contract mismatch.
  • This corrects the SDK to use the service-native field rather than supporting two spellings. The old spelling never produced a valid schema-based Browser Run request.

Public API Surface

  • QuickActionExtractInput.response_format now uses json_schema instead of schema.
  • The model-facing browser_extract input remains unchanged: models still pass the schema through its top-level schema field.

Code Changes

  • Map browser_extract schemas to response_format.json_schema.
  • Align the Quick Action extraction type with Browser Run and Workers Types.
  • Add type coverage that accepts json_schema and rejects the invalid schema property.
  • Update the package documentation and browser Quick Actions example to show the valid request shape.
  • Add an agents patch changeset.

Compatibility

Direct callers of browserExtract or runQuickAction that construct response_format must rename its nested schema property to json_schema. The previous property matched the published SDK type but was rejected by Browser Run at runtime.


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d2ab713

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Patch
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2034

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2034

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2034

create-think

npm i https://pkg.pr.new/create-think@2034

hono-agents

npm i https://pkg.pr.new/hono-agents@2034

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2034

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2034

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2034

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2034

commit: d2ab713

@cjol
cjol merged commit efcb316 into main Aug 4, 2026
22 of 23 checks passed
@cjol
cjol deleted the fix-2029-browser-tools branch August 4, 2026 12:47
@github-actions github-actions Bot mentioned this pull request Aug 4, 2026
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.

bug(browser): browser_extract sends response_format.schema but Browser Run /json requires response_format.json_schema

1 participant