anthropics / anthropics/claude-code

[BUG] Scheduled tasks in Claude Code Desktop can become stuck indefinitely, with no automatic recovery

Aperta
#93,948 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:routines bug platform:windows
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### 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?

A scheduled/automated task got stuck mid-execution multiple times, blocking all subsequent runs of the same task until manually restarted. No automatic timeout or recovery occurred.

Reproductions:
1. Session local_6eb3bd6d — task "redaction-pilier-ia" stuck, required manual completion. Automated pipeline failed twice on the same run.
2. Session local_63a00752 — task "redaction-conciergerie" stuck for approximately 27 minutes (17:43-18:10 local time) on a pull request whose title ("Ne pas traiter" / "Do not process") appears to have caused the agent to hesitate indefinitely rather than skip or fail cleanly.

### What Should Happen?

Scheduled tasks should have a timeout or automatic recovery mechanism so they cannot remain stuck indefinitely without any user-visible error or automatic retry. An automatic timeout should either fail the task cleanly or trigger something equivalent to stop_session after a defined period of inactivity, rather than requiring manual detection and intervention.

### Error Messages/Logs

```shell
No error was surfaced. The task simply stopped progressing with no error message, no timeout, and no automatic recovery — the stuck state was only noticed manually.
```

### Steps to Reproduce

1. Set up several scheduled automation tasks running in parallel (e.g. redaction-branding, redaction-conciergerie, redaction-pilier-ia, controle-qualite-branding).
2. Let one of these tasks run against a pull request or input with an ambiguous/unusual title (e.g. "Ne pas traiter" / "Do not process").
3. Observe that under this condition, the agent can hesitate indefinitely instead of skipping or failing cleanly, leaving the task stuck with no progress.
4. Note that calling stop_session on the stuck session unblocks it, but nothing does this automatically.

### Claude Model

Sonnet (default)

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

Version 1.52386.3 (41896e)

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

This occurs specifically with scheduled/background tasks running unattended (no active user watching the session), which likely explains why the stuck state went unnoticed for an extended period.

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.