anthropics / anthropics/claude-agent-sdk-typescript

Plugin initialization fails with "Control request timeout: initialize" error in claude-agent-sdk versions 0.1.45 and above. The timeout occurs after ~65 seconds during the SDK's control protocol initialization phase.

Open
#274 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
1.8k
Forks
226
PR merge metrics
No merged PRs in 30d

Description

**Envronment details**

OS: Windows 11 Enterprise 10.0.26100
Python: 3.13
SDK Version (broken): 0.1.54 (also tested 0.1.45-0.1.56, all fail)
SDK Version (working): 0.1.44

**The psudo code**

```
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

async def test():
options_dict = {
"cwd": "/path/to/plugin",
"plugins": [{
"type": "local",
"path": "/path/to/plugin"
}],
"settings": "/path/to/plugin/settings.json",
"setting_sources": ["user", "project", "local"],
"include_partial_messages": True
}
options = ClaudeAgentOptions(**options_dict)

# This times out after 65 seconds in SDK 0.1.45+
async for message in query(prompt="Hello", options=options):
print(message)
break

asyncio.run(test())
```

**settings.json file in plugin**

```
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"defaultMode": "dontAsk",
"additionalDirectories": [""],
"allow": [
"Skill",
"Read()",
"Read(/**)",
"Write(/**)",
"Edit(/**)"
],
"deny": ["Bash"]
},
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "",
"ANTHROPIC_MODEL": "",
"ENABLE_TEMPLATE_VALIDATION": "true"
}
}
```

**Error stack trace:**

```
Traceback (most recent call last):
File "claude_agent_sdk/_internal/query.py", line 407, in _send_control_request
await event.wait()
File "anyio/_backends/_asyncio.py", line 1804, in wait
await self._event.wait()
asyncio.exceptions.CancelledError: Cancelled via cancel scope; reason: deadline exceeded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "claude_agent_sdk/_internal/query.py", line 406, in _send_control_request
with anyio.fail_after(timeout):
TimeoutError

The above exception was the direct cause of the following exception:

File "claude_agent_sdk/_internal/query.py", line 420, in _send_control_request
raise Exception(f"Control request timeout: {request.get('subtype')}") from e
Exception: Control request timeout: initialize
```

**Notes:**

1. Please investigate the control protocol timeout in Claude CLI 2.1.63+ during plugin initialization. The hardcoded 65-second timeout in _send_control_request() is being exceeded.
2. My custom plugin is having only skill and the directory_path contains 0 files

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.