Skip to content

fix(e2e): resolve AGENT binary to absolute path#129

Merged
emal-avala merged 1 commit intomainfrom
fix/e2e-absolute-agent-binary
Apr 16, 2026
Merged

fix(e2e): resolve AGENT binary to absolute path#129
emal-avala merged 1 commit intomainfrom
fix/e2e-absolute-agent-binary

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

Fixes the 2/78 E2E failures on the v0.15.3 Release E2E run (M1 + M3 in the Process-Level Sandbox section):

  • M1: sandbox config parse — Binary failed to start with [sandbox] present
  • M3: unknown strategy — Binary crashed on unknown sandbox strategy

(failed run)

Root cause

scripts/e2e-tests.sh sets AGENT="${AGENT_BINARY:-./target/release/agent}" — a relative path. M1 and M3 are the only tests that cd into a tempdir before invoking "${AGENT}":

if (cd "${M_CONFIG_DIR}" && "${AGENT}" --dump-system-prompt > /dev/null 2>&1); then

After the cd, ./target/release/agent (and target/release/agent as the CI passes it) resolves against the tempdir and the binary isn't found. The if branch fails and the script blames the sandbox config code path, but the binary never actually ran. M2/M4 don't cd, which is why they pass.

Fix

Resolve AGENT to an absolute path at script startup:

  • Already absolute → leave alone.
  • Relative with directory (e.g. target/release/agent) → realpath via cd "$(dirname ...)" && pwd.
  • Bare filename on PATH (e.g. agent) → resolve via command -v.

No other test is affected — every prior invocation used "${AGENT}" from the script's own cwd, which now still resolves identically.

Test plan

  • Reproduced M1 + M3 failures locally by running AGENT_BINARY=target/release/agent scripts/e2e-tests.sh against a release build of v0.15.3.
  • With the fix, M1 and M3 pass. Isolated repro via a minimal harness (cd into mktemp'd .agent/settings.toml, invoke binary) also passes.
  • Re-run the Release E2E workflow after merge (or add run-e2e label to this PR) to confirm on CI.

🤖 Generated with Claude Code

M1 and M3 in the Process-Level Sandbox section cd into a tempdir
before invoking "${AGENT}" --dump-system-prompt. With the default
relative path (./target/release/agent) the binary isn't found after
the cd, so both tests reported the binary as crashed on config
parse / unknown strategy even though the Rust code paths are fine.

Resolve AGENT to an absolute path at script startup so any test that
changes cwd can still invoke it. Handles three cases: already
absolute (unchanged), relative path with a directory component
(realpath'd via cd+pwd), and a bare filename on PATH (resolved via
command -v).

Repro: the v0.15.3 Release E2E run reports 2/78 failures (M1, M3);
rerunning scripts/e2e-tests.sh locally with AGENT_BINARY relative
reproduces the same failures, and this fix makes both tests pass.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@emal-avala emal-avala merged commit 584f6a4 into main Apr 16, 2026
12 of 14 checks passed
@emal-avala emal-avala deleted the fix/e2e-absolute-agent-binary branch April 16, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant