Skip to content

Remediate Codex budget and workflow failure boundaries - #75491

Merged
pelikhan merged 10 commits into
mainfrom
pelikhan/purelock-codex-failure
Nov 7, 2026
Merged

pelikhan merged 10 commits into
mainfrom
pelikhan/purelock-codex-failure

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Why

Four scheduled workflows failed at Execute Codex CLI, but the symptom cluster contained three distinct failure paths: PureLock exhausted its shared AWF invocation budget and retried a generic terminal 429; Advisor and Enforcer rejected unverifiable child-model endpoint metadata before spawning Codex; Storify terminated after a canceled fleet-log request left a stale MCP watchdog entry.

Approach

  • Detect exhausted shared invocation budgets using fresh AWF reflection only after a captured native terminal rate-limit event. Stop futile retries, while preserving transient retries when counter evidence is missing and successful completion when expected safe outputs already exist. Add regression coverage for counter validation, unavailable reflection, quoted tool output, and completed outputs.
  • Reduce PureLock from three parallel writers to one focused candidate and child under the unchanged enforced 60-invocation cap. Child-call limits and the parent validation reserve are prompt bounds, not additional runtime enforcement.
  • Remove five small helper overrides in Advisor and Enforcer so helpers inherit their configured main model. Preserve fail-closed validation for different models and test the authored workflows through native role generation. Inheritance may cost more per helper call than a verified small model.
  • Make Storify consume cached fleet evidence, disclose incomplete coverage, and use at most three bounded representative audits instead of redundant fleet refetching. Retire the obsolete refetch experiment prospectively without rewriting historical results. The original cancellation's underlying cause and the generic missing-terminal-event watchdog behavior remain unresolved.

Regenerate the four production locks and update shared-budget documentation and the patch release note. Credentials, network allowances, sandbox controls, admission, detection, and publication limits remain unchanged.

Validation

  • make fmt-cjs and make lint-cjs passed, with existing lint warnings.
  • npm --prefix actions/setup/js run test:js -- codex_harness.test.cjs awf_reflect.test.cjs engine_subagent_models.test.cjs harness_retry_runner.test.cjs: 473 tests passed.
  • npm --prefix actions/setup/js run typecheck passed.
  • make recompile: 359/359 workflows compiled. One-shot compilation with the matching repository CLI and final make agent-report-progress passed, including impacted tests and lock drift checks.
  • Native shellcheck checked 279 generated Bash steps with zero findings. A single read-only security reviewer approved the source and generated production locks; no confirmed vulnerabilities found.

Validation limitations: the installed gh-aw 1.0.1 compile-only dry-run failed before emitting locks because its schema does not support the current protected_files configuration. No protection was removed to bypass this. Installed actionlint is not clean because it lacks current GitHub syntax support: 43 baseline versus 34 current findings, with zero added finding identities or counts.

No workflows were dispatched or rerun. Live recovery is unverified; this PR does not rewrite prior runs or results.

Investigation references

PureLock 42217846868, Advisor 42202615775, Enforcer 42209909525, and Storify 42183743344. Raw prompts and execution evidence remain private.

Stop futile retries after fresh AWF evidence confirms the shared invocation cap. Bound PureLock to one writer, inherit verified main models for advisor/enforcer helpers, and retire Storify's redundant fleet refetch prospectively.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 6, 2026 22:19
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 22:19
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~4 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #75491

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75491

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one correctness issue: the new shared-budget detection misses stderr-only terminal 429s, allowing futile retries that consume the remaining AWF invocation budget.

Review details
  • actions/setup/js/codex_harness.cjs:1241: native rate-limit detection is derived only from captured stdout terminal events, not stderr/process output; please add stderr-only coverage and classify that path.
  • The grumpy-coder specialist pass was unavailable because its file-read attempt was rejected; this review therefore relies on the independent second pass.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread actions/setup/js/codex_harness.cjs Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd. The Codex budget fix is sound and well covered by tests, with one minor gap in terminal error capture.

📋 Key Themes & Highlights

Key Themes

  • Terminal error capture: the oversized-line prefix path skips terminalErrors, so the budget check can be missed for those lines. It fails safe to retry, so this is non-blocking.
  • Validation scope: local vitest runs were blocked by a sandbox TLS error during npm ci, so this review is static analysis plus direct checks of the budget predicate. Please run the codex_harness suite in CI.

Positive Highlights

  • ✅ exhaustedInvocationBudget rejects every malformed shape I tried (NaN, Infinity, string-typed fields, unsafe integers, arrays) and accepts only a confirmed exhausted cap.
  • ✅ The budget stop requires a fresh reflection confirmation, so a stale or failed fetch does not stop a retry.
  • ✅ Tests cover the under-cap, cap-reached, preserved-output, and quoted-429 cases with spec-style names.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread actions/setup/js/codex_harness.cjs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The harness emits a retry failure class that drops retry metadata and can report an incomplete security review as successful when the retry budget is exhausted.

4 open issues
What changed in this PR

Improves gh-aw’s Codex failure handling and adjusts four scheduled workflows to address shared-budget exhaustion, helper-model validation failures, and redundant log collection.

Changes:

  • Add fresh AWF budget checks for native terminal rate limits, with regression coverage, documentation, and a patch release note.
  • Focus PureLock on one candidate and let Advisor and Enforcer helpers inherit their main models.
  • Make Storify use cached evidence and bounded audits, retire its refetch experiment, and regenerate all four workflow locks.
File Description
docs/​src/​content/​docs/​reference/​cost-management.md Document shared invocation budgets and retry behavior.
actions/​setup/​js/​harness_retry_runner.cjs Extend attempt-result typing with native rate-limit metadata.
actions/​setup/​js/​engine_subagent_models.test.cjs Test model inheritance in authored workflow helpers.
actions/​setup/​js/​codex_harness.test.cjs Cover reflected exhaustion, retry fallback, and preserved outputs.
actions/​setup/​js/​codex_harness.cjs Detect exhausted shared budgets before retrying terminal rate limits.
actions/​setup/​js/​awf_reflect.cjs Type optional reflection budget counters.
.github/​workflows/​spec-enforcer.md Remove three helper-model overrides.
.github/​workflows/​spec-enforcer.lock.yml Refresh helper metadata and workflow hashes.
.github/​workflows/​purelock.md Limit work to one candidate with prompt-level budget bounds.
.github/​workflows/​purelock.lock.yml Synchronize the description and compiled hashes.
.github/​workflows/​daily-storify.md Require cached fleet evidence and limit representative audits.
.github/​workflows/​daily-storify.lock.yml Remove retired experiment wiring and refresh compiled metadata.
.github/​workflows/​ab-testing-advisor.md Remove two helper-model overrides.
.github/​workflows/​ab-testing-advisor.lock.yml Refresh helper metadata and workflow hashes.
.changeset/​codex-shared-invocation-cap.md Add a patch release note for budget-aware retries.

Review effort: Max (auto)

Comment thread actions/setup/js/codex_harness.cjs Resolved
Comment thread actions/setup/js/codex_harness.cjs Resolved
Comment thread .github/workflows/daily-storify.md Resolved
Comment thread .github/workflows/purelock.md Resolved
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/codex_harness.cjs:1241): The fallback never recognizes a generic 429 emitted on stderr, so the harness will still retry and consume the remaining shared AWF budget in that common failure mode. - Remediate Codex budget and workflow failure boundaries #75491 (comment)
  3. Review (actions/setup/js/codex_harness.cjs:1241): [/diagnosing-bugs] nativeTerminalRateLimitError is built only from terminalErrors, and that array is filled only from onStdoutLine. Lines over 1 MiB reach onStdoutLinePrefix instead, which calls observePrefix and never records a terminal error. For those lines the flag stays false, so the budget check is skipped and the run falls back to the existing retry path. That fails safe rather than causing a false green, so it is not blocking. - Remediate Codex budget and workflow failure boundaries #75491 (comment)

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: de31237
Sous-chef requested-work: 239472b6aa504fbe93e05b0194840fbd803070011b67ae9c608bd8cbeb71a69d 2fd26f1164023c535a7bf8a9f3d7f36d027ebf53a5ce18dab93d6c6eeb4fc566
Sous-chef requested-state: 937e795e8bae90bfa31571c3b376829520ff83f75624aeab84460a8806164715

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~12 AIC · ⌖ ~14 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

Sous-chef requested-head: de31237
Sous-chef requested-work: 239472b6aa504fbe93e05b0194840fbd803070011b67ae9c608bd8cbeb71a69d 2fd26f1164023c535a7bf8a9f3d7f36d027ebf53a5ce18dab93d6c6eeb4fc566
Sous-chef requested-state: 937e795e8bae90bfa31571c3b376829520ff83f75624aeab84460a8806164715

pelikhan and others added 2 commits November 6, 2026 18:59
Regenerate the four conflicted workflow locks from merged sources, preserving upstream routing/runtime pins and Codex remediation.

Co-authored-by: Copilot App <[email protected]>
Preserve incomplete inline review findings at the shared invocation cap, emit the canonical retry class, and verify normalization. Align PureLock with one result and remove the obsolete Storify runtime note.

Co-authored-by: Copilot App <[email protected]>
@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: No code change is needed for this informational outcome. I am treating the Ponytail no-op as a reported result, not proof that the PR's required work or publication completed.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: No additional architecture change or ADR is requested by this status comment. The review fixes preserve the existing design, and the reported no-op is not being used as validation evidence.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: The associated skills review's oversized native-error capture feedback is addressed by the runtime fixes and regression coverage. This completion notice needs no separate code change.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: The associated code-quality review's stderr-only terminal 429 feedback is addressed without promoting quoted tool output into a native error. This completion notice needs no separate code change.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: No additional test change is requested by this status comment. The actionable review fixes include focused regression coverage; the sentinel's no-op is not being treated as proof of correctness.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: No specification change is requested by this informational outcome. The implementation retains the fresh-budget and native-error provenance requirements, and the reported no-op is not being used as verification.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to this comment: The latest main was merged and pushed in 2a90f05, with the four conflicted locks regenerated from merged sources. The stderr-only and oversized terminal-error feedback is addressed in this review batch; no CI or workflow dispatch was requested or triggered.

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

I’m updating this branch from the latest main with make merge-main, resolving any lock conflicts and preserving the submitted changes. I’ll validate the merge locally; no CI or workflow will be triggered.

Sous-chef requested-head: 3a5ca0a
Sous-chef requested-work:
Sous-chef requested-state: 6a17ff954ee0cb71bb5cd9957318eaaea41531bbe4bec91fb996c79024ec1e37

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

There are no unresolved merge conflicts on this branch. The merge conflict was resolved in merge commit 07a595b, and the working tree is clean.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 07a595b
Sous-chef requested-work:
Sous-chef requested-state: fc5b08ecee137ee932bc5dd7e977491781a0df173887b86e2a3929f2ea738634

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~8 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

I’m checking this branch against the latest main and will merge it with make merge-main, resolving any conflicts while preserving the PR changes. I’ll validate locally and will not trigger CI or workflow dispatch.

Sous-chef requested-head: 07a595b
Sous-chef requested-work:
Sous-chef requested-state: fc5b08ecee137ee932bc5dd7e977491781a0df173887b86e2a3929f2ea738634

@copilot

Copilot assignment requested for the following outstanding work:...

Merged the latest main and regenerated the workflow lock after resolving the conflict. Merge commit: 4e0be17. Build, impacted tests, and all 360 workflow compilations passed; no CI or workflow dispatch was triggered.

…ex-failure

# Conflicts:
#	.github/workflows/daily-storify.lock.yml

Co-authored-by: gh-aw-bot <[email protected]>
@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

There are no unresolved merge conflicts on this branch: the working tree is clean, and MERGE_HEAD is absent. The latest main merge was already completed in commit 4e0be17.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

…ex-failure

# Conflicts:
#	.github/workflows/daily-storify.lock.yml

Co-authored-by: pelikhan <[email protected]>

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved the conflict with the newly advanced main and regenerated the daily-storify lock from the merged PR-preserving source. Merge commit: 687f20b.

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

I checked the branch again: there are no unresolved merge conflicts, the working tree is clean, and MERGE_HEAD is absent. The latest main merge remains commit 687f20b.

@pelikhan
pelikhan merged commit 92a9190 into main Nov 7, 2026
61 checks passed
@pelikhan
pelikhan deleted the pelikhan/purelock-codex-failure branch November 7, 2026 18:28
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.2

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.

4 participants