Problem
The taskrunner's mark_completed() Python code correctly classifies max_turns_exceeded failures (line 262-263), but if the consuming API runs its own classifier (as AEGIS does in task-intelligence.ts), the max_turns pattern may not be recognized.
In AEGIS, max_turns_exceeded tasks were being re-classified as completion_signal_missing (non-retryable) because the server-side classifier didn't check for max_turns/error_max_turns/ran out of turns patterns before falling through to the exit code 3 catch-all.
This was the #1 failure mode (14 failures in 7 days).
Recommendation
If cc-taskrunner ships a reference classifier (or if consumers are expected to build their own), document the max_turns_exceeded pattern as a distinct, retryable failure kind that should be checked before completion_signal_missing.
Key patterns to detect:
max_turns in result text
error_max_turns in result text (from Claude JSON output)
ran out of turns in result text
Tasks that hit max_turns but created PRs (detectable via [TASKRUNNER] PR: in result) are especially likely to be successful despite the failure classification.
Ref
Applied in Stackbilt-dev/aegis commits f842b89 (classification) and the AEGIS task-intelligence.ts module.
Problem
The taskrunner's
mark_completed()Python code correctly classifiesmax_turns_exceededfailures (line 262-263), but if the consuming API runs its own classifier (as AEGIS does intask-intelligence.ts), themax_turnspattern may not be recognized.In AEGIS,
max_turns_exceededtasks were being re-classified ascompletion_signal_missing(non-retryable) because the server-side classifier didn't check formax_turns/error_max_turns/ran out of turnspatterns before falling through to the exit code 3 catch-all.This was the #1 failure mode (14 failures in 7 days).
Recommendation
If cc-taskrunner ships a reference classifier (or if consumers are expected to build their own), document the
max_turns_exceededpattern as a distinct, retryable failure kind that should be checked beforecompletion_signal_missing.Key patterns to detect:
max_turnsin result texterror_max_turnsin result text (from Claude JSON output)ran out of turnsin result textTasks that hit max_turns but created PRs (detectable via
[TASKRUNNER] PR:in result) are especially likely to be successful despite the failure classification.Ref
Applied in Stackbilt-dev/aegis commits
f842b89(classification) and the AEGIStask-intelligence.tsmodule.