Skip to content

[aw-failures] [P1] Codex context-rebuild circuit breaker kills already-completed runs (Sub-Issue Closer, Metrics Collector) #55976

Description

@github-actions

Fix the codex-harness circuit-breaker false-positive — it kills runs that already finished successfully, burning ~19 minutes and ~1.5M tokens each time.

Problem statement

Codex-engine workflows are being SIGTERM'd by the codex-harness "context-rebuild circuit breaker" after they've already emitted a terminal safe-output. The guard fires once rebuild_factor crosses 25 and cumulative_input_tokens crosses 1,000,000, then forces exit code 1 and a synthetic report_incomplete — even when the task logically completed.

Affected workflows and run IDs

  • Sub-Issue Closer§32937867689rebuild_factor=25.06 cumulative_input_tokens=1,195,375
  • Metrics Collector§32924199594rebuild_factor=26.23 cumulative_input_tokens=1,537,802. This run had already called safeoutputs noop ("Metrics collection complete: 117 workflows analyzed...") ~6 seconds before the guard fired — proof the task was already done when the breaker killed it.

Probable root cause

The circuit breaker (pollIntervalMs=15000) evaluates independently of task-completion signals. It doesn't check outputs.jsonl for a terminal safe-output entry before deciding to SIGTERM, so a Codex process that finished its work but is slow to exit gets treated identically to a genuinely runaway one.

Proposed remediation

  • Before firing, check outputs.jsonl for a terminal entry (noop/create_issue/report_incomplete/etc.); if one exists, let the process exit normally instead of forcing report_incomplete.
  • Alternatively, add a short grace period after the last successful tool call before evaluating the breaker — both failures show tool calls succeeding right up to the kill.

Success criteria

  • A run that calls a terminal safe-output before crossing the rebuild-factor threshold completes with that safe-output's real result, not a synthetic report_incomplete.
  • No further "circuit breaker tripped" occurrences for Sub-Issue Closer or Metrics Collector across 3 consecutive scheduled runs.

Parent report: #55859
Related to #55859
Related to #55859

Generated by 🔍 [aw] Failure Investigator (6h) · claude · agent · 203.7 AIC · ⌖ 7.01 AIC · ⊞ 6.4K ·

  • expires on Sep 1, 2026, 11:20 PM UTC-08:00

Update — 2026-08-26 19:27 UTC (new workflow hit by the same circuit breaker)

Widen the allow-list or fix the token-accounting bug in the Codex context-rebuild circuit breaker — it just killed a third workflow. The Daily Repository Chronicle §32986228675 hit the identical trip condition already tracked here for Sub-Issue Closer and Metrics Collector:

report_incomplete: {"reason":"infrastructure_error","details":"context-rebuild circuit breaker tripped: rebuild_factor=25.61 cumulative_input_tokens=1171835 thresholds=25/1000000"}

Same signature, same rebuild_factor order of magnitude (~25x), same self-reported infrastructure_error — this is not workflow-specific, it is systemic to any Codex run that accumulates large context via repeated tool calls (chart generation + asset upload, in this case).

Action: raise the rebuild_factor threshold or fix whatever causes cumulative_input_tokens to balloon 25x above budget before the breaker should trip — do this once at the circuit-breaker level, not per-workflow.

Affected workflows so far: Sub-Issue Closer, Metrics Collector, The Daily Repository Chronicle (§32986228675).

Generated by 🔍 [aw] Failure Investigator (6h) · claude · agent · 118.5 AIC · ⌖ 8.32 AIC · ⊞ 6.4K ·

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions