anthropics / anthropics/claude-agent-sdk-typescript

Intermittent Ripgrep failure causes delays and undiscovered slash commands

Aperta
#86 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Shell
Stelle
1.8k
Fork
226
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When starting the Claude Agent SDK, the built-in ripgrep “first use test” sometimes times out after ~21s. Those runs log `rg error (signal=undefined, code=ABORT_ERR, stderr: )` followed by `Ripgrep first use test: FAILED`. Slash commands defined in local files are not found and missing in the `system` message. Re-running the exact same command right after later usually succeeds, so the failure is timing related.

## Environment

SDK: 0.1.47 (also tested with 0.1.59 and seeing the same issue)
Ripgrep binary used: `@anthropic-ai/claude-agent-sdk/vendor/ripgrep/arm64-linux/rg`
Host: docker
Size of `projects/` folder in `.claude-config`: 4MB

## Expected Result
The ripgrep self-test should complete reliably, reporting `Ripgrep first use test: PASSED`. All slash commands are listed in the `system` message.

## Actual Result
Sometimes Ripgrep first use test fails, apparently timing out after 21 seconds. When this happens, the `system` message is missing the slash commands that are defined in the local filesystem.
This does not happen all the time, it seems to only happen when the system is cold. If I call `query` again right after it would usually pass as in the `Expected Result` above. I wonder if this could be linked to large conversation history, as starting from a fresh `.claude-config/` folder seems to fix the issue.

Logs:
```
2025-12-01T22:20:58.011Z [DEBUG] [LSP MANAGER] initializeLspServerManager() called
2025-12-01T22:20:58.012Z [DEBUG] [LSP MANAGER] Created manager instance, state=pending
2025-12-01T22:20:58.013Z [DEBUG] [LSP MANAGER] Starting async initialization (generation 1)
2025-12-01T22:20:58.014Z [DEBUG] [LSP SERVER MANAGER] initialize() called
2025-12-01T22:20:58.014Z [DEBUG] [LSP SERVER MANAGER] Calling getAllLspServers()
...
2025-12-01T22:20:58.356Z [DEBUG] getSkillsIfEnabled returning: 0 skill dir commands, 0 plugin skills
2025-12-01T22:20:58.357Z [DEBUG] Total plugin agents loaded: 0
2025-12-01T22:21:19.401Z [DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results
2025-12-01T22:21:19.404Z [ERROR] AbortError: AbortError: The operation was aborted
at abortChildProcess (node:child_process:725:27)
at EventTarget.onAbortListener (node:child_process:795:7)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:831:20)
at EventTarget.dispatchEvent (node:internal/event_target:766:26)
at abortSignal (node:internal/abort_controller:370:10)
at AbortController.abort (node:internal/abort_controller:392:5)
at Timeout._onTimeout (file:///app/node_modules/@anthropic-ai/claude-agent-sdk/cli.js:3867:1784)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
2025-12-01T22:21:19.450Z [DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results
2025-12-01T22:21:19.452Z [ERROR] AbortError: AbortError: The operation was aborted
at abortChildProcess (node:child_process:725:27)
at EventTarget.onAbortListener (node:child_process:795:7)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:831:20)
at EventTarget.dispatchEvent (node:internal/event_target:766:26)
at abortSignal (node:internal/abort_controller:370:10)
at AbortController.abort (node:internal/abort_controller:392:5)
at Timeout._onTimeout (file:///app/node_modules/@anthropic-ai/claude-agent-sdk/cli.js:4372:6029)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
2025-12-01T22:21:19.484Z [DEBUG] Ripgrep first use test: FAILED (mode=builtin, path=/app/node_modules/@anthropic-ai/claude-agent-sdk/vendor/ripgrep/arm64-linux/rg)
2025-12-01T22:21:19.485Z [DEBUG] Total LSP servers loaded: 0
2025-12-01T22:21:19.486Z [DEBUG] [LSP SERVER MANAGER] getAllLspServers returned 0 server(s)
2025-12-01T22:21:19.486Z [DEBUG] LSP manager initialized with 0 servers
2025-12-01T22:21:19.487Z [DEBUG] LSP server manager initialized successfully
2025-12-01T22:21:19.487Z [DEBUG] LSP notification handlers registered successfully for all 0 server(s)
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.