[Fix] Fast turns fail with integration tool schema errors - #2295
Merged
roomote-roomote[bot] merged 1 commit intoSep 6, 2026
Merged
Conversation
Contributor
roomote-roomote
Bot
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
September 6, 2026 17:07
daniel-lxs
approved these changes
Sep 6, 2026
daniel-lxs
approved these changes
Sep 6, 2026
roomote-roomote
Bot
deleted the
fix/fast-integration-schema-0rej1pnufadho
branch
September 6, 2026 17:28
This was referenced Sep 6, 2026
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.
What changed
Fast's integration-call wrapper now emits concrete, non-recursive JSON value alternatives instead of
z.json(). Nested arrays and objects remain unrestricted on the wire and recursively validated by the unchanged server-side schema. Integration lookup, required identifiers, optional arguments, and the shared MCP schema are unchanged.Regression tests load the generated native modules, apply OpenCode's registry normalization, serialize the result, and compile every native tool schema with Ajv Draft 2020-12. They also cover nested JSON round trips and a recursive negative control.
Why this change was made
#2237 introduced
z.json()in Fast to avoid unconstrained argument schemas collapsing downstream. OpenCode 1.18.10 converts that to Draft 2020-12, then renames$defstodefinitionswithout updating#/$defs/...references. The resulting schema cannot resolve its own references. The prior test checked raw Zod output before that rename and therefore missed the regression.The fix preserves concrete JSON value types without depending on recursive references or reverting #2237.
Impact
Removes the malformed Fast integration wrapper schema introduced in v1.3.1. No runtime dependency upgrade, deployment, or database change is included; Ajv is test-only and already present in the lockfile.
The new tests failed against the original implementation with
can't resolve reference #/$defs/__schema0and pass with the fix. All 258 focused Fast tests pass on the current base, as do package TypeScript checks and the full pre-push lint, fast typecheck, and knip gates. One unrelated widget test timed out while competing with the full pre-push checks; the same suite passed on rerun without source changes.An isolated OpenCode 1.18.10 process loaded the exact generated module and returned a reference-free schema from
/experimental/tool; Ajv and Effect conversion accepted it and preserved nested arguments. This verifies the serialization boundary, not live provider acceptance or the exact downstream HTTP 400 stack. Browser proof is not applicable to this non-visual change.