# A failed agent run leaves a task timer stuck for days

**URL:** <https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45>\
**Category:** Troubleshooting\
**Tags:** agent, automations, scheduling, sessions, troubleshooting\
**Created:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45 "2026-09-14T22:30:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/1 "2026-09-14T22:30:47Z")

</div>

> **Adapted community discussion:** Paraphrased and condensed from an anonymized public OpenClaw Discord support conversation from August 2026. Technical guidance was reviewed for OpenClaw 2026.9.3.

One of my agent runs failed before replying, but its timer still looks active. `openclaw tasks audit` shows one TaskFlow and one task stuck in `running` for nearly eight days, plus older terminal warnings.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/2 "2026-09-14T22:30:48Z")

</div>

The audit confirms stale ledger state, not useful model work. Use full IDs, cancel only genuinely running items, then preview reconciliation:

```bash
openclaw tasks list --status running --json
openclaw tasks show <full-task-id> --json
openclaw tasks maintenance --json

```

If the preview targets the stale records, apply it and audit again. Terminal `timed_out` or `lost` history does not need cancellation.

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/3 "2026-09-14T22:30:48Z")

</div>

I cancelled the TaskFlow. The remaining running task says its subagent cannot be found, including when I try to cancel it in the UI.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/4 "2026-09-14T22:30:48Z")

</div>

That means the task record remains while its child runtime is gone. Run maintenance first. If it identifies one orphaned child session, use the supported session lifecycle command with a dry run before applying it. Do not edit the task or session database directly.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/5 "2026-09-14T22:30:48Z")

</div>

Preview deletion of the exact orphaned session first. If the dry run targets only that child, apply it, run task maintenance, and audit again. Do not delete unrelated sessions or edit the database directly.

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/6 "2026-09-14T22:30:48Z")

</div>

The session deletion dry run showed exactly the orphaned child, so I applied it. The next task audit reports zero errors. The formerly running task is now terminal `lost`, and only historical warnings remain.

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/7 "2026-09-14T22:30:48Z")

</div>

The timer is fixed, but new runs still fail before replying. A fresh log later shows the OpenRouter model returning a rate-limit error.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:30pm UTC](https://community.openclaw.ai/t/a-failed-agent-run-leaves-a-task-timer-stuck-for-days/45/8 "2026-09-14T22:30:48Z")

</div>

That is a separate provider problem. The stale-task cleanup succeeded; the new failures need a provider with available quota or a fallback route. Keeping those diagnoses separate prevents unnecessary session deletion when the actual error is an HTTP 429.
