Skip to content

OpenCode worktree session move makes T3 cross-provider delegation tools undiscoverable #30519

Open

Description

@drewfatstacks

What happened

An OpenCode thread using opencode-go/deepseek-v4.1-flash successfully created 18 app-owned Codex gpt-6.1-sol subagents. After the agent created a worktree and moved its native OpenCode session there, T3's delegate_task/orchestrator_capabilities tools became undiscoverable. Instructions still advertised delegation, but the agent could only use provider-native OpenCode subagents or fall back to the Codex CLI. Expected: inline cross-provider delegation remains available after a native session move.

Diagnosis

Strongest hypothesis: directory-scoped MCP registration no longer matches the native session's active directory. All five logged connections for this thread's T3 MCP server used the original project directory, including reconnects after the move. The T3 database still reports worktreePath: null. In release v0.1.6 (2359643), packages/provider-opencode/src/server/v2/adapter.ts:3022 selects runtimePolicy.cwd ?? host.paths.cwd; :3045 passes that directory to mcp.add; :3066 supplies orchestration instructions based on successful registration. Registration success in the old directory therefore does not establish tool availability in the moved session. Current main also retains this directory selection. Root cause is not proven: no controlled reproduction or worktree re-registration test was performed. Context exhaustion, a parent-provider switch, and an intervening version update are unsupported by the supplied report. A separate later Codex thread worked, establishing later provider health only.

Steps to reproduce

Incident-derived reproduction, not independently rerun:

  1. Configure OpenCode and Codex providers in T3.
  2. Start an OpenCode thread and delegate a Codex gpt-6.1-sol review; confirm an app-owned subagent card.
  3. From that thread, call tools.opencode.worktree_create and tools.opencode.session_move to move the native session into the worktree.
  4. Ask for another Codex delegate and search the tool catalog for delegate_task, orchestrator, and t3.
    Observed in the incident: those searches return no tools; T3 MCP reconnects in the original directory; thread worktreePath remains null.

Version

T3 desktop/server 0.1.6; independently confirmed local serverVersion 0.1.6. Triage CLI also 0.1.6.

Environment

Windows 11 x64 (10.0.26200), Node v24.22.1, OpenCode 2.2.5. Desktop-managed local server; also accessed remotely through Web UI. Parent: opencode-go/deepseek-v4.1-flash.

Evidence

UTC timeline; home directory redacted:
2026-11-02 17:40:00.394: t3-code-4f39decf-09f0-4a52-9b2c-51f3795a3d53 connected, tools=66, directory=<HOME>/.t3/projects/classact.
18 app-owned Codex delegates started between 18:01:34.016 and 19:54:32.439 (database independently checked). Last task: a8f5cbed-3fe6-4184-8b65-cc8f04219f09.
20:03:30.331: native session moved to <HOME>/.local/share/opencode/worktree/625cf6/classact-implementation (supplied report).
2026-11-03 16:28:58.933: first documented missing-catalog evidence; 19:15:55.132: searches for orchestrator/delegate/t3 return zero results (supplied report).
T3 MCP reconnects at 18:50:37.765, 20:15:24.937, 22:03:24.086, 23:48:08.728: all tools=66, all original directory (logs independently checked).
Thread: 4f39decf-09f0-4a52-9b2c-51f3795a3d53; projection worktreePath=null (database independently checked).
Reported context usage: 248k, 533k, and 621k of 1M. Screenshot shows an earlier successful app-owned Codex review card.

Related issues

#28949: similar missing T3 tools after a fork, but this incident follows a native worktree move in the same thread. #22944: related MCP registration timing/instruction fixes; does not establish a fix for session moves. #15989: related worktree tracking; its stated native location-follow scope excludes OpenCode.

Fix applied or workaround

User successfully used a separate Codex thread and fell back to Codex CLI. No repair, database write, configuration change, or recovery test was performed during this triage. Latest stable release checked was v0.1.6; no confirmed shipped fix identified.

Filed by

Codex (GPT-6) via t3 triage; incorporates the user's supplied investigation report.

Activity

  1. added
    via-triage
    on Nov 4, 2026
  2. knocking4thcylinder commented on Nov 19, 2026

    @knocking4thcylinder
    Contributor

    Independent reproduction on a much newer build — same sequence, still present. My timeline adds one detail the original report didn't have: after the move, the thread's MCP server never reconnects at all, even on later runs in the same thread.

    Environment: T3 desktop/server 0.1.11-nightly.20261119.4928, OpenCode 2.3.2, Linux x86_64 (Omarchy/Arch, kernel 7.2.15). Parent model opencode-go/glm-5.3. Session originally in /home/deck/proxy-router.

    Timeline (UTC, from ~/.local/share/opencode/log/opencode.log):

    15:33:07  mcp connected server=t3-code-43b70237-... tools=91
              directory=/home/deck/proxy-router
              delegate_task / orchestrator_capabilities / t3_thread_* all present;
              delegation used successfully before the move
    15:40:49  agent calls tools.opencode.worktree_create + tools.opencode.session_move;
              provider.updated events confirm the session is now in
              /home/deck/.local/share/opencode/worktree/ae2d47/<name>
              → harness rebuilds the Code Mode tool catalog, t3-code-* namespace gone
    15:46–48  catalog searches for delegate/orchestrator/t3 return nothing;
              tools.opencode.list_mcp_resources reports no servers
    15:50:07  user sends a new message in the SAME thread → a new run starts,
              but no mcp connected line appears for this thread's server
              (t3-code-43b70237-...) again. The only later t3-code line in the log
              is a different server id (t3-code-2fcf7b69-...) and still binds
              directory=/home/deck/proxy-router.
    15:48–16:00  further runs in the moved session: zero T3 tools in the catalog,
              zero re-attach attempts targeting the worktree directory.
    

    Difference vs the original report: #30519's evidence shows the thread's server reconnecting, always into the original directory. Here the thread's server never reconnects after the move at all — subsequent runs proceed with no registration attempt, so the moved session is permanently without T3 tools. The conversation still carries T3's orchestration instructions from before the move, so the agent keeps reaching for tools that no longer exist in its catalog.

    Workaround (same as reported): provider-native subagents still work from the moved session; a fresh T3 thread bound to the worktree gets its MCP server normally.

    Not fixed between v0.1.6 and 0.1.11-nightly.20261119.4928 (current nightly).

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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions