Skip to content

Spike: spawn and show Model Router sessions from T3 through an MCP threads toolkit #3

Description

@lukemaj

Outcome

Evidence to decide whether T3 Code becomes the surface that spawns and shows Model Router's sessions (planner, dispatcher, workers, and "send this to Astra" work), integrated as additions rather than edits to upstream code. This is a spike: answers and a throwaway draft PR, not a product change.

Idea (user, 2026-09-24)

Instead of making T3 discover agents launched elsewhere (#1), let T3 spawn them. Agents in a T3 thread start child threads on a chosen harness and model through a new T3 MCP toolkit; children show in the Agents panel; AgentsMD plugins such as Model Router extend T3 instead of competing with it. Model Router keeps policy, capacity and the durable job ledger; T3 executes and displays. Depending on T3 is acceptable.

Questions to answer, each with evidence

  1. Spawn: can a new MCP toolkit (next to device, preview, pullRequests in apps/server/src/mcp/toolkits) let an agent in thread A create thread B on a chosen provider, model and effort, give it a task, and return B's result to A? Per provider: Claude, Codex, OpenCode, Grok.

  2. Message a live thread: can A (or an outside process) send B a message while B is working and while B is idle; is it steering or a queued follow-up; does the reply reach A? This is the delivery path Report terminal job state back to the planner: ready to merge or blocked model-router#94 needs.

  3. Show as subagent: can B appear as a child of A in the Agents panel (AgentsPanel.tsx, subagentRuntime.ts)? What is the smallest parent/child link, and which existing upstream files must change (count files and lines)?

  4. Router kits: can T3 launch a provider session with Model Router's role configuration (CODEX_HOME, CLAUDE_CONFIG_DIR, OpenCode config directory, GROK_HOME, permission set)? See ProviderInstanceEnvironment, ClaudeHome, CodexHomeLayout.

  5. Durability: does a T3-spawned session keep running when the desktop window closes or the server restarts? Can the server run headless (npx t3 / apps/server) as the executor overnight?

  6. Router as client: what API would the Model Router runner call to have T3 spawn and message threads (HTTP, WebSocket orchestration, MCP), keeping the router's ledger authoritative? Model Router may depend on T3 (user, 2026-09-24: the user is its only user); a direct CLI fallback is not required, so also say which existing runner machinery T3 would make unnecessary.

  7. Upstream cost: for each existing file the spike had to touch, how often did it change upstream in the last 90 days (git log --since=90.days upstream/main -- <file>)?

  8. Agents panel (user request, 2026-09-24): make the small bounded change to the spawning logic so threads spawned for Model Router (child threads of a parent thread) appear in the parent thread's right-side Agents panel, which today shows "No agents yet" for them. Implement it in the spike and prove it live.

  9. Sidebar Subagents section (user request, 2026-09-24): child threads do not appear in the main sidebar thread list by default. They are grouped in a new collapsible Subagents section next to Snoozed and Settled, so the main list keeps only threads the user interacts with. Implement it in the spike, reusing the Snoozed/Settled section mechanism, and report which existing upstream files it touches.

Deliverables

  • One findings comment on this Issue answering 1 to 9, each marked verified (with the command or live run), inference, or unknown.
  • A draft PR on a spike branch with the minimal toolkit and any panel link, not merged, with its diff split into new files versus edited upstream files.
  • A recommendation: go, go with changes, or no-go, with the smallest surviving design.

Constraints

  • Never touch the user's running T3 instance (MCP at 127.0.0.1:3773, ~/.t3/userdata) or its dev servers. Use an isolated T3 home and a different port.
  • Prefer new files over edits to upstream code.
  • No provider credentials copied into the repo; no releases or installs.

Non-goals

Production quality, mobile support, Project Direction changes in either repo (the user decides after the findings).

Blockers

None.

Objective contribution

Directly serves this fork's Objective (one control surface for agents across harnesses) and may replace #1's discovery approach; also decides the delivery path for toolboxmd/model-router#94.

Activity

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