You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 43dfaa3
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
fix(server): external MCP threads inherit the scoped default model and options (#1646)
## Problem
External MCP `create_thread` read the project row's legacy `defaultModelSelection`.
After the settings fold, the UI reads `projectSettingsOverrides` and the environment default instead, so external threads launched with a stale model and lost saved options such as `effort: high`.
Live example, project `t3code-hyprws`:
| Source | Selection |
| --- | --- |
| Legacy row (external MCP) | `codex` `gpt-5.6-sol`, reasoning high |
| Folded override (UI) | `claudeAgent` `claude-opus-5-5`, effort high, 1m |
## Change
`ExternalMcpService` reads `ServerSettingsService.getSettings` on each create and resolves the default with `resolveProjectSettings(settings, project.id, project)`, the same call web `useHandleNewThread` makes.
Saved options pass through unchanged.
Like the composer, an inherited default whose instance cannot run falls back to the first usable instance instead of failing.
| Boundary | State |
| --- | --- |
| `target.options` | still `invalid_request` |
| explicit `target.providerInstanceId` | still strict |
| Auth, DPoP grant, project policy | untouched |
## Scope and approval
Owner-requested fix to the fork's own external MCP feature (`device-auth`, #1636): external launches must inherit the UI's saved project or environment default.
## Verification
```text
vp test run apps/server/src/mcp/external/ → 24 passed
base resolver restored → 4 failed, 20 passed
fallback guard removed → 2 failed, 22 passed
apps/server tsc --noEmit → exit 0
vp lint apps/server/src/mcp/external/ → exit 0
vp run fork:ci → exit 0
```
| New test | Proves |
| --- | --- |
| environment effort | inherited, re-read per launch |
| project override | its provider and all options win |
| options target | still rejected |
| unusable default (x2) | missing or signed out: falls back |
| orchestrator (x2) | high effort persisted, both scopes |
Not checked: a live external client against a deployed build; the served nightly predates this change.
Prepared by a Codex task (`fix/external-mcp-scoped-defaults`); adopted, extended with the fallback, re-verified, and published by Claude Opus 5.5 in Claude Code, hosted by T3 Code.
Independent review: GPT 6.1 Sol (high) via Pi, two rounds.
## Fork trailers
Fork-Domain: device-auth
Fork-Tier: core
Co-authored-by: donjor <[email protected]>
0 commit comments