Skip to content

feat(config): expose full pi-ai model compat fields in config schema#11063

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
ikari-pl:feat/model-compat-full-schema
Feb 14, 2026
Merged

feat(config): expose full pi-ai model compat fields in config schema#11063
Takhoffman merged 2 commits intoopenclaw:mainfrom
ikari-pl:feat/model-compat-full-schema

Conversation

@ikari-pl
Copy link
Copy Markdown
Contributor

@ikari-pl ikari-pl commented Feb 7, 2026

Summary

  • Expose all model.compat fields that pi-ai already supports at runtime but the config schema rejects
  • Adds 7 fields to ModelCompatConfig type and ModelCompatSchema zod validator

Problem

The pi-ai openai-completions provider reads 11 compat fields from model.compat via getCompat(), but OpenClaw's config schema only exposes 4 of them (types.models.ts:9-14, zod-schema.core.ts:13-23). Because the zod schema uses .strict(), any user who sets one of the missing 7 fields in openclaw.json gets a validation error on gateway startup.

What changed

Added fields:

Field Type Used at Purpose
thinkingFormat "openai" | "zai" | "qwen" L360-L368 Controls how thinking/reasoning is requested. "qwen" sends enable_thinking: true (Qwen3/DashScope), "zai" sends thinking: { type: "enabled" }, "openai" sends reasoning_effort (default).
supportsStrictMode boolean L513 Whether to include strict: false in tool definitions. Some endpoints reject unknown fields.
supportsUsageInStreaming boolean L291 Whether to request stream_options: { include_usage: true }.
requiresToolResultName boolean L462 Whether tool result messages need a name field (Mistral).
requiresAssistantAfterToolResult boolean L413 Whether to insert synthetic assistant messages after tool results.
requiresThinkingAsText boolean L387 Whether to convert thinking blocks to plain text (Mistral).
requiresMistralToolIds boolean L383 Whether to normalize tool call IDs to 9-char alphanumeric (Mistral).

Relation to open PRs

This is a superset of two open PRs that each add a subset of these fields:

  • #6683 adds supportsStrictMode only (1 of 7 missing fields)
  • #9451 adds thinkingFormat plus auto-detection for DashScope URLs (1 of 7 missing fields + auto-detect logic)

This PR exposes the complete set of 7 missing fields so the config schema stays in sync with what pi-ai already supports at runtime. Auto-detection (as in #9451) is orthogonal and can be layered on top.

Example config

{
  "models": {
    "providers": {
      "lmstudio": {
        "baseUrl": "http://127.0.0.1:1234/v1",
        "api": "openai-completions",
        "models": [{
          "id": "qwen3-32b",
          "name": "Qwen3 32B",
          "reasoning": true,
          "compat": {
            "thinkingFormat": "qwen",
            "supportsStrictMode": false,
            "supportsDeveloperRole": false
          }
        }]
      }
    }
  }
}

Test plan

  • pnpm build passes
  • pnpm test — no existing tests break
  • Verified locally: Qwen3-32B on LM Studio with thinkingFormat: "qwen" sends enable_thinking: true and thinking blocks stream correctly
  • Setting supportsStrictMode: false omits strict from tool definitions

Greptile Overview

Greptile Summary

  • Expands ModelCompatConfig and its Zod validator to accept additional compat flags already supported by the pi-ai openai-completions provider at runtime.
  • Adds 7 new optional fields (stream usage/strict mode/thinking format + Mistral/tooling behavior toggles) to keep the config schema in sync with provider behavior.
  • No other config sections are modified; schema remains .strict() so only the allowlisted compat keys are accepted.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are limited to widening the config schema/types with optional fields that were previously rejected due to .strict() validation; no runtime logic changes were introduced, and the additions keep types and Zod schema in sync.
  • No files require special attention

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added the extensions: memory-lancedb Extension: memory-lancedb label Feb 7, 2026
@Takhoffman Takhoffman self-assigned this Feb 8, 2026
@openclaw-barnacle openclaw-barnacle bot added size: XS and removed extensions: memory-lancedb Extension: memory-lancedb labels Feb 12, 2026
@Takhoffman Takhoffman force-pushed the feat/model-compat-full-schema branch from afc69ba to b26849e Compare February 14, 2026 00:46
@Takhoffman Takhoffman merged commit d134c85 into openclaw:main Feb 14, 2026
9 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

Merged via squash.

  • Merge commit: d134c85
  • Verified: pnpm build, pnpm check, pnpm test
  • Notes: full test suite passed except transient timeout in extensions/lobster/src/lobster-tool.test.ts during one run; isolated rerun passed.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @ikari-pl!

steipete pushed a commit to azade-c/openclaw that referenced this pull request Feb 14, 2026
…penclaw#11063) thanks @ikari-pl

Verified:
- pnpm build
- pnpm check
- pnpm test (full run; transient lobster timeout rerun passed)

Co-authored-by: ikari-pl <811702+ikari-pl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
mverrilli pushed a commit to mverrilli/openclaw that referenced this pull request Feb 14, 2026
…penclaw#11063) thanks @ikari-pl

Verified:
- pnpm build
- pnpm check
- pnpm test (full run; transient lobster timeout rerun passed)

Co-authored-by: ikari-pl <811702+ikari-pl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Moufdibrm pushed a commit to Moufdibrm/openclaw that referenced this pull request Feb 14, 2026
…penclaw#11063) thanks @ikari-pl

Verified:
- pnpm build
- pnpm check
- pnpm test (full run; transient lobster timeout rerun passed)

Co-authored-by: ikari-pl <811702+ikari-pl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
…penclaw#11063) thanks @ikari-pl

Verified:
- pnpm build
- pnpm check
- pnpm test (full run; transient lobster timeout rerun passed)

Co-authored-by: ikari-pl <811702+ikari-pl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…penclaw#11063) thanks @ikari-pl

Verified:
- pnpm build
- pnpm check
- pnpm test (full run; transient lobster timeout rerun passed)

Co-authored-by: ikari-pl <811702+ikari-pl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants