[Bug] Regression on 0.32.5-rc.4: Codex no-match searches (rg exit 1) are again rendered as failed — "[terminal exited: exit code: 1]" (regression of #651) · Issue #877 · spacering-net/codeg · GitHub
Skip to content

[Bug] Regression on 0.32.5-rc.4: Codex no-match searches (rg exit 1) are again rendered as failed — "[terminal exited: exit code: 1]" (regression of #651) #877

Closed

Description

@Ryn-Mic

Regression of #651 on Codeg Desktop 0.32.5-rc.4 (macOS).

Environment

  • Codeg Desktop: 0.32.5-rc.4
  • OS: macOS 27.0 (build 26A428), arm64
  • Agent: Codex via @agentclientprotocol/codex-acp 2.0.1 (@openai/codex 0.160.0)
  • Search binary: ripgrep 15.1.0 (/opt/homebrew/bin/rg)

Summary

A Codex search that legitimately finds nothing (rg exit code 1) is rendered as a failed command:

$ rg --files scripts src/grapal/phonics tests | rg 'sequence_(nested|rerank_candidate)'
[terminal exited: exit code: 1]

#651 fixed exactly this on Codeg 0.30.2 (Windows, codex-acp 1.8.0). On 0.32.5-rc.4 the failed rendering is back, so the normalization added for #651 no longer matches the records codex-acp 2.0.1 emits.

Reproduction

  1. Open any folder in Codeg and start a Codex conversation.

  2. Run a search that cannot match anything at that moment:

    rg --files scripts src/grapal/phonics tests | rg 'sequence_(nested|rerank_candidate)'

    (when this was run, none of the matching files existed yet)

  3. In a terminal the command exits 1 = "no matches", which is a normal result. Codeg shows it as failed.

Actual

[terminal exited: exit code: 1], failed styling, and the agent reads it as a broken command — it retried the same search several times in a row.

Expected

Exit code 1 from a search tool is not an error. Please show the neutral "no matches" state #651 asked for, keep the raw exit code visible, and keep failed styling only for real errors (exit code 2, stderr diagnostics).

Evidence

  1. Same command, two moments inside one Codex session (Codex rollout JSONL):

    {"exit_code": 1, "status": "failed", "aggregated_output": ""}
    {"exit_code": 0, "status": "completed", "aggregated_output": "src/grapal/phonics/sequence_rerank_candidate.py\n"}

    The only difference is whether a match existed; the command never actually errored.

  2. ripgrep's exit contract on this machine: no match → 1, match → 0, bad path → 2.

  3. The literal marker [terminal exited: is present in the Codeg binaries (Contents/MacOS/codeg and Contents/MacOS/codeg-server) and absent from the Codex binary and from the @agentclientprotocol/codex-acp package, so the failed rendering is added on the Codeg side, as Codex rg searches with no matches are rendered as failed tool calls #651 described.

  4. rg itself is healthy in this environment: command -v rg → /opt/homebrew/bin/rg, the PATH of the agent process includes /opt/homebrew/bin, and no command not found or permission error appears anywhere in the sessions. The only problem is the classification of a normal exit 1.

Scope note

This is not limited to rg. Any command with a meaningful non-zero exit (grep, diff, git diff --exit-code, test) hits the same rendering.

Suggested fix

Keep the raw ACP record unchanged and normalize only the expected no-match case: search command (rg/grep) + exit code 1 + empty output + no stderr diagnostics → neutral state, never is_error. Please re-verify against codex-acp 2.0.1, since #651's fix was verified against 1.8.0.

Upstream context: openai/codex#8268 (closed as not planned) and agentclientprotocol/codex-acp#468.

Activity

  1. xintaofei commented on Oct 2, 2026

    @xintaofei
    Collaborator

    codeg work task 276 is done — merged locally into main as 3b29d2f (6 files, +725/-8).

  2. added a commit that references this issue on Oct 2, 2026
  3. added a commit that references this issue on Oct 2, 2026
    3b29d2f
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions