Skip to content

ci: stop routing CI's cargo through the sandbox wrapper - #154

Merged
kjgbot merged 1 commit into
mainfrom
ci/fix-toolchain-home-0904
Sep 4, 2026
Merged

ci: stop routing CI's cargo through the sandbox wrapper#154
kjgbot merged 1 commit into
mainfrom
ci/fix-toolchain-home-0904

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Repairs the break I introduced in #153. Every PR on main currently fails.

What broke

Run sh ../ops/cargo.sh test --workspace
error: rustup could not choose a version of cargo to run, because one wasn't
specified explicitly, and no default is configured

ops/cargo.sh unconditionally redirects RUSTUP_HOME to $HOME/.relayflows-toolchain/rustup. On a runner that directory is empty, so the rustup shim has no toolchain to resolve. Seen on run 33815895797 (PR #139).

Why #153's verification missed it

Every command in that PR's local evidence had RUSTUP_TOOLCHAIN=stable in front of it:

$ cd kernel && PATH="$HOME/.cargo/bin:$PATH" RUSTUP_TOOLCHAIN=stable sh ../ops/cargo.sh test --workspace

and the workflow — and the report, and the PR body — recorded it without the prefix. The env var supplied the toolchain the empty RUSTUP_HOME could not, and my machine had one installed there from a prior bootstrap. So the tests I ran were real, but they were not the command I shipped. That's the whole defect: the evidence and the artifact diverged by one environment variable.

The fix

Kernel step: plain cargo test --workspace, matching the adjacent cargo build --locked --release whose passing runs already demonstrate the configuration works. The wrapper exists for a cloud sandbox — where the propagated tree drops files over a per-file size cap and each step must be able to obtain a toolchain itself. A GitHub runner has neither constraint, and dtolnay/rust-toolchain has already installed a default toolchain into the standard home.

SDK step: same problem, reached through npm testtest:prepops/cargo.sh build. Expanded npm test to its constituents and dropped test:prep. Its only real product is the relayflowd binary that tests/live-kernel.test.ts execs, and this job has already built one — so RELAYFLOWD_BIN now points at the release binary from the build step rather than compiling a second debug copy through a wrapper that cannot run here. live-kernel.test.ts:39 reads that variable directly.

test:prep's other half — chmod +x on the preflight CLI fixtures — is kept inline. The fixtures are committed 100755 so actions/checkout restores them anyway, but the guard is one line and the failure it prevents is an opaque EACCES deep inside a preflight test.

Verification

The honest statement: this one is verified by its own CI run on this PR, not by a local run. That is deliberate — the failure was environment-specific to the runner, so a local pass is exactly the evidence that already misled once here. The checks on this PR are the proof.

The coverage #153 intended is unchanged: the full kernel suite and all 26 SDK test files still run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

The kernel test step added in #153 fails on every PR:

  error: rustup could not choose a version of cargo to run, because one
  wasn't specified explicitly, and no default is configured

ops/cargo.sh unconditionally redirects RUSTUP_HOME to
$HOME/.relayflows-toolchain/rustup. On a runner that directory is empty, so
the rustup shim has no toolchain to resolve. It passed locally only because
every command in that verification had RUSTUP_TOOLCHAIN=stable in front of
it, and the workflow was written without it -- so the evidence behind #153
was not the command #153 shipped.

The wrapper exists for a cloud sandbox, where the propagated tree drops files
over a per-file size cap and a toolchain must be obtainable per step. A
GitHub runner has neither constraint, and dtolnay/rust-toolchain has already
installed a default toolchain into the standard home. Use plain cargo, as the
adjacent release build already does and as its passing runs demonstrate.

The SDK step has the same problem through npm test -> test:prep, so expand
npm test to its constituents and drop test:prep. Its only real output is the
relayflowd binary live-kernel.test.ts execs, and this job has already built
one: point RELAYFLOWD_BIN at the release binary instead of compiling a second
debug copy through a wrapper that cannot run here. test:prep's chmod of the
preflight CLI fixtures is kept inline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 1e8d4e9e-9914-4005-9e98-a840c9724801

📥 Commits

Reviewing files that changed from the base of the PR and between 3725025 and 70314b6.

📒 Files selected for processing (1)
  • .github/workflows/cloud-runtime-artifact.yml

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@kjgbot

kjgbot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

The toolchain fix works. CI is now red for a real reason.

Run 33816284259: cargo resolves, the kernel suite compiles and executes, and 33 of 34 tests in crash_resume pass. One fails:

worker_capacity::default_capacity_one_reopens_only_after_durable_completion_or_crash
crash_resume/worker_capacity.rs:149
  left: String("lane-a")   right: "lane-b"
test result: FAILED. 33 passed; 1 failed

That is a pre-existing regression on main, not something this PR causes. Bisected and filed as #155: #137 replaced first-runnable-step dispatch with a batch of every dependency-free step, so a capacity-1 worker now races between two independent lanes. 60/60 runs pass immediately before #137; ~15% fail at and after it.

So this PR is a judgement call, and it is yours

main is red either way right now — before this PR it fails at rustup could not choose a version of cargo, which is my bug from #153. The three options:

  1. Merge this. CI runs the suites and reports one genuine failure. Every PR stays blocked until P1: #137 made dispatch order to a capacity-1 worker nondeterministic (60/60 → ~15% failure) #155 is fixed, but blocked for a true reason.
  2. Merge this + revert kernel: dispatch runnable steps in parallel #137. Unblocks everything and removes the regression, at the cost of losing parallel dispatch until it is repaired properly.
  3. Revert ci: run the kernel and full SDK suites #153 entirely. CI goes green immediately and goes back to testing four SDK files and no kernel at all — green because it looks at nothing.

I have not merged. My standing flows autonomy is "green and no PR feedback", and this is not green; more to the point, #155 is a regression in a PR I merged, so choosing how to unblock it is not mine to make quietly at 01:30.

My recommendation is 1 — a red CI naming a real bug is worth more than a green one that never runs the test. But 2 is defensible if the lane needs to keep moving tonight.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

kjgbot pushed a commit that referenced this pull request Sep 4, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
@kjgbot
kjgbot merged commit ee28397 into main Sep 4, 2026
1 of 2 checks passed
kjgbot added a commit that referenced this pull request Sep 4, 2026
The kernel test step added in #153 fails on every PR:

  error: rustup could not choose a version of cargo to run, because one
  wasn't specified explicitly, and no default is configured

ops/cargo.sh unconditionally redirects RUSTUP_HOME to
$HOME/.relayflows-toolchain/rustup. On a runner that directory is empty, so
the rustup shim has no toolchain to resolve. It passed locally only because
every command in that verification had RUSTUP_TOOLCHAIN=stable in front of
it, and the workflow was written without it -- so the evidence behind #153
was not the command #153 shipped.

The wrapper exists for a cloud sandbox, where the propagated tree drops files
over a per-file size cap and a toolchain must be obtainable per step. A
GitHub runner has neither constraint, and dtolnay/rust-toolchain has already
installed a default toolchain into the standard home. Use plain cargo, as the
adjacent release build already does and as its passing runs demonstrate.

The SDK step has the same problem through npm test -> test:prep, so expand
npm test to its constituents and drop test:prep. Its only real output is the
relayflowd binary live-kernel.test.ts execs, and this job has already built
one: point RELAYFLOWD_BIN at the release binary instead of compiling a second
debug copy through a wrapper that cannot run here. test:prep's chmod of the
preflight CLI fixtures is kept inline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1

Co-authored-by: kjgbot <kjgbot@agentrelay.dev>
Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
kjgbot pushed a commit that referenced this pull request Sep 5, 2026
Split out of #165, which bundled this with a wholesale revert of the CI
workflow. The workflow half restored `ops/cargo.sh` for the kernel test
step (that wrapper redirects RUSTUP_HOME to an empty dir on a runner, so
rustup cannot choose a toolchain) and dropped the analyzer-skip env, i.e.
it reverted #153, #154 and #159 together. Only the sdk tooling is carried
here; `.github/` is byte-identical to main.

scripts/test.sh runs the same chain the inline `test` script did, in the
same order, with `set -eu` for the fail-fast the `&&` chain gave. The new
behaviour is the EXIT trap, which prunes `.map` and `.d.ts` from
sdk/dist afterward.

CI is unaffected either way: the workflow runs the expanded chain minus
test:prep, not `npm test`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
kjgbot added a commit that referenced this pull request Sep 5, 2026
The sdk half of #165, with that PR's CI revert dropped. `.github/` is
byte-identical to main (verified: `git diff origin/main --stat -- .github/`
returns 0 lines); #165's workflow hunk would have reverted #153, #154 and #159
together, restoring `ops/cargo.sh` for the kernel step, which redirects
RUSTUP_HOME to an empty dir on a runner.

`scripts/test.sh` runs the same chain the inline `test` script did, in the same
order, with `set -eu` supplying the fail-fast the `&&` chain gave.

Pruning is source maps only. Deleting `.d.ts` would have left
`"types": "./dist/index.d.ts"` pointing at a file `npm test` had just removed.
Every current in-repo consumer imports `.js` (`ops/probes/**`,
`workflows/drive.yaml`, `workflows/drive-cloud.yaml`,
`testdata/backlog-picker.flow.yaml`), so nothing breaks today — but the next
TypeScript consumer would meet a failure caused by running the tests.

Evidence at this head:
- independent signoff: local 3-lens preswarm review, maintainability / history /
  structure all REVIEW_PASSED. The history lens caught a false scope claim in an
  earlier message ("only ops/probes consume the sdk"), which was corrected.
- CI: linux-x64-artifact success, packed-consumer pass, CodeRabbit pass. The
  `review` check fails for a reason independent of this change and common to
  every flows PR: the gate invokes `agent-relay` and no step installs it
  (exit 127).

Supersedes the sdk half of #165.
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