Repository navigation
feat(forge): output schemas and structured content behind experimentalOutputSchema - #326
Merged
Merged
Conversation
…lOutputSchema With ?codemode=false&experimentalForge=true&experimentalOutputSchema=true, 2026-07-28 requests list each forge tool's generated outputSchema and get a successful call's whole body as structuredContent. 2025-era requests are unchanged. The generator (cloudflare/forge@ce4183c) builds the output schemas with the tools, so the Worker only picks a listing.
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.
Adds
&experimentalOutputSchema=trueto the forge direct tools (?codemode=false&experimentalForge=true), so we can try output schemas and structured content before turning them on for everyone (#320 step 5, #257).For 2026-07-28 requests,
tools/listsends each tool'soutputSchemaand a successful call returns the whole parsed body asstructuredContent, never truncated, next to the text. 2025-era requests get exactly what they get today: their clients expect object output schemas, and most of ours are a$ref,allOfor scalar, which 2026-07-28 allows. The era comes from the request's_metaenvelope, so it costs one property read.The forge generator now builds each tool's
outputSchemawith the tools (cloudflare/forge@ce4183c): the 2xx JSON body schema, oranyOfthe distinct ones, with only the models it reaches in$defs. A tool with a 2xx response that has no JSON body gets none (129 of 3,059).listToolsleaves them out unless asked, so the Worker only picks one of two cached listings.Costs: the opt-in listing is ~12 MB instead of ~6 MB (0.98 vs 0.64 MB gzipped), loaded only when asked for. The forge tools bundle grows from 1.23 to 1.43 MB gzipped, and importing the generated tools takes ~40 ms longer in Node, which every forge tools isolate pays.
These are the soak's schemas, so a strict client will reject results the response checks already flag, such as Hyperdrive's write-only
origin.password(cloudflare/forge#63). That's why this is a separate flag.