Skip to content

fix: server-side classifier should recognize max_turns_exceeded #15

@stackbilt-admin

Description

@stackbilt-admin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions