Skip to content

feat: openai-compatible-strict-reasoning (1/2) - #26

Closed
myk1yt wants to merge 23 commits into
mainfrom
pr/b05a-strict-reasoning-v2
Closed

feat: openai-compatible-strict-reasoning (1/2)#26
myk1yt wants to merge 23 commits into
mainfrom
pr/b05a-strict-reasoning-v2

Conversation

@myk1yt

@myk1yt myk1yt commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Stack Position

  • Feature Branch: feat/openai-compatible-strict-reasoning (1/2) + fix/mimo-parallel-tool-call-policy (shared 1/2 root)
  • Stage: 1/2
  • Depends on: None

Description

Full Feature Description

  • Feature Branch: feat/openai-compatible-strict-reasoning
  • Feature Name: OpenAI-Compatible Strict Reasoning and Provider Cost
  • Purpose: Resolves the problem where, despite differing levels of strict JSON schema and reasoning effort support across OpenAI-compatible endpoints, request control is scattered per provider, and cost is calculated as zero or inaccurately due to usage field differences. Enables users to explicitly opt in to strict tool schema and extended reasoning effort on supported endpoints, and normalizes response usage according to provider contracts to consistently display actual cost.
  • Full Change Description: B05a adds provider settings contracts, cached settings UI, strict schema opt-in, reasoning effort values, and base request shaping. B17 normalizes conditional fields, cached tokens, missing/zero values, and price lookup for OpenAI, OpenAI-compatible, Anthropic Vertex, and Qwen family usage. B05a is also shared as the foundation for the MiMo chain, but in this chain B17 is a sibling outcome that does not depend on B12.
  • Impact Scope: Affects provider-settings.ts, base-openai-compatible-provider.ts, base-provider.ts, OpenAICompatible.tsx, openai.ts, openai-compatible.ts, anthropic-vertex.ts, qwen-code.ts.
  • Errors and Edge Cases: Strict mode is opt-in and does not change existing schemas when disabled. Strict/reasoning fields are not sent to unsupported providers. MCP schemas are not aggressively hardened. The settings UI only modifies cachedState before saving. Cost calculation treats missing fields as unknown or zero per provider contract and does not produce negative tokens. Cached input/output tokens and provider-specific price units are not double-counted. B17 does not change request payload or tool-call policy.
  • Testing Method: Run B05a's settings serialization, schema conversion, opt-in/omitted-field, request fixture, and UI/locale tests, and B17's provider-specific usage/cost fixtures. Manually compare requests with strict toggle off vs. on, and feed fixed usage fixtures into OpenAI-compatible and non-OpenAI providers, comparing against documented calculation formulas and costs.

Why Split Into 17 PRs

Instead of submitting this feature as a single unified PR, it was split into individual PRs because as code size grows, safely reviewing a PR becomes very difficult. The feature was broken into mutually exclusive individual PRs so that each can be reviewed independently.

What This PR Specifically Changes

Adds provider-neutral strict schema opt-in, reasoning effort setting, cached settings UI, and OpenAI-compatible base request shaping. Does not include MiMo-specific enforcement or provider cost calculation.

Included Files

  • packages/types/src/provider-settings.ts
  • src/api/providers/base-openai-compatible-provider.ts
  • src/api/providers/base-provider.ts
  • src/api/providers/openai.ts
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • Related locale and direct tests

Exclusion Scope

  • MiMo-specific capability/stream enforcement
  • Tool-call retention policy
  • Provider cost normalization changes
  • All items in the common removal rules

Zoo (VP) added 4 commits August 2, 2026 10:02
…penAI Compatible provider

- Add openAiToolStrictMode boolean to provider settings (profile-scoped, default false)
- Add strict toggle checkbox in OpenAICompatible settings UI
- BaseProvider.convertToolsForOpenAI now accepts strictMode parameter
  - strictMode=true: strict:true + hardened schema
  - strictMode=false: strict:false + best-effort original schema
  - MCP tools: always strict:false regardless of setting
- Wire setting into all 4 openai.ts request paths
- Fix reasoning effort unsafe cast, add xhigh and max values
- Make parallel_tool_calls conditional on tools being present
@myk1yt myk1yt changed the title B05a: Strict Reasoning v2 feat: openai-compatible-strict-reasoning (1/2) Aug 3, 2026
@myk1yt
myk1yt force-pushed the pr/b05a-strict-reasoning-v2 branch from deaf359 to 23e3526 Compare August 3, 2026 09:36
Zoo (VP) added 4 commits August 4, 2026 04:36
Merge debris left strictToolSchemas/strictToolSchemasDescription twice
in the modelInfo object; JSON.parse silently kept the last occurrence.
Add scripts/find-dup-json-keys.js to detect duplicate sibling keys;
scan of all 18 locales shows en was the only affected file.
openAiToolStrictMode is honored by all OpenAI-protocol providers in a
profile, but the checkbox only exists under the OpenAI Compatible
section. Extend strictToolSchemasDescription to state the setting is
saved per profile and applies to other OpenAI-protocol providers.
Non-en locales hold untranslated English text for this key, so they
get the clarification appended as an English parenthetical.
@myk1yt
myk1yt force-pushed the pr/b05a-strict-reasoning-v2 branch 4 times, most recently from 77e7207 to a3b22a7 Compare August 4, 2026 20:40
@myk1yt
myk1yt force-pushed the pr/b05a-strict-reasoning-v2 branch from ce96757 to 5ac1ec0 Compare August 6, 2026 20:00
@myk1yt myk1yt closed this Aug 7, 2026
@myk1yt
myk1yt deleted the pr/b05a-strict-reasoning-v2 branch August 7, 2026 13:05
@myk1yt
myk1yt restored the pr/b05a-strict-reasoning-v2 branch August 7, 2026 13:32
@myk1yt myk1yt reopened this Aug 8, 2026
Zoo (VP) added 3 commits August 8, 2026 13:53
…g PR Zoo-Code-Org#1124

- Add strict-reasoning.json aimock fixture with 6 probe tag mappings
  (fixes 30s e2e-mock timeout caused by 404 No fixture matched)
- Add Playwright CT visual test for strict tool schemas toggle in
  OpenAICompatible settings panel
Replace Windows-generated baseline with Linux CI artifact actual
screenshot to fix cross-platform rendering mismatch (5,456px diff).
- Add 5 tests to base-openai-compatible-provider.spec.ts for
  parallel_tool_calls and openAiToolStrictMode pass-through
- Add 2 tests to openai-compatible.spec.ts for strict mode fallback
  and enabled state (new file)
- Targets codecov/patch 76.47% -> 80%+ for PR Zoo-Code-Org#1124
Zoo (VP) and others added 6 commits August 8, 2026 14:30
Covers the 3 uncovered lines in OpenAICompatible.visual.fixture.tsx
that were blocking codecov/patch/webview-patch (25% -> 70%+).
…ames (Zoo-Code-Org#1073)

* fix(telemetry): record tool usage once centrally, sanitize raw tool names

* fix(telemetry): defer native MCP usage recording until validation passes

* fix(telemetry): narrow UseMcpToolTool callback, harden test mocks, close coverage gaps

* test(telemetry): complete native MCP mock so validateToolExists runs the real path
Co-authored-by: Roomote <roomote@roomote.dev>
Co-authored-by: Roomote <roomote@roomote.dev>
Co-authored-by: Roomote <roomote@roomote.dev>
@myk1yt

myk1yt commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Closing to recreate with main as target base branch. This PR had stale base branch references after fork sync.

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.

2 participants