feat: add default codex_harness.cjs with retry logic for Codex engine#30035
feat: add default codex_harness.cjs with retry logic for Codex engine#30035
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/077a8df8-9e25-4907-9907-780673f9e699 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…s harness branch Agent-Logs-Url: https://github.com/github/gh-aw/sessions/077a8df8-9e25-4907-9907-780673f9e699 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a default Node.js harness for the Codex engine to provide retry behavior on transient OpenAI failures, and updates Codex execution to route prompts via --prompt-file instead of $INSTRUCTION.
Changes:
- Added
codex_harness.cjsand unit tests to wrapcodex execwith retry logic and prompt-file handling. - Updated Codex engine execution to invoke the harness via Node runtime resolution and pass
--prompt-file. - Updated Go/unit tests and recompiled workflow lock files to reflect the new harness-based invocation.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/codex_harness.cjs |
New Codex CLI harness implementing prompt-file resolution + retry/backoff. |
actions/setup/js/codex_harness.test.cjs |
Unit tests for prompt-file resolution, error detection, and retry policy. |
pkg/workflow/codex_engine.go |
Uses the harness (default or overridden) and passes --prompt-file to it. |
pkg/workflow/codex_engine_test.go |
Adds tests asserting harness usage, default name, and override behavior. |
pkg/workflow/engine_agent_import_test.go |
Updates expectations from $INSTRUCTION to --prompt-file for Codex steps. |
pkg/workflow/engine_args_test.go |
Updates args-position assertions to key off --prompt-file. |
.github/workflows/schema-feature-coverage.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/issue-arborist.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/grumpy-reviewer.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/duplicate-code-detector.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/codex-github-remote-mcp-test.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/changeset.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
.github/workflows/ai-moderator.lock.yml |
Lockfile reflects Codex harness invocation + --prompt-file. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 13/13 changed files
- Comments generated: 2
| * - Rate-limit errors (HTTP 429 / "rate_limit_exceeded") and server errors (HTTP 429, | ||
| * 500, 503) are well-known transient failure modes and are logged explicitly, but | ||
| * any partial-execution failure is retried — not just those specific errors. |
| // prompt via --prompt-file. The else branch is retained as a fallback in case the harness | ||
| // is explicitly disabled in the future (e.g. engine.harness overrides that clear the name). |
…retry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Commit pushed:
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (144 new lines in AI has analyzed the PR diff and generated a draft ADR to help you get started: 📄 Draft ADR: What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. Decision Summary Inferred from DiffThe draft ADR captures the following decision:
Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
References: §25295059484
|
|
test comment
|
|
@copilot review all comments |
…ne.go Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5532dd6a-7ab1-4160-ab45-0a18bd34369a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed both review comments in b3b6b00:
|
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧 |
|
|
Agent Container Tool Check
Result: 11/12 tools available Overall Status: FAIL —
|
|
Codex smoke: FAIL Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "ab.chatgpt.com"
- "accounts.google.com"
- "android.clients.google.com"
- "chatgpt.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment. Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "ab.chatgpt.com"
- "accounts.google.com"
- "android.clients.google.com"
- "chatgpt.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
|
|
UGH! Smoke test caveman was here! Me test things. Things work! Cave fire still burn! 🔥 Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment. Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
|
There was a problem hiding this comment.
Ugh. Me review code. Me like retry logic and exponential backoff. Code look good to cave dweller!
Warning
Firewall blocked 6 domains
The following domains were blocked by the firewall during workflow execution:
accounts.google.comandroid.clients.google.comclients2.google.comcontentautofill.googleapis.comsafebrowsingohttpgateway.googleapis.comwww.google.com
To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:
network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
📰 BREAKING: Report filed by Smoke Copilot · ● 1.3M
| * - If the process produced no output (failed to start / auth error before any work), the | ||
| * driver does not retry because there is nothing to resume. | ||
| * - Retries use exponential backoff: 5s → 10s → 20s (capped at 60s). | ||
| * - Maximum 3 retry attempts after the initial run. |
There was a problem hiding this comment.
Me like retry logic! Three retry max good number. But maybe log retry count so cave dwellers can see how many times it tried?
| } = require("./awf_reflect.cjs"); | ||
|
|
||
| // Maximum number of retry attempts after the initial run | ||
| const MAX_RETRIES = 3; |
There was a problem hiding this comment.
MAX_RETRIES = 3 is good! Cave math: 1 + 3 = 4 total tries. Exponential backoff protect from rate limits. Me approve!
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Commit pushed:
|
Summary
Adds a default agent harness for the OpenAI Codex engine, following the established pattern of
copilot_harness.cjsandclaude_harness.cjs.Changes
New files
actions/setup/js/codex_harness.cjs— Wrapscodex execwith retry logic for transient OpenAI API errors (rate limits, server errors). Reads the prompt via--prompt-file(a harness-only flag) and passes content as the last positional arg tocodex exec. Since Codex has no--continuefor session resumption, all retries are fresh runs with exponential backoff (max 3 retries, 5s→60s).actions/setup/js/codex_harness.test.cjs— 23 unit tests covering prompt file resolution, error pattern detection, and retry policy.Modified files
pkg/workflow/codex_engine.go— AddedGetHarnessScriptName()returning"codex_harness.cjs"(implementsHarnessProviderinterface). UpdatedGetExecutionSteps()to use the harness vianodeRuntimeResolutionCommand, passing--prompt-fileinstead of the previous shell$INSTRUCTIONvariable.pkg/workflow/codex_engine_test.go— Three new tests:TestCodexEngineGetHarnessScriptName,TestCodexEngineExecutionUsesHarness,TestCodexEngineExecutionCustomHarness.pkg/workflow/engine_agent_import_test.go,pkg/workflow/engine_args_test.go— Updated existing tests to expect--prompt-fileinstead of$INSTRUCTION.Retry policy
--continuesupport — all retries are fresh runsChangeset
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
ab.chatgpt.comchatgpt.comSee Network Configuration for more information.