Skip to content

Read render-marked tool parameter schemas as their boolean schemas - #2681

Closed
jonathan308 wants to merge 5 commits into
perf/sdk-pin-literals-under-combinatorsfrom
fix/tool-argument-render-markers
Closed

jonathan308 wants to merge 5 commits into
perf/sdk-pin-literals-under-combinatorsfrom
fix/tool-argument-render-markers

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When the coordinator repairs a tool parameter declared as a boolean schema ({} or true, or false), it forwards {type: "string"} plus an x-darkbloom-original-boolean-schema marker. The strict check already reads such a marked node as the boolean schema it came from. The argument reading did not, so a value under a marked {} was read as a string.

  • ToolArgumentSchemas now reads a marked node (annotations only beside the marker) as {} with its annotations, or as false, at every position it walks: properties, items, prefixItems tails and union branches. A marker beside an assertion stays as written.
  • A testing switch, DARKBLOOM_LOCAL_ALLOW_TOOL_SCHEMA_METADATA=1 (exactly 1), lets the local server accept internal schema metadata so these shapes can be tried locally. It is off by default, logs one warning when on, and leaves the coordinator path unchanged. Documented in docs/reference/configuration.md.
  • Literal values under a marked {} (for example 45) read as numbers once the SDK pin carries the literal reading (Pin the SDK with JSON literals under combinator argument schemas, and match the Qwen grammar #2640).

Test plan

  • CI (dev) on this head.
  • Red control (draft PR, the tests alone on D7): the new tests fail.
  • Tests: the exact repaired shapes (array and {} items, nullable {} with a description, a false prefixItems tail, a marker beside an assertion), and the switch on and off.

Refactor pass

Refactor pass: done; no behaviour-preserving changes warranted

AI usage

  • I have read this PR description in full and approve it as my own, and it
    accurately describes the code changes.
  • AI usage disclosure: an AI model (Claude Opus 5.5, in OpenCode) wrote this change, its tests and this description, and opened this PR on the repository owner's behalf under the owner's authorization for this release. The acknowledgement box above is left for the owner.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The coordinator forwards a parameter schema of {}, true or false as
{"type": "string", "x-darkbloom-original-boolean-schema": <bool>}. The strict
check (ToolConstraintValidation) reads that marker; argument reading did
not, so an untyped parameter or array item read as a declared string. The
reading the parser uses (ToolArgumentSchemas.typingFiniteValues) now turns
such a node, under the strict check's own conditions (a string type, a
Boolean marker, annotations only), back into {} with its annotations or
into false.

DARKBLOOM_LOCAL_ALLOW_TOOL_SCHEMA_METADATA=1 is a testing switch that lets
the local API accept tool schemas carrying the marker, as the coordinator
forwards them, so a loopback run can serve production's shapes. Off by
default, logged when on; the coordinator path is unchanged.
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 24, 2026 5:34pm UTC
darkbloom-status Ready Ready Preview Nov 24, 2026 5:34pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 24, 2026 5:34pm UTC

Request Review

…he Qwen grammar

A strict tool forwarded with {}, true and false parameters (and items) as
marked string render types reads them as {} and false (argumentTools),
which also feed the strict grammar's conversion. The grammar reads a bare
false or {} as text, and either constrains the call (an untyped value is
free text) or declines it; it never holds such a value to the render
type's string. Auto and required choices both.
Both branches add tests at the same places in DeclaredToolArgumentTests
and QwenStrictToolGrammarTests; the merge keeps every test of both. The
sources merge without conflict.
@jonathan308
jonathan308 changed the base branch from dev to perf/sdk-pin-literals-under-combinators November 24, 2026 15:56
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
… before

Under tool_choice required the declared tools compile, and a marked node
compiles only as exactly {type: string, <marker>: true}
(ToolConstraintSchema); an annotated or false marker is refused there, as
on dev before this change. The test now expects that refusal for the
forced choice and checks the argument reading and grammar under auto.
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 24, 2026
@jonathan308

Copy link
Copy Markdown
Collaborator Author

Closing: this branch's head (cd0fbb8) is already contained in dev.

@jonathan308 jonathan308 closed this Dec 2, 2026

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — cd0fbb87 Deployed Nov 24, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — cd0fbb87 Deployed Nov 24, 2026 by vercel[bot]
Preview – darkbloom-status — cd0fbb87 Deployed Nov 24, 2026 by vercel[bot]
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