[Bug]: CLAUDE_CODE_ENTRYPOINT=t3-code disables MCP Tasks: tools/call never advertises io.modelcontextprotocol/tasks, so task waits fail with -32021

未关闭
#38,969 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
api, backend

调研方向

Start in the apps/server area named in the issue and trace where T3 Code sets CLAUDE_CODE_ENTRYPOINT and launches Claude Code; compare that path with the sdk-ts behavior described in the reproduction. Check the MCP integration and existing coverage for entrypoint configuration. Done when a T3 thread advertises the tasks capability on tools/call and task waits can complete and wake the idle thread.

由索引模型根据 Issue 内容生成。

描述

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

Since #28410, T3 Code starts Claude Code with CLAUDE_CODE_ENTRYPOINT=t3-code. With that value, Claude Code doesn't advertise the MCP Tasks extension (io.modelcontextprotocol/tasks, protocol 2026-07-28) to MCP servers. A server that returns a task handle for a long-running tool therefore can't use one in a T3 Claude thread. The idle main conversation also never wakes when the task completes.

This is the same pattern as #29393 and #34562: Claude Code treats t3-code as an unknown entrypoint.

  1. Run any HTTP MCP server that speaks protocol 2026-07-28, advertises extensions["io.modelcontextprotocol/tasks"] in server/discover, and logs params._meta["io.modelcontextprotocol/clientCapabilities"] on tools/call. The tool should return resultType: "task" only when that capability is present, and JSON-RPC -32021 otherwise. A 26-line Node recorder that does this is included at the end of this issue.
  2. Add it to a Claude thread, for example in the project's .mcp.json: {"mcpServers":{"rec":{"type":"http","url":"http://127.0.0.1:47812/mcp"}}}.
  3. Make sure the instance has CLAUDE_AUTO_BACKGROUND_TASKS=1, and that CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND and CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS are unset.
  4. In a new Claude thread, ask the model to call the tool once and end its turn.

To isolate the entrypoint, the same check runs outside T3 with a stream-json client that keeps its input open:

for e in t3-code sdk-ts cli; do
  CLAUDE_CODE_ENTRYPOINT=$e claude --input-format stream-json --output-format stream-json --verbose \
    --strict-mcp-config --mcp-config rec-mcp.json --allowedTools mcp__rec__probe_wait
done
Expected behavior

The tools/call metadata includes extensions: {"io.modelcontextprotocol/tasks": {}}. The server returns a task handle, and Claude Code polls tasks/get. When the task completes, the idle thread starts a new turn with origin task-notification / mcp-task. This is what happens with sdk-ts, the Agent SDK default that T3 Code used before #28410.

Actual behavior

With t3-code, the tools/call capability object contains only roots and elicitation, so the server answers -32021 Missing required client capability. No task is created and no wake follows.

Each result below is from a separate session. The cache columns are the state of the feature-flag cache in ~/.claude.json.

CLAUDE_CODE_ENTRYPOINT Cache before Cache after Tasks on tools/call
t3-code (set by T3) any false no, -32021
t3-code + CLAUDE_INTERNAL_FC_OVERRIDES={"tengu_glowing_lark":true} true false no
cli (unset) true true yes, handle polled, idle wake
sdk-ts true true yes, handle polled, idle wake

The results were the same through a local Anthropic-compatible proxy and with a direct connection. Claude Code 2.1.322, 2.1.326 and 2.1.327 all behave this way. In 2.1.327 the gate is the remote rollout flag tengu_glowing_lark. Its built-in default is on only for cli, and the remote value came back false for t3-code and true for sdk-ts and cli.

The flag value is stored in the shared ~/.claude.json cache, so this also affects other sessions:

  • Each t3-code session writes false into the cache.
  • A session that starts later with sdk-ts or cli builds its MCP capabilities from that cached false.
  • That session keeps those capabilities for its whole lifetime, even after its own fetch returns true.

So a single running T3 Claude thread can turn MCP Tasks off for the next standalone claude session on the same machine.

Impact

Major degradation or frequent failure

MCP servers that use durable task waits get -32021 in every T3 Claude thread. In our case, orchestrator threads arm a task wait and end their turn so they can be woken when a delegated agent finishes. That pattern doesn't work at all in T3 since #28410.

Version or commit

T3 Code 0.1.11-nightly.20261118.4864, also 0.1.11-nightly.20261117.4838. It worked before #28410, when T3 Code 0.1.6 launched Claude Code with the default sdk-ts.

Environment

macOS arm64; Claude Code 2.1.327 (also 2.1.322 and 2.1.326); Agent SDK 0.3.321; claude.ai subscription login; claudeAgent provider instance.

Logs or stack traces
# recorder log, CLAUDE_CODE_ENTRYPOINT=t3-code
server/discover  protocol=2026-07-28  clientCapabilities={"roots":{"listChanged":true},"elicitation":{"form":{},"url":{}}}
tools/call       protocol=2026-07-28  clientCapabilities={"roots":{"listChanged":true},"elicitation":{"form":{},"url":{}}}
-> -32021 Missing required client capability

# same server, CLAUDE_CODE_ENTRYPOINT=sdk-ts
server/discover  clientCapabilities={...,"extensions":{"io.modelcontextprotocol/tasks":{}}}
tools/call       clientCapabilities={...,"extensions":{"io.modelcontextprotocol/tasks":{}}}
tasks/get        -> completed
result origin    {"kind":"task-notification","producer":"session-task","taskKind":"mcp-task"}
Workaround

Override the entrypoint in the instance environment, which #28410 allows:

{ "name": "CLAUDE_CODE_ENTRYPOINT", "value": "sdk-ts", "sensitive": false }

Running threads keep their old environment and their capabilities from connect time, so you have to start a new thread.

Side effects of sdk-ts:

  • Claude Code turns the Artifact tools off. CLAUDE_CODE_ARTIFACT=1 turns them back on (#31264).
  • Claude Code drops its built-in claude-code-guide subagent.

Possible fixes:

  • Default back to sdk-ts and send T3 attribution another way.
  • Or get t3-code registered with Anthropic as a known Agent SDK entrypoint. That would cover this issue, #29393 and #34562 together.
mcp-tasks-recorder.mjs (run: node mcp-tasks-recorder.mjs 47812 rec.log)
import http from 'node:http';
import fs from 'node:fs';
const port = Number(process.argv[2]); const logFile = process.argv[3];
const MODERN = '2026-07-28', TASKS = 'io.modelcontextprotocol/tasks'; let waits = 0;
const log = (e) => fs.appendFileSync(logFile, JSON.stringify({ t: new Date().toISOString(), ...e }) + '\n');
const tool = { name: 'probe_wait', description: 'Probe wait tool. Call it once with no arguments.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } };
http.createServer((req, res) => {
  let raw = ''; req.on('data', (c) => (raw += c)); req.on('end', () => {
    let msg = null; try { msg = JSON.parse(raw); } catch {}
    const meta = msg?.params?._meta ?? null;
    log({ rpcMethod: msg?.method ?? null, caps: meta?.['io.modelcontextprotocol/clientCapabilities'] ?? null, ua: req.headers['user-agent'] ?? null });
    const reply = (b) => { res.writeHead(200, { 'content-type': 'application/json' }); res.end(JSON.stringify(b)); };
    if (req.method !== 'POST' || !msg) { res.writeHead(405); return res.end(); }
    if (msg.id === undefined) { res.writeHead(202); return res.end(); }
    const ok = (result) => reply({ jsonrpc: '2.0', id: msg.id, result });
    const now = new Date().toISOString();
    switch (msg.method) {
      case 'server/discover': return ok({ resultType: 'complete', supportedVersions: [MODERN], capabilities: { tools: {}, extensions: { [TASKS]: {} } }, serverInfo: { name: 'recorder', version: '0.0.1' }, instructions: 'probe' });
      case 'tools/list': return ok({ resultType: 'complete', tools: [tool] });
      case 'tools/call': if (meta?.['io.modelcontextprotocol/clientCapabilities']?.extensions?.[TASKS] !== undefined) { waits++; return ok({ resultType: 'task', taskId: 'probe-' + waits, status: 'working', createdAt: now, lastUpdatedAt: now, ttlMs: null, pollIntervalMs: 2000 }); }
        return reply({ jsonrpc: '2.0', id: msg.id, error: { code: -32021, message: 'Missing required client capability' } });
      case 'tasks/get': return ok({ resultType: 'complete', taskId: msg.params?.taskId, status: 'completed', createdAt: now, lastUpdatedAt: now, ttlMs: null, pollIntervalMs: 2000, result: { resultType: 'complete', content: [{ type: 'text', text: 'PROBE_DONE' }], isError: false } });
      default: return reply({ jsonrpc: '2.0', id: msg.id, error: { code: -32601, message: 'not found' } });
    }
  });
}).listen(port, '127.0.0.1');
主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
4 小时 29 分钟
30 天内合并 PR
488

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。