t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: external MCP launches ignore the environment's default model

Open SIGTERM-015 opened this issue 1 month ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Set a server-wide default model in the environment settings (defaultModelSelection, for example {"instanceId":"claudeAgent","model":"claude-sonnet-5-5"}). Leave the project's own defaultModelSelection unset, which is the normal case.
  2. From an MCP client that is not running inside a T3 thread, call t3_thread_launch with only a title and a projectId. The same applies to schedule_task from such a caller.
  3. Start a thread in the same project from the UI. It uses the environment default and works.

Expected behavior

A caller with no parent thread gets the model a new thread in that project would get: the project's override, then the environment default. It is only asked to pass modelSelection when neither exists.

Actual behavior

The launch fails with invalid_request: "Pass modelSelection: the project has no default model...". schedule_task fails the same way. A caller inside a thread is not affected because it inherits that thread's model.

Impact

Major degradation or frequent failure

Version or commit

0.0.46-nightly.20261014.3093; the code is unchanged on main at eeaac49a9d.

Logs or stack traces

Pass modelSelection: the project has no default model

Workaround

Pass an explicit modelSelection in every external call.

Cause

t3_thread_launch (apps/server/src/mcp/toolkits/project/handlers.ts) and projectDefaultModelSelection in apps/server/src/mcp/OrchestratorMcpService.ts read the raw project defaultModelSelection instead of resolving it with the environment settings (resolveProjectSettings in packages/shared/src/projectSettings.ts). The API therefore also reports null for projects that inherit.

This is separate from #16833, which is about letting schedule_task choose a model. Here the model is not chosen at all. I have a small fix ready and will link it once this is triaged.

SIGTERM-015 avatar Oct 14 '26 09:10 SIGTERM-015

[!NOTE] 🤖 Claude Opus 5.5 responding on behalf of Theo

Thanks for the report. One part of this is fixed on main in #22732. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: schedule_task callers outside a thread still fail when the project inherits the environment default. If that part still matters to you, please open a new issue for that part only.

t3dotgg avatar Oct 21 '26 11:10 t3dotgg