Skip to content

[Bug]: delegate_task, t3_thread_launch and orchestrator_capabilities ignore models defined in a project's opencode.jsonc #39228

Closed

Description

@mikkisnuyh

Before submitting

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

Area

apps/server

Steps to reproduce

  1. Use T3 Code's OpenCode provider with a folder, for example ~/uni, whose own opencode.jsonc defines an extra provider (here uni, with models such as uni/medium-local). The global ~/.config/opencode/opencode.jsonc doesn't define it.
  2. Add ~/uni (or a subfolder) as a project. Since fix(opencode): project-defined models appear in that project's picker #24585, the model picker for an OpenCode thread there lists the uni/* models, and picking one works.
  3. In a thread in that project (any provider, here Claude), have the agent call delegate_task with target: { providerInstanceId: "opencode", model: "uni/medium-local" }.
  4. Optionally, call orchestrator_capabilities with search: "medium" (or "local") from the same thread, or call t3_thread_launch with modelSelection: { instanceId: "opencode", model: "uni/medium-local" } for the same project.

Expected behavior

Delegation sees the same models the picker shows for that folder. delegate_task and t3_thread_launch accept uni/medium-local for a parent thread or project in ~/uni, and orchestrator_capabilities lists it there. Projects without their own opencode.jsonc keep seeing only the machine-wide catalog.

Actual behavior

delegate_task refuses the model before OpenCode is started:

model_unavailable: Model uni/medium-local is not advertised by provider opencode. Advertised models: opencode/beam-free, opencode/big-pickle, ... and 20 more

The 28 models it lists are exactly what opencode models prints from ~. Run from ~/uni, opencode models also lists the 9 uni/* models. orchestrator_capabilities never shows them either, so the agent has no way to find the model the user asked for.

On main (412a118):

  • requireAdvertisedModel in apps/server/src/mcp/OrchestratorMcpService.ts checks only provider.models, the machine-wide catalog. resolveTarget passes it the provider from input.providers and never looks at workspaceSnapshots[cwd].models for the parent thread's folder.
  • t3_thread_launch does the same in apps/server/src/mcp/toolkits/project/handlers.ts, using ProviderRegistry.getProviders.
  • The model_unavailable refresh-and-retry from fix(server): refresh stale model catalogs before refusing delegation #33426 calls refreshInstance, which reloads only the machine catalog, so the retry fails the same way.

#24585 added the per-folder models to ServerProviderWorkspaceSnapshot for the pickers, and its description says "agent delegation (MCP) model validation" was out of scope. This issue covers that remaining part.

Related:

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.1.10 (server); the same code path exists on main 412a118.

Environment

Debian 13 server running T3 as a background service, with a desktop client over SSH. OpenCode 2.3.2 runs as a shared service. The parent thread was Claude (claude-opus-5-5).

Logs or stack traces

OrchestratorMcpFailure: Model uni/medium-local is not advertised by provider opencode. Advertised models: opencode/beam-free, opencode/big-pickle, nvidia/deepseek-ai/deepseek-v4.1-flash, opencode/deepseek-v4.1-flash-free, nvidia/google/diffusiongemma-26b-a4b-it, opencode/flint-40b-free, nvidia/z-ai/glm-5.3-flash, nvidia/openai/gpt-oss-20b and 20 more; orchestrator_capabilities with search finds them.
    at requireAdvertisedModel (t3:473565:17)
    at OrchestratorMcpService.resolveTarget (t3:473679:21)
    at OrchestratorMcpService.delegateTask (t3:476394:50)
(the same failure is recorded a second time for the retry after refreshInstance)

Screenshots, recordings, or supporting files

No response

Workaround

Start a thread on that model yourself from the picker instead of delegating. Moving the provider into the global OpenCode config also works, but then it shows up in every project, which defeats folder-scoped config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions