Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

fix(sandbox): report the local jail as inactive when nothing is enforcing\n\n`sandbox_status` with `{"backend":"local"}` returned `SandboxStatus::Ready` on\nevery host, including one with no OS jail at all. A caller that trusts it\nbelieves its commands are confined while they run unconfined — the one\ndirection a sandbox status must never be wrong in.\n\nThe `if os_backend.is_available()` guard could not help. `default_backend()` is\n`cwd_jail::detect::pick_backend`, which already performs the availability check\nand substitutes `NoopBackend` when nothing is usable; `NoopBackend::is_available()`\nis unconditionally `true`, pinned as a contract by the #3235 regression test. So\nthe condition was always true, the `else` arm was unreachable, and its warning\nnever fired.\n\nDerive the status from *which* backend was chosen instead:\n\n- `local_status_for_backend(name)` maps the noop passthrough to `Inactive` and\n any real jail to `Ready`. `Inactive` ("backend not initialized") rather than\n `Error` — noop is a documented passthrough on unsupported platforms, not a\n failure.\n- `NOOP_BACKEND_NAME` is now a constant that `NoopBackend::name()` returns, so a\n rename cannot silently turn an unconfined host back into a `Ready` report.\n- The warning now fires on the path that actually runs, and says plainly that\n commands run unconfined.\n\n`backend_id` is unchanged and still names the backend.\n\nExtracted as a free function on purpose: asserting this through\n`create_sandbox_backend` only exercises whichever branch the CI host happens to\ntake, so on a machine with Seatbelt or Landlock the noop path is never reached.\nThat is how the defect survived. `create_sandbox_backend_local` previously\nasserted `Ready` unconditionally — it now asserts the backend→status pairing,\nand two new tests pin the decision directly on any host.\n\nFault-injected to prove they bite: forcing the old always-Ready behaviour fails\nwith `left: Ready, right: Inactive`. Restored; sandbox suite green, 88 passed.\n
M3gA-Mind committed 2 months ago
f268efe
test(secrets): route both keyring status surfaces through one backend→mode assertion\n\nSupersedes the inline check merged in #6139. Both PRs landed the same day against\nthe same assertion — #6139 first, this one written from a base where the problem\nwas still live — so this builds on #6139's file rather than reverting it: its doc\ncomment, its #6076 rationale and its six-mode enum guard are all kept.\n\nWhat this adds over the inline version:\n\n * The probe surface was still unguarded. `keyring_consent_retry_probe` only\n checked enum membership, so `backendName: "file"` with\n `activeMode: "os_keyring"` — the exact #6076 mismatch — would have passed\n there. Both surfaces now go through the same assertion and cannot drift.\n * The `"os"`-but-unavailable branch. `active_mode_for` falls back to the\n RECORDED CONSENT when an OS backend's probe fails; the inline\n `_ => "consent_pending"` reported that as a mismatch.\n * A `label` per call site, so a failure says which surface broke rather than\n leaving the reader to work it out from a line number.\n\nVerified on top of #6139:\n\n clean: running 9 tests ... 8 passed; 0 failed; 1 ignored\n fault injected ("file" | "mock" mapped to "os_keyring", i.e. #6076 back):\n secrets_devices_e2e.rs:347:28\n keyring_consent_status: the file/mock backend is plaintext dev-keychain.json\n and must say so rather than claiming the OS keyring\n left: "local_plaintext_file" right: "os_keyring"\n running 9 tests ... 7 passed; 1 failed\n\nThe label is demonstrated at the status site; the probe site passes the other\nliteral through the same code path. Source restored byte-identical after the\ninjection.\n\nRefs #6139, #6096, #6076\n\nClaude-Session: https://claude.ai/code/session_01Rx5Fzc5keoeUQB3MwMFqMM\n
M3gA-Mind committed 2 months ago
74101bd
style: format the recovered coverage tests
oxoxDev committed 2 months ago
37e7e11
style: format the recovered coverage tests\n
oxoxDev committed 2 months ago
5ea20e8