Skip to content

Recover from temporary Harness service failures within a bounded retry budget #584

Open

Description

@JacobStephens2

This was generated by AI during triage.

Problem

The Spec run on #427 completed 13 of 17 Tickets but failed when #544's conflict Repair hit a temporary service failure. Ticket PR #582 had passed CI, then needed another merge because the Spec branch moved. During Repair 1, Codex reported repeated HTTP 503 errors, fell back from WebSockets to HTTPS, and ended with “Selected model is at capacity. Please try a different model.” thirdshift propagated the session failure and ended the Ticket's Run.

Existing Resume behavior handles a session ending with background work still running. It does not recover from capacity failures. Failed work is already preserved, and Continuations already pick it up; this proposal builds on those contracts.

Proposed behavior

  • Recognize a narrow set of temporary Harness service failures, including the observed capacity failure, and retry with increasing delays.
  • Give service recovery its own attempt and elapsed-time budget, separate from the Repair cap.
  • Preserve the checkout, edits, and logs across attempts. Continue the recorded session where the Harness supports it; any recovery without session continuation must account for existing work and partially completed operations.
  • Keep the chosen Harness and Model by default. Any Model fallback is an explicit operator configuration.
  • Make recovery attempts and budget exhaustion visible in progress, logs, and the final notification.
  • When the budget is exhausted, take the existing Failed run preservation path with the underlying cause.

Decisions needed

  • Which structured Harness errors qualify, and what narrowly defined fallback classification is needed where structured codes are unavailable?
  • What are the default attempt, delay, and total-time limits?
  • What is the recovery contract when a conversation cannot be resumed or an operation's completion is uncertain?
  • Should optional Model fallback be included here or handled separately?

Validation targets

  • A temporary failure followed by recovery can finish the same logical session and Delivery without losing prior work.
  • Repeated temporary failures stop within the configured budget and retain the causal error and each attempt's log.
  • Recovery consumes no additional Repair slots.
  • Command interruption cancels waits and prevents further attempts.
  • Refusals, invalid configuration, and ordinary implementation failures do not qualify for temporary-service retries.
  • Retrying does not blindly repeat external mutations or treat an incomplete session as successful.

Scope

Recovery within an already authorized Command. No new daemon, automatic retries of failed issues on later scheduled passes, or changes to review and merge requirements.

Evidence

Activity

  1. added
    enhancement
    needs-triage
    on Oct 9, 2026
  2. added
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  3. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    The retry gap remains on Base commit 9eea88c (main). Recommend keeping #584 open for Day shift decisions and a Spec split.

    Confirmed evidence:

    • src/session.rs:370–403 propagates the first session failure before reaching the background-work Resume policy. Passing session tests confirm an ordinary failure gets no retry.
    • src/harness/interpretation/event.rs:153 and event_tests.rs already classify the exact reported capacity message, overload, HTTP 503 and 529 as rate_limit for reporting. This broad classification is not a sufficient retry contract: it also covers other rate-limit messages, and intermediate errors can recover within the Harness.
    • src/harness/interpretation.rs:192 retains SessionFailure diagnostics, session_id and before_first_turn. These provide useful recovery evidence, but no typed temporary-service eligibility or operation-reconciliation contract.
    • The passing tests/codex_sessions.rs failure regression confirms terminal failures and unsuccessful exits stop the Run after one Codex call.
    • src/session.rs:155, src/logs/owner.rs:48 and src/session/trace.rs:91 show that repeating the same session token would reuse paths opened with File::create. Recovery needs distinct attempt identities to retain traces and associated evidence.
    • src/delivery/repair_loop.rs:205 counts each Repair before starting its session. Service retries should remain inside that logical session rather than requesting another Repair.
    • src/delivery.rs:817 supplies the existing failure-preservation path. ADR 0002 defines Continuation from preserved branch work; it does not make external mutations safe to repeat. src/process.rs provides interruptible retry waits.

    Open #1546 covers optional Model/Harness fallback; #583 concerns subscription routing. Neither replaces bounded recovery with the chosen Harness and Model. Keep fallback outside #584 and coordinate its scope with #1546. Preserve ADR 0021's existing Security review fallback rules and refusal exclusions.

    Recommended next steps

    Resolve the questionnaire, then shape a Spec with dependent Tickets delivering: (1) narrow terminal classification and bounded pre-work retries, including unique attempt evidence; (2) continuation after partial work with explicit reconciliation and conservative failure when continuation is unsafe; (3) agreed additional Harness/Step coverage and final integration. Each Ticket should include its own progress reporting and regression coverage.

    Acceptance must cover recovery to Delivery, finite exhaustion with the causal error retained, interruption, unchanged Repair accounting, interaction with background-work Resume, preserved edits and attempt logs, and exclusion of configuration, authentication, quota, refusal and ordinary implementation failures. A recovered intermediate error must not trigger another attempt. Incomplete work must never become success. Update glossary/configuration guidance, generated manual sources and relevant hand-written site pages with the final behavior.

    The original #544 incident remains supplied issue evidence: its historical logs are outside this worktree and were not inspected. No live provider outage was induced.

    Questionnaire

    For the Day shift deciding #584: investigation confirms that terminal Harness failures still stop the Run, while capacity/503 reporting, failure preservation and background-work Resume already exist. The following decisions are needed before unattended implementation.

    1. Approve the proposed Spec split: terminal classification plus bounded pre-work recovery; safe continuation after partial work, blocked by the first Ticket; then additional Harness/Step coverage and integration. Which Harnesses and session purposes must the first release support? This sets the implementation boundary, including whether private Eval sessions participate.
    2. Should initial eligibility be restricted to terminal capacity/overload failures and narrowly identified HTTP 503/529 failures? Specify whether HTTP 429, other 5xx responses or transport disconnects qualify. Recommend excluding authentication, invalid configuration, quota exhaustion, refusals, OOM and ordinary implementation failures. This defines the causal allowlist rather than reusing the broad reporting category.
    3. Choose the maximum additional attempts, increasing delays and delay cap, total elapsed limit, and whether the budget belongs to each logical session or the whole Command. Does elapsed time include Harness-native retries and active attempts, and must an active attempt be cancelled at the deadline? This makes the promised bound testable.
    4. Approve continuation on the recorded session ID with reconciliation of prior work. When the ID is missing or rejected, or an external operation's completion remains uncertain, should recovery preserve the work and fail, permitting a fresh conversation only when no work was observed? Specify any allowed alternative and its reconciliation requirements.
    5. Keep optional Model/Harness fallback solely in add fallback model setting for provider issues, like codex model at capacity #1546, with Recover from temporary Harness service failures within a bounded retry budget #584 retaining its resolved choice and ADR 0021's existing Security review behavior? This prevents overlapping retry and fallback policies.
  4. added
    ready-for-human
    and removed
    in-progress
    on Nov 10, 2026
  5. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation of #1546 against Base 0009a53 confirms that capacity/overload/503/529 already normalize to rate_limit events (src/harness/interpretation/event.rs:154; focused test passed), while ordinary session failures still propagate through src/session.rs:370. Existing switching is limited to eligible Security-review startup failures. Recommend coordinating #584's recovery budget with #1546's explicit fallback targets and handoff contract, keeping authentication and safeguard refusals distinct from temporary-service retries.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions