fix(provider-acp): name the rejected agent path on stderr and test the bash path #18489
main fromrefs/pull/18489/head·merged by juliusmarminge View on GitHubProblem#
CI's /bin/sh is dash, which runs the EXIT trap after a failed exec. Bash does not, so the existing /bin/sh test leaves the bash path of the missing-target guard uncovered in CI. The guard on main exits 125 with empty stderr, so the user gets no reason for the exit.
Change#
The guard now prints t3-acp-cgroup-wrapper: <target>: not an executable file to stderr before exiting 125. The runtime includes captured stderr in the AcpProcessExitedError message. The exit code stays 125 for every rejected target tested, under bash and dash.
The process-tree test also runs the missing-target case under bash. It asserts status 125 and that stderr contains /nonexistent-t3-probe. It skips these assertions only when spawning bash returns ENOENT, meaning bash is not installed. It checks the target rather than the exact wording so the test covers the useful diagnostic without pinning the implementation's message text.
Scope and approval#
This follows the maintainer's invitation after #17949 closed as superseded. #15344 by @Moinax merged as f79f37a and already put the guard on main. This PR adds only the stderr message and bash assertions on top of main.
Verification#
Linux x64, Node 24, bash 5.3.9, dash 0.5.13.1.
From apps/server:
vp test run src/provider/acp/AcpSessionRuntime.processTree.test.ts
- RED, upstream main's guard with the new test: 1 failed, 22 passed, exit 1. In "contains a packaged-runtime command without requiring cgroup delegation", the bash status assertion passed; the stderr assertion failed with
expected '' to contain '/nonexistent-t3-probe'. - GREEN, this branch: 23 passed, exit 0.

The new stderr assertion fails on main's silent guard; all 23 tests pass on the branch.
$TAIL is the wrapper's last three lines, the EXIT trap, the guard and the exec, taken from main and from this branch. Temp paths are shown as $TMPDIR.
The tail probe ran each shell as <shell> -c "$TAIL" t3-acp-cgroup-wrapper <target> with stdin from /dev/null. Under bash and dash, a missing file, directory and non-executable regular file all exit 125 on both tails. Main prints nothing; the branch names each rejected target. /bin/true exits 0 with empty stderr on both tails under both shells.

Bash and dash keep the same exit codes; the branch adds stderr naming each rejected target.
Focused checks from the repository root:
vp lint packages/provider-acp/src/server/AcpSessionRuntime.ts apps/server/src/provider/acp/AcpSessionRuntime.processTree.test.ts
vp fmt --check packages/provider-acp/src/server/AcpSessionRuntime.ts apps/server/src/provider/acp/AcpSessionRuntime.processTree.test.ts
vp run knip:check
All exit 0. Lint and knip report no findings; formatting reports "All matched files use the correct format."
Both typechecks, tsc-rs --noEmit in packages/provider-acp and apps/server, exit 0.
Not checked:
- The focused test on a host whose
/bin/shis dash. Here/bin/shis bash, so dash ran only in the tail probe. CI runs the existing/bin/shcase under dash. - macOS and Windows; this wrapper runs only on Linux.
- Other bash versions or shells beyond bash and dash in the tail probe.
- A real agent startup and its displayed error, or the full test suite.
Thanks to @Moinax for #15344 and to the maintainers for inviting this follow-up.
Model and harness: Claude Opus 5.5 in Claude Code and GPT-6.1 Sol in Codex, run from T3 Code. 🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e0d311ce-133f-42c6-a5f9-51aaf5852352
📥 Commits
-
Reviewing files that changed from the base of the PR and between e688034b5f5505f92fcf1d78ba853c9c0107f9f1 and faf64f742bc9f46837034e0946148d78f7192922.
📒 Files selected for processing (2)
-
apps/server/src/provider/acp/AcpSessionRuntime.processTree.test.tspackages/provider-acp/src/server/AcpSessionRuntime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
📝 Walkthrough
-
📝 Walkthrough
-
Walkthrough#
The Linux cgroup command wrapper now reports invalid target paths to stderr before exiting with status 125. A test checks the diagnostic under Bash when available.
Changes#
Invalid target reporting
Layer / File(s) Summary Report rejected target paths
packages/provider-acp/src/server/AcpSessionRuntime.ts,apps/server/src/provider/acp/AcpSessionRuntime.processTree.test.tsThe wrapper reports the rejected target path and reason to stderr, while retaining exit status 125. The test checks the diagnostic under Bash when available. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
-
-
Merge Risk: ⚪ Minimal · up to
faf64Rejected targets now report their path and reason while retaining exit status 125. The changed behavior has a focused Bash assertion, and no actionable merge-blocking risk is evident.
Architecture Summary#
Architecture risk: 🔵 Low · up to
faf64The change affects 2 systems.
Changed systems:
packages/provider-acp,apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-acp (library) was modified; 1 changed file maps to changed impact.
- observed — apps/server (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/provider/acp/AcpSessionRuntime.processTree.test.ts: The test adds a Bash run of the missing-target wrapper case. When Bash is available, it asserts status 125 and that stderr contains
/nonexistent-t3-probe; when spawning Bash returnsENOENT, it skips those assertions. - observed — Modified behavior in packages/provider-acp/src/server/AcpSessionRuntime.ts: The wrapper retains its regular-file and executable checks and exit status 125, but now reports the rejected target path and failure reason to stderr instead of exiting silently.
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title clearly and concisely describes the main changes: adding a diagnostic for rejected agent paths and testing the Bash path. Description check The description includes complete Problem, Change, Scope and approval, and Verification sections. It provides reproduction context, implementation details, approval references, focused test results, l…
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this1d1a8e5
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
faf64f7Macroscope's review found this PR approvable — The PR is a small, localized bug fix that adds a useful stderr diagnostic for rejected Linux agent paths while preserving existing exit behavior and successful execution. Its accompanying test expands coverage to bash without changing production behavior.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).