Repository navigation
fix(runner): show git's reason on a failed clone or push; no false folder_not_granted after a grant - #13
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Useful customer fix; current-head CI/CD run 45716235067 reports success, but branch base 8807647 predates current main and automated review failed. Please rebase/requalify; specifically test redaction of tokens, credential-bearing URLs and remote stderr before exposing git error chains to users, and verify grant/revoke authorization is unchanged. |
The error was formatted with {e}, which prints only the outermost anyhow
context, so a failed clone read "git clone failed" and lost git's stderr
(for example Permission denied (publickey)). Print the whole chain with {e:#}
at the workspace setup and finalize (push) sites.
Testing: a_failed_clone_reports_gits_reason and a_refused_push_reports_gits_reason
each fail without the change (git's words missing) and pass with it.
Risk: reports are longer; git's stderr now reaches them. A clone URL carrying a
token in userinfo could be echoed by git; the runner builds no such URL itself.
How to revert: git revert this commit.
… heard Grants reach the runner only on the 30 s beat, and hanzo link grant signals nothing, so a folder granted seconds earlier was refused as folder_not_granted after cloud had already routed the run. When a claimed run's dir is not inside the current grants, sync once (the helper the 403 path uses), then decide. The real-path containment check is unchanged. Testing: a_folder_granted_since_the_last_beat_runs fails without the change (folder_not_granted) and passes with it; a_folder_still_not_granted_after_the_refresh_is_refused passes before and after. Risk: one extra target sync per run naming a folder not yet in the grants; that beat carries no rate metrics (fresh Sampler). How to revert: git revert this commit.
dbadf42 to
05c1e99
Compare
|
Rebased onto
|
Two fixes from a customer's day with a linked machine (Carbon District problem log, 25 Nov 2026, items 3.7 and 3.8). Two commits, each with a test that fails before it.
1. A failed clone or push hid git's reason (
9e9bf98)Seen: session error
workspace setup failed: git clone failed. The real cause, found only with git trace2 on the machine, wasPermission denied (publickey).Root cause:
run_gitkeeps stderr and the clone adds context, butrunner/mod.rsformatted the anyhow error with{e}, which prints only the outermost context.Fix:
{e:#}at the workspace-setup and push sites.Tests:
a_failed_clone_reports_gits_reason,a_refused_push_reports_gits_reason(a pre-receive hook refuses; the report now carries its words).Secrets: the chain adds git's stderr, io errors and key-file paths, never key contents. The reviewer traced the three clone URLs the cloud hands out (
coding_lifecycle.go:57,forge.go:353, the grant's SSH remote); none carries userinfo.2.
folder_not_grantedfor up to 30 s afterhanzo link grant(dbadf42)Seen: the cloud accepted a run 20 s after the grant (
routed: true); the runner refused it. The same call two minutes later ran.Root cause: the runner's granted-folder list is refreshed only by the 30 s beat;
execute_folder_runrefused from that snapshot.Fix: a claimed run whose
diris outside the current grants triggers one refresh through the existingsynchelper; the unchanged real-path containment check then decides. No timers, no retries, no IPC.Tests:
a_folder_granted_since_the_last_beat_runs,a_folder_still_not_granted_after_the_refresh_is_refused.Testing
cargo test --locked: 381 passed, 0 failed (+ filesize, signals).cargo clippy --locked --all-targets -- -D warnings: clean.cargo fmt --checknot run (no rustfmt for the pinned toolchain on the author's machine;mainis not rustfmt-clean and CI does not check it).Not tested
Follow-ups, not in this PR
hanzo-genis bumped in hanzoai/cli (Cargo.toml:59,Cargo.lock:972, pinned at8807647).runner/mod.rs~426).Built by one agent, reviewed by a second (which asked for the push test). Nothing merged; production is Zach's call.
Risk: low. How to revert:
git reverteither commit.