fix(codex): normalize native command exit status#88336
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 29, 2026, 4:40 PM ET / 20:40 UTC. Summary PR surface: Source +15, Tests +36. Total +51 across 2 files. Reproducibility: yes. at source level: current main maps failed Codex commandExecution items into mutating lastToolError, and the payload path can surface that as a visible warning. I did not establish a fresh live Telegram or Discord reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Narrow completion to explicit expected-negative search outcomes or a maintainer-approved Codex-native taxonomy, keep generic failures visible, and require redacted live channel or runtime-log proof before merge. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main maps failed Codex commandExecution items into mutating lastToolError, and the payload path can surface that as a visible warning. I did not establish a fresh live Telegram or Discord reproduction in this read-only review. Is this the best way to solve the issue? No: the live diff normalizes all numeric failed command exits except 126/127, while the safer shape is the PR body's narrower expected no-match search policy or a maintainer-approved taxonomy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 15de9d881a84. Label changesLabel justifications:
Evidence reviewedPR surface: Source +15, Tests +36. Total +51 across 2 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
|
I like the direction for the grep/no-match case, but the current predicate feels too broad. |
|
@byungskers thanks for calling this out. The PR is treating too much as completed, because it reclassified every failed Codex native I've tried narrower shapes but none of them seem really convincing:
The last option is the current I am considering.
|
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
grep/rgcommands and grep/rg pipeline segments withexitCode: 1are completed tool results instead oflastToolErrorwarnings.exitCode: 1native command failures visible, including chained grep/rg commands and shell-wrapped search commands, until maintainers define a broader Codex-native failure taxonomy.127.Fixes #88332.
Refs #87610.
Refs #85310.
Scope note
This could later be enlarged to Codex parsed command actions with
type: "search"or a broader search-command taxonomy, but this PR intentionally stays conservative and only handles directgrep/rgcommands plus grep/rg pipeline segments. Semicolon and logical-command chains stay visible as failures.Real behavior proof
Behavior addressed: Codex-native grep/rg no-match command status projection no longer turns expected search misses into channel-visible OpenClaw failed-tool warnings.
Real environment tested: local source checkout only; no live Telegram or Discord run.
Exact steps or command run after this patch:
git diff --check;OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/codex/src/app-server/event-projector.test.ts -- --reporter=verbose -t 'grep no-match|chained grep|generic exit 1|shell-wrapped search|streamed command output'Evidence after fix:
git diff --checkpassed; the focused projector test selection passed with 6 tests run and 73 skipped.Observed result after fix: Direct
grep/rgcommands and grep/rg pipeline segments withexitCode: 1are completed tool results withoutlastToolError; generic exit-1 failures, chained grep/rg commands, and shell-wrapped search commands still surface as failed native tool errors; exit code127remains a failed native tool error.What was not tested: Per maintainer instruction for this machine, I did not run the full OpenClaw test suite or live channel E2E because broad test runs can freeze this computer.
Verification
git diff --checkOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/codex/src/app-server/event-projector.test.ts -- --reporter=verbose -t 'grep no-match|chained grep|generic exit 1|shell-wrapped search|streamed command output'Not run: