Repository navigation
fix(tool): default toOpenAIResponses to non-strict - #408
Merged
Merged
Conversation
OpenAI's strict mode requires every property in `required` and every nested
object closed. The SDK only closes the root, so with strict as the default every
StackOne tool with an optional or open nested field was rejected with a 400
("'additionalProperties' is required to be supplied and to be false"), including
the OpenAI Responses example.
- toOpenAIResponses() and Tools.toOpenAIResponses() now default to strict: false
- { strict: true } still closes the root, for schemas that already meet the rest
- JSDoc and README describe the new default; tests pin both modes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
- Tools.toOpenAIResponses() JSDoc states the default and points at the strict notes - Unit test checks the bulk default is non-strict, not only the explicit option - The Responses example test checks no tool goes out strict Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
commit: |
This was referenced Nov 11, 2026
glebedel
added a commit
that referenced
this pull request
Nov 12, 2026
… to non-strict #408 made toOpenAIResponses non-strict by default, so passing it and explaining that strict mode rejects optional fields is redundant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
glebedel
added a commit
that referenced
this pull request
Nov 13, 2026
* fix(examples): make the framework examples run end to end
Running every example against a local StackOne MCP stand-in, with real
OpenAI and Claude models, showed four examples that fail or print the
wrong thing on main:
- openai-responses-integration: OpenAI rejects the strict schema (400
"additionalProperties is required" for nested query objects), so the
example and README now pass { strict: false }, as the toOpenAIResponses
doc already advises for StackOne actions.
- ai-sdk-integration: AI SDK 5+ tool calls carry `input`, not `args`, so
the example printed "Arguments: undefined".
- anthropic-integration: claude-haiku-4-5-20241022 is not a model id;
the Claude Haiku 4.5 id is claude-haiku-4-5-20251001.
- claude-agent-sdk-integration: a headless query cannot answer a
permission prompt, so the StackOne MCP tools are now listed in
allowedTools and actually run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
* fix(examples): scope the auto-approved Claude Agent SDK example to list actions
allowedTools runs every tool on the StackOne server without a prompt, so
the example and README now fetch only the list actions the prompt needs
rather than every action, writes included. The README Anthropic snippet
also gets the Claude Haiku 4.5 id the example already uses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
* docs(examples): drop strict:false now that toOpenAIResponses defaults to non-strict
#408 made toOpenAIResponses non-strict by default, so passing it and
explaining that strict mode rejects optional fields is redundant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
---------
Co-authored-by: S2D2 <s2d2@stackone.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
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.
Summary
toOpenAIResponses()defaulted tostrict: true. OpenAI's strict mode requires every property inrequiredand every nested object closed, and the SDK only closes the root, so OpenAI rejected every StackOne tool with an optional or open nested field. That includes the OpenAI Responses example, which failed onmainwith a 400.src/tool.ts:BaseTool.toOpenAIResponses()andTools.toOpenAIResponses()now default tostrict: false.{ strict: true }still closes the root, for schemas that already meet the rest. JSDoc on both describes the default.README.md: the schema table describes the new default.src/tool.test.ts: both modes pinned onBaseToolandTools. Two of these tests fail againstmain'ssrc/tool.ts.tests/examples/openai-responses-integration.test.ts: checks no tool goes out strict.Behaviour change for callers who used the default and relied on OpenAI enforcing the schema: pass
{ strict: true }to keep it. Their schemas must already be strict-compatible, as before.Dogfood: the OpenAI Responses example against the real OpenAI API
examples/openai-responses-integration.ts, unchanged (it callstools.toOpenAIResponses()with no options), run on Node 24.22.1 against a local StackOne MCP stand-in built frommocks/mcp-server.ts, with the real OpenAI API.main:This PR:
Test plan
pnpm vitest run src/tool.test.ts src/toolsets.test.ts tests/examples: 380 passed, no type errorsmain'ssrc/tool.ts(2 failed) and pass herepnpm run lint(oxfmt, oxlint type-aware with type-check, knip): pass.pnpm buildand publint: passGates
.claude/rules/*.release-pleasenot applied: no release in scope/forge:forgemain: +24 -22, 6 comment lines (JSDoc on two public methods and one test line), longest block 3, type escapes 0, copies 0. Density flag is the diff being mostly doc linesexecute()the same way in both modes, as withtoOpenAI()andtoAnthropic(). Aikido: 30 open critical/high onmain, all inpnpm-lock.yamlor.github/actions/setup-nix/action.yaml, none in a changed file/security-review/code-reviewTools.toOpenAIResponses()JSDoc, a test for the bulk default, the example test now checks the strict flag. Not changed: making strict mode rewrite nested schemas (a separate, larger change),toAISDK()closing the root and strict replacing a served rootadditionalProperties(both existing, documented behaviour)The commits after 54a7b9b add tests and JSDoc only, with no runtime change.
Post-merge validation
Library: ships with the next release-please release. After publishing, run
examples/openai-responses-integration.tswith the published package. The signal is the model's tool calls printed with exit 0. The regression signal is the 400 above.Requested by guillaume@stackone.com in Slack (repo audit thread).
🤖 Generated with Claude Code