Skip to content

fix(triage): prefer Codex when both coding agents are available - #149447

Merged
steipete merged 1 commit into
mainfrom
codex/triage-prefer-codex
Sep 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/triage-prefer-codex

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Triage launches Claude Code before Codex when both coding agents are available on the machine.

User Impact

Triage now prefers Codex, followed by Claude Code, OpenCode, and Pi. Explicit --agent choices still win, and automatic recovery still prefers the configured embedded OpenClaw agent before external CLIs.

Why This Change Was Made

Reorder the existing shared external-agent list so interactive launch, automatic failure handoff, and suggested recovery commands consistently prefer Codex. Authentication, permissions, launch arguments, and failure handling retain their existing behavior.

Evidence

  • The Codex-first regression failed against the previous order, then passed after the change. The original four-file feature patch is unchanged through the final rebase, verified with git range-diff.
  • Verified the synthetic merge changes only the four triage files and preserves main's current dependency helper and fixture unchanged. This PR has no fixture repair or shared prerequisite delta.
  • Independent P0–P2 review is clean. Prior core/test typechecks, scoped lint, formatting, docs MDX, and changed-check guards passed.
  • On head a0f83fb2d396f3fd0b1d93e5beebbc5df0e16118, both focused triage suites pass all 79 cases. The required exact-head CI gate passed in run 35047543180. The latest current-head ClawSweeper review also has no actionable findings.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 15, 2026 21:32
@steipete steipete self-assigned this Sep 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: XS maintainer Maintainer-authored PR labels Sep 15, 2026
@steipete
steipete force-pushed the codex/triage-prefer-codex branch from bd55441 to c84188f Compare September 15, 2026 21:54
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 11:57 PM ET / September 16, 2026, 03:57 UTC (Revision 5).

ClawSweeper review

What this changes

Triage now prefers Codex among available external coding agents, with matching documentation and selection tests.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still prefers Claude Code, so this maintainer-sponsored change remains useful. No actionable correctness or security findings remain.

Priority: P3
Reviewed head: a0f83fb2d396f3fd0b1d93e5beebbc5df0e16118

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable change with meaningful selection coverage and successful exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Inspected selection tests and successful exact-head CI support the change; they are not claimed as a live authenticated Codex run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Inspected selection tests and successful exact-head CI support the change; they are not claimed as a live authenticated Codex run.
Evidence reviewed 7 items Introduced change and current-main comparison: The pinned introduction changes only the shared ordering plus documentation and tests. Fetched main still lists Claude before Codex; the requested default is therefore not already implemented there.
Selection and execution boundary: The command consumes the shared list, honors explicit agent selection, prefers configured embedded automatic recovery, and retains its existing final ownership checks and launch arguments. Lines 453–475 establish the affirmative Codex dependency signal: the selected route invokes the external Codex CLI.
Codex CLI contract inspected directly: The sibling checkout's cache remote resolves to openai/codex. Its exec parser accepts --skip-git-repo-check and a '-' prompt, its runtime reads that prompt from stdin, and its interactive parser accepts a positional prompt. These match OpenClaw's unchanged invocation forms.
Findings None None.
Security None None.

How this fits together

Triage collects installation diagnostics and hands a repair prompt to an available coding agent. Its shared preference list controls external-agent selection and suggested recovery commands.

flowchart TD
  A[Installation diagnostics] --> B[Triage handoff]
  C[Installed coding agents] --> B
  D[Explicit agent choice] --> B
  B --> E{Configured embedded recovery?}
  E -->|Yes| F[Embedded agent]
  E -->|No| G[Selected external agent]
  B --> H[Manual recovery command]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +3, Docs 0. Total +3 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 15 12 +3
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 18 15 +3

Review metrics

Metric Value Why it matters
Default selection 1 shared preference reordered; 0 new settings Machines with both agents now select Codex by default, while existing explicit choices remain available.

Technical review

Best possible solution:

Keep one shared preference list while preserving explicit agent selection, embedded recovery precedence, and existing execution policies.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a defect reproduction: this intentionally changes a documented preference. Current-main source confirms Claude is selected first when both agents are available.

Is this the best way to solve the issue?

Yes. Reordering the existing shared list is the narrowest implementation and avoids separate selection policies.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7815ee7330d9.

Labels

Label justifications:

  • P3: This is a bounded default-selection improvement with existing explicit-agent controls.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Inspected selection tests and successful exact-head CI support the change; they are not claimed as a live authenticated Codex run.

Evidence

What I checked:

  • Introduced change and current-main comparison: The pinned introduction changes only the shared ordering plus documentation and tests. Fetched main still lists Claude before Codex; the requested default is therefore not already implemented there. (src/commands/triage-handoff.ts:4, 7815ee7330d9)
  • Selection and execution boundary: The command consumes the shared list, honors explicit agent selection, prefers configured embedded automatic recovery, and retains its existing final ownership checks and launch arguments. Lines 453–475 establish the affirmative Codex dependency signal: the selected route invokes the external Codex CLI. (src/commands/triage.ts:255, a0f83fb2d396)
  • Codex CLI contract inspected directly: The sibling checkout's cache remote resolves to openai/codex. Its exec parser accepts --skip-git-repo-check and a '-' prompt, its runtime reads that prompt from stdin, and its interactive parser accepts a positional prompt. These match OpenClaw's unchanged invocation forms. (codex-rs/exec/src/cli.rs:31, 6b9826e3aa83)
  • Behavioral regression coverage: The recovery table checks each explicit choice with all agents available and each first-available selection. The automatic-route test preserves embedded precedence, while the subprocess case now exposes both Codex and Claude and verifies Codex arguments, target selectors, exit status, and uncertain cleanup. Tests were inspected but not executed during this read-only review. (src/commands/triage-recovery.test.ts:94, a0f83fb2d396)
  • Exact-head validation and review continuity: GitHub reports successful completion of run 35047543180 on the reviewed head. The captured PR body reports 79 focused passing cases and a failing-before/passing-after selection regression. The previous completed review on this same head contains no findings or published rank-up moves. (a0f83fb2d396)
  • Handoff history: The handoff module was added in this commit. Its raw recorded parent is 39708c6, and the comparison against that parent verifies the retained Codex command line. (src/commands/triage-handoff.ts:25, 2a1edded2a8a)

Likely related people:

  • Dallin Romney: Raw commit 2a1edde adds src/commands/triage-handoff.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a1edded2a8a; files: src/commands/triage-handoff.ts)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-15T22:13:52.140Z sha c84188fc2c19fa23c480542aaf7602c4e6d8d069 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T23:08:21.960Z sha 68473cca8c49d089e74942e379e905b980c55430 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T23:48:29.957Z sha 68473cca8c49d089e74942e379e905b980c55430 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T02:26:32.442Z sha a0f83fb :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as draft September 15, 2026 23:41
@steipete
steipete marked this pull request as ready for review September 15, 2026 23:42
@steipete
steipete force-pushed the codex/triage-prefer-codex branch from 68473cc to a0f83fb Compare September 16, 2026 02:19
@steipete
steipete merged commit 7604086 into main Sep 16, 2026
198 of 200 checks passed
@steipete
steipete deleted the codex/triage-prefer-codex branch September 16, 2026 04:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant