Skip to content

[Bug]: OpenCode + Meta/Muse models fail every turn: T3 MCP tool names exceed Meta's 64-character limit #43429

Done

Description

@leocodeio

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. T3 Code 0.1.12 (desktop, Linux), OpenCode 2.4.2 via the managed local OpenCode server (opencode serve).
  2. Open any project thread and select the OpenCode provider model opencode-go/muse-spark-1.3-contributor (reasoning Extra High).
  3. Send any message, e.g. hi.

Expected behavior

The turn runs normally, like it does with opencode-go/deepseek-v4.1-flash in the same thread/project.

Actual behavior

Every turn fails immediately with a provider error and no model call is made:

Provider error
`name` must be at most 64 characters, got 66

The stored provider response is:

{"model":"muse-spark-1.3-contributor","error":{"code":null,"message":"`name` must be at most 64 characters, got 66","param":"name","type":"invalid_request_error"}}

Server log:

level=ERROR message="Failed to drain Session" cause="AI.Error: `name` must be at most 64 characters, got 66 ..."

This affects Muse/Meta models specifically because Meta's Responses API rejects tool names longer than 64 characters. Other providers in the same thread accept the same tool set, so the model can't be used at all on OpenCode threads.

Impact

Blocks work completely for Meta/Muse models on the OpenCode provider.

Version or commit

T3 Code 0.1.12 (~/.t3/userdata/desktop-last-started-version = 0.1.12), OpenCode 2.4.2.

Environment

Linux, T3 Code desktop, managed local OpenCode 2.4.2, provider opencode-go (OpenCode Go), models muse-spark-1.3-contributor and muse-spark-1.2-contributor.

Root cause

T3 registers its per-thread MCP server under t3-code-<threadId>:

// packages/provider-opencode/src/server/v2/adapter.ts
const name = `t3-code-${threadId.replaceAll(/[^a-zA-Z0-9_-]/g, "_")}`;
if (name.length <= 64) return name;
return `t3-code-${hash.slice(0, 16)}`;

A V2 thread ID is a UUID, so the server name is 44 characters (t3-code- + 36). OpenCode exposes MCP tools as <server>_<tool>, so any T3 tool name longer than 19 characters overflows the 64-character limit:

t3-code-d4ecfe87-382d-47a5-80cc-e86859fc985e_delete_scheduled_task
└─────────────── 44 ───────────────┘ + 1 + 21 = 66

The current guard only truncates the server name when it alone exceeds 64 (the old OpenCode namespace restriction from #16140), not when the combined <server>_<tool> name exceeds the provider limit.

T3 tools that overflow with a UUID thread ID (server prefix 45):

tool total length
delete_scheduled_task 66
create_scheduled_task 66
update_scheduled_task 66
t3_attachment_discard 66
t3_environment_unlink 66
list_scheduled_tasks 65
t3_environment_links 65
unlink_pull_requests 65
unwatch_pull_request 65
run_scheduled_task_now 67
preview_recording_stop 67
preview_set_appearance 67
preview_recording_start 68
read_pull_request_guide 68
list_thread_pull_requests 70
orchestrator_capabilities 70
t3_thread_send_attachments 71
t3_attachment_prepare_upload 73
t3_environment_preferences_update 78

Evidence

  • Reproduced on a bare OpenCode session created through the OpenCode HTTP API in the same project, so this is not a T3 UI or prompt issue.
  • Denying all t3-code-* tools in the session permissions makes the same Muse thread succeed.
  • Denying only t3-code-*_delete_scheduled_task changes the error to `name` must be at most 64 characters, got 65 — the next overlong tool (list_scheduled_tasks) — which confirms the failing name is a T3 MCP tool name and not the model, agent, or session title.
  • The same thread/project works with opencode-go/deepseek-v4.1-flash (high and max) with the identical T3 tool set.
  • A config-level "tools" deny for these names does not help because T3's session permission rules (* allow, t3-code-<id>_* allow) are applied after config rules and override them.

Suggested fix

Make the server name short unconditionally, e.g. always use t3-code-${hash.slice(0, 16)} (24 chars, so the longest T3 tool stays under 64), or cap the combined <server>_<tool> name at 64 with a deterministic hash suffix. The latter also protects against future tool names.

Related: #16140 (server name length), anomalyco/opencode#47049 (same Meta limit with long MCP names).

Workaround

Switch the thread to a non-Meta model, e.g. opencode-go/deepseek-v4.1-flash. Verified in the same thread with both high and max.

Logs or stack traces

timestamp=2026-11-26T11:06:57.854Z level=ERROR run=ef6df7b1 message="Failed to drain Session" cause="AI.Error: `name` must be at most 64 characters, got 66
    at SessionStep.attempt ...
    [cause]: AI.Error.InvalidRequest: `name` must be at most 64 characters, got 66"

Activity

  1. juliusmarminge commented on Dec 2, 2026

    @juliusmarminge
    Member

    Fixed by #43800, now on main: OpenCode now always uses a 24-character hashed T3 MCP server name, keeping every current combined tool name within 64 characters so Muse/Meta turns no longer fail with the reported “name must be at most 64 characters, got 66” error.

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