Skip to content

fix: do not count timed-wait runs toward max_runs - #299

Merged
popodidi merged 1 commit into
mainfrom
axe/task-2549--work
Dec 3, 2026
Merged

popodidi merged 1 commit into
mainfrom
axe/task-2549--work

Conversation

@popodidi

@popodidi popodidi commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Task 2549. A task that waits daily (axe task wait --until/--for) was escalated for max_runs from idle waits alone (pilots: axe-joyce task 1, axe-hao task 7).

Which runs count

  • runs is counted at claim (crates/axe-core/src/db.rs, claim_in), where max_runs escalates.
  • New in the post-run policy (crates/axe-core/src/task_policy.rs, finish): a run that exits 0, not aborted, drained or on an API outage, and leaves its task pending on a wake time its own session set during that run, is refunded (db::refund_run) with a runs event saying why.
  • Still counted: crashes and nonzero exits (even after a wait), runs ending done, escalated, wait --on, or handed back pending without a wake time.

Test: crates/axe/tests/wait_runs.rs drives claim/prepare/started/finish through remote::operation; time passes by moving not_before, with no sleeps. 9 wait cycles at max_runs = 3 stay at 0 runs; crash-after-wait and no-wait runs escalate at 3. The first test fails on main.

Docs: docs/user/concepts/architecture.md (When the node escalates).

No schema change.

🤖 Generated with Claude Code

A run that exits cleanly after its own axe task wait --until/--for is
refunded in the post-run policy, so a task that waits daily never hits
max_runs. Crashes, failures, aborts, drains and runs ending any other
way still count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@popodidi
popodidi merged commit 830206b into main Dec 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant