Skip to content

bug: abnormal task terminations are labelled Task execution timed out after N seconds when the run never approached N #2106

Closed

Description

@AndriiPasternak31

Summary

When a scheduled task terminates abnormally, the execution is recorded with
Task execution timed out after <N> seconds, where <N> is the schedule's configured timeout —
even when the run lasted a small fraction of it. The error names a cause that did not occur.

Evidence

On one instance, of 30 executions all-time whose error begins Task execution timed out after:

Class n
genuine — duration_ms within 30 s of the configured timeout 14
mislabelled — ran nowhere near it 16

Nine of the mislabelled ran ~305 s while the error named 2700 s, 3600 s or 2400 s. Examples:

2026-08-08T06:30 | oracle-8-biotech | /resolve-backlog | ran 305 s | "timed out after 2700 seconds"
2026-08-08T04:00 | polymarket-andrii| /heartbeat --live| ran 305 s | "timed out after 3600 seconds"
2026-08-08T02:30 | cleon            | /assumption-...  | ran 310 s | "timed out after 2400 seconds"

They cluster in two windows, and in one of them five agents died at ~305 s within 20 minutes while
four other agents succeeded alongside them. 305 s is a 300-second upstream cutoff, not a schedule
timeout. One of the two windows coincides exactly with a subscription quota-exhaustion event.

Why it matters

The label determines what an operator does next, and here it points the wrong way. Acting on it
means raising timeout_seconds on schedules that have never once reached their timeout — in this
case /generate and /resolve-backlog, whose longest successful runs over 14 days were 1,947 s
and 2,383 s against a 2,700 s limit (634 runs, means of 728 s and 458 s). The change would consume
review and quota and fix nothing, while the real cause — an upstream cutoff during a quota event —
stays invisible.

It also corrupts aggregate analysis: "timeouts are our dominant failure class" was false, and only
comparing duration_ms against the configured value revealed it.

Suggested fix

Only attribute a timeout when the elapsed time actually reached the configured limit. Otherwise
record what happened — connection reset, upstream 5xx, rate-limit, cancelled — and keep the
configured timeout as context rather than as the cause. A cheap first step: include duration_ms
and the limit in the message, so ran 305s of 2700s allowed is self-evidently not a timeout.

Activity

  1. added
    status-ready
    type-bug
    priority-p2
    theme-reliability
    complexity-low
    on Aug 18, 2026
  2. AndriiPasternak31 commented on Sep 7, 2026

    @AndriiPasternak31
    ContributorAuthor

    Another instance on the ASUS instance (v0.9.5-rc2-17-ga4eebdbe, backend bind-mounted from the checkout): three schedule_executions rows for polymarket-andrii carry error = "Task execution timed out after 3600 seconds" while duration_ms ≈ 305 000 — 2026-08-08 04:00, 2026-08-15 22:55, 2026-08-17 16:00 UTC (all trading-heartbeat, schedule timeout null → 3600 s default). Either the message or the duration is wrong; the row gives no way to tell. Consistent with this issue's description.

  3. louisss1016 commented on Sep 13, 2026

    @louisss1016
    Contributor

    /claim

  4. added
    status-in-progress
    and removed
    status-ready
    on Sep 13, 2026
  5. github-actions commented on Sep 13, 2026

    @github-actions

    Claimed by @louisss1016. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/2106-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #2106
  6. added
    status-in-dev
    and removed
    status-in-progress
    on Sep 14, 2026
  7. removed
    status-in-dev
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions