#6683: feat(config): add supportsStrictMode compat option for model definitions
## Summary
Some OpenAI-compatible endpoints reject requests that include the `strict: true` parameter in tool/function definitions. This parameter was added by OpenAI for structured outputs but isn't universally supported.
This PR adds a `supportsStrictMode` option to the `compat` field in model definitions, allowing providers to be configured to omit the strict parameter when making API calls.
**Changes:**
- Added `supportsStrictMode?: boolean` to `ModelCompatSchema` in `zod-schema.core.ts`
- Added `supportsStrictMode?: boolean` to `ModelCompatConfig` type in `types.models.ts`
- Added unit tests for the new schema option
## Example Config
```json
{
"models": {
"providers": {
"routellm": {
"baseUrl": "https://routellm.abacus.ai/v1",
"api": "openai-completions",
"models": [{
"id": "route-llm",
"name": "RouteLLM",
"compat": { "supportsStrictMode": false }
}]
}
}
}
}
```
## Note
This PR adds the config option on the openclaw side. The `@mariozechner/pi-ai` library will need a corresponding update to read this compat option and conditionally omit the strict parameter from tool definitions when building API requests.
## Test Plan
- [x] Added unit tests for `ModelCompatSchema` with `supportsStrictMode`
- [x] Existing model-related tests pass
- [ ] Integration testing pending pi-ai library support
Closes #6674
---
Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a new optional `compat.supportsStrictMode` flag to the model config surface (both the `ModelCompatConfig` TS type and the `ModelCompatSchema` zod schema) so providers that reject OpenAI’s `strict: true` tool/function metadata can be configured to omit it. Includes unit tests validating `supportsStrictMode` is accepted both on the compat object itself and when nested under a model definition.
This fits alongside the existing `compat` toggles (`supportsDeveloperRole`, `supportsReasoningEffort`, etc.) that let OpenClaw adapt request shaping per-provider without forking model definitions.
<h3>Confidence Score: 4/5</h3>
- This PR is low risk and primarily extends config schemas/types with tests.
- Changes are additive (new optional boolean) and localized to config typing/validation. No runtime behavior changes are introduced in this repo, and tests are straightforward; however, I couldn’t execute the test suite in this environment (npm unavailable), so confidence isn’t maxed.
- src/config/zod-schema.model-compat.test.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#7044: feat: Add local model tool calling support
by jokelord · 2026-02-02
76.4%
#14475: feat: Add native Azure OpenAI support
by dzianisv · 2026-02-12
75.4%
#16766: fix(model): apply provider baseUrl/headers override to registry-fou...
by dzianisv · 2026-02-15
74.3%
#16290: fix: add field-level validation for custom LLM provider config
by superlowburn · 2026-02-14
74.2%
#11297: fix: add thinkingFormat 'qwen' compat for bailian/dashscope providers
by AdJIa · 2026-02-07
74.1%
#16098: fix: omit tools param for models without tool support, surface erro...
by claw-sylphx · 2026-02-14
74.1%
#19020: bugfix(gateway): Handle invalid model provider API config gracefully\…
by funkyjonx · 2026-02-17
73.7%
#20673: fix #20566: allow unknown fields in provider config
by neipor · 2026-02-19
73.6%
#11561: fix: respect supportsReasoningEffort compat flag for xAI/Grok reaso...
by baxter-lindsaar · 2026-02-08
73.4%
#22175: fix: support xai tool stream and compat flags
by ShunsukeHayashi · 2026-02-20
73.2%