改动 / #3363
#3363 [GUI] Forward Composer Effort To Supported API Models
open · @medking82 · 0 评论 · 去 GitHub 看
说明
## Problem and result
Manual chat with a saved reasoning API model displays the composer's selected effort, but `runRemoteTurn` drops it before constructing the outgoing request. The official Off/Low/Medium/High/Max choice now reaches supported OpenAI-chat models. Models with false or unknown reasoning support retain the provider default.
## Related discussion
None required for this focused host bug fix. Existing reasoning checks cover native/agent paths; this change covers direct saved-API chat.
## Approach
Carry `thinking` through the direct-chat path and use saved capability metadata or the host's cached server probe. Ignore capability claims supplied in a client selection. OpenAI-compatible requests map Off to `none` and Max to `high`; OpenRouter reuses the existing official `OPENROUTER_EFFORTS` mapping and `reasoning: { effort }` format, including Max to `xhigh`. No new UI levels are introduced. Authentication, history and cancellation remain in the existing request path.
## Validation
**Passed:**
- Windows, Node 24.18.0, base `e88ee39d`, submitted changes through `ab57c5da`: `node --test tests/api-reasoning-effort.test.mjs tests/model-providers.test.mjs tests/openrouter-reasoning.test.mjs` from `apps/host`, plus a separate successful rerun of `tests/model-providers.test.mjs` with the Windows PowerShell module path corrected. Combined result: 18 passed, 1 Harness-dependent test skipped.
- Direct API fixtures exercise all five choices, provider defaults, saved false/unknown capability, host-owned probes, ignored client capability overrides, OpenRouter's wire format, and unchanged Responses/Anthropic payloads. A disposable real host and mock API exercise 20 composer/model combinations without acquisition or live-model calls.
- Existing `tests/thinking-direct.test.mjs` checks passed; its implementation is unchanged.
**Failed:**
- Baseline regression: selecting Off reached the API without `reasoning_effort` instead of `none`.
- Follow-up regression exposed the direct OpenRouter format mismatch; the final patch uses the existing agent mapping.
- The Windows ACL helper initially failed under an inherited PowerShell 7 module path. The same check passed with the process-local Windows PowerShell module path; no repository or system policy was changed.
**Not run:**
- Live cloud or GPU inference. The real Harness integration test was skipped because a built Harness is not configured. No engine backend code changed.
## Limits
This applies to OpenAI-chat connections whose saved or probed metadata declares reasoning support. Responses and Anthropic keep their current defaults. Thinking budgets are not added to external API requests.
本站相关内容
相关页面的快捷入口。