anthropics / anthropics/claude-code

[BUG] hangs indefinitely

Aberta
#93,304 0 comentários 0 reações 0 responsáveis Ver no GitHub
area:mcp area:permissions area:routines bug has repro platform:web
Linguagem predominante
Python
Estrelas
145k
Forks
23.1k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

Subject: Code Routines (CCR) — Connected MCP connectors stay enabledInChat: false and are completely unusable from within a routine (reproduced with multiple connectors, and also via UI-triggered runs)

Description:

In Code Routines on claude.ai, MCP connectors that are properly connected to the account are completely unusable inside the routine's execution environment. This isn't limited to Google Drive — the same issue reproduces with Ahrefs as well. I've also confirmed that this isn't specific to API-triggered runs: clicking "Run" directly on a routine in the claude.ai UI hangs in the exact same way.

Expected behavior:

A connector specified in mcp_connections should be usable as a tool within the routine's execution environment (enabledInChat should not be decoupled from connection status).
For unattended routine runs, any tool call that requires permission confirmation should either be auto-approved in some form, or at minimum time out and fail with an error — it should never hang indefinitely.

Impact:

There's no way anywhere in the UI (connector settings page, routine edit screen) to manually flip enabledInChat from false to true. As a result, any routine that uses a connector in this state is permanently non-functional. In practice, this makes it impossible to use MCP connectors (at least Google Drive and Ahrefs) with Code Routines at all.

Reproduced on: 2026-09-04, 2026-09-10 (re-confirmed 6 days later; also newly confirmed with Ahrefs)

Environment: Claude Code Desktop (Windows 11), model: claude-opus-5 / claude-sonnet-5

### What Should Happen?

A connector listed in mcp_connections should actually be usable as a tool inside the routine's execution environment — enabledInChat shouldn't be a gate that's disconnected from whether the connector is connected and included in the routine. If a connector shows "connected":true and is explicitly attached to the routine, its tools should load via ToolSearch and be callable during the run.

Separately, for unattended runs, no tool call should ever be able to block on a human-approval prompt that nobody is present to answer. Since routines are documented as running with no permission-mode picker and no approval prompts, a tool like WebFetch triggering a "permission prompt" and leaving the session stuck in requires_action indefinitely is a direct contradiction of that design. At minimum, such calls should auto-resolve (approve or deny) according to the routine's configured permissions, or fail fast with a clear error/timeout — not hang forever with no visible recovery path in either the API or the UI.

### Error Messages/Logs

```shell

```

### Steps to Reproduce

Connect the target connectors (Google Drive, Ahrefs) at https://claude.ai/customize/connectors. The management page correctly shows "Connected," "Authorization: Individual," and a green ✓ status.
Create a Code Routine with that connector specified in mcp_connections.
Run the routine (reproduces both via the API and via the "Run" button in the claude.ai UI).
In the run log, the target connector appears in the ListConnectors tool result, but even though "installState":"connected" and "connected":true, it shows "enabledInChat":false.
Searching for the connector's MCP tools via ToolSearch (e.g. read_file_content, keywords-explorer-overview) returns "No matching deferred tools found" — they cannot be loaded at all.
Additionally, calling the WebFetch tool triggers a "permission prompt" event, and since the run is unattended, nobody is available to approve it — the session gets stuck indefinitely in a requires_action state. This happens the same way even when the routine is triggered directly from the claude.ai UI: no approval dialog ever appears anywhere, and it just hangs.

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.260

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

PowerShell

### Additional Information

_No response_

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Reproduce the issue through the connector management page and a Code Routine triggered by the API or the UI Run button. Inspect the run log for the ListConnectors result, enabledInChat, ToolSearch failures, and the requires_action state from WebFetch. Done means connected mcp_connections tools are callable and unattended runs resolve or fail clearly instead of hanging indefinitely.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
powershell
Domínio
api, backend
Tipo de issue
Bug
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Ativa
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.