From 3cb241add16fbcee4cbf412adb8cb476d7e99966 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 03:30:35 -0600 Subject: [PATCH 1/2] fix(fleet): GitHub API agents use the platform root store (code#13122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The placement agent (fleet-queue placement.rs), the queue broker's shared agent (queue_broker.rs — Turso plus the GitHub dep-probe reads), and the dispatch-test agent were built with ureq's default webpki roots. Behind a TLS-intercepting egress proxy (the Muse sandbox seats), the proxy's CA lives only in the platform store, so every direct GitHub API call from a sandbox seat died with "invalid peer certificate: UnknownIssuer" — remote dispatch and dispatch-test were unreachable from sandbox seats even after the binary rollout. Apply the same fix the gh.rs App leg already carries: build all three agents with RootCerts::PlatformVerifier, and add ureq's platform-verifier feature to fleet-queue and fleet-dispatch-test. Refs #13122. --- pkgs/fleet/crates/fleet-dispatch-test/Cargo.toml | 2 +- pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs | 10 ++++++++++ pkgs/fleet/crates/fleet-queue/Cargo.toml | 2 +- pkgs/fleet/crates/fleet-queue/src/placement.rs | 10 ++++++++++ pkgs/fleet/crates/fleet-queue/src/queue_broker.rs | 10 ++++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/pkgs/fleet/crates/fleet-dispatch-test/Cargo.toml b/pkgs/fleet/crates/fleet-dispatch-test/Cargo.toml index ccd24a2d94..2dbc9d3980 100644 --- a/pkgs/fleet/crates/fleet-dispatch-test/Cargo.toml +++ b/pkgs/fleet/crates/fleet-dispatch-test/Cargo.toml @@ -14,4 +14,4 @@ serde = { workspace = true } # the schema's column order, part of the output shape agents consume. serde_json = { version = "1", features = ["preserve_order"] } # Same pin as fleet-search / fleet-queue. -ureq = { version = "3", features = ["rustls", "json"] } +ureq = { version = "3", features = ["rustls", "json", "platform-verifier"] } diff --git a/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs b/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs index 6e5d104732..ffcfb2b059 100644 --- a/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs +++ b/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs @@ -289,10 +289,20 @@ fn resolve_named(config: &Config, name: &str) -> Result { } fn agent() -> ureq::Agent { + // Platform root store, not webpki-roots alone: hosts + // behind a TLS-intercepting egress proxy present the + // proxy's CA, which only the platform store carries (the + // sandbox seat's scan died with UnknownIssuer before this + // — code#13122; same fix as fleet's gh.rs App leg). ureq::Agent::config_builder() .timeout_global(Some(Duration::from_secs(60))) .timeout_connect(Some(Duration::from_secs(10))) .http_status_as_error(false) + .tls_config( + ureq::tls::TlsConfig::builder() + .root_certs(ureq::tls::RootCerts::PlatformVerifier) + .build(), + ) .build() .into() } diff --git a/pkgs/fleet/crates/fleet-queue/Cargo.toml b/pkgs/fleet/crates/fleet-queue/Cargo.toml index 30ff68fa91..6c030ff53c 100644 --- a/pkgs/fleet/crates/fleet-queue/Cargo.toml +++ b/pkgs/fleet/crates/fleet-queue/Cargo.toml @@ -35,7 +35,7 @@ serde_json = { version = "1", features = ["preserve_order"] } tiny_http = { version = "0.12", optional = true } # uds_http's bind lock (flock) — #6515. libc = { version = "0.2", optional = true } -ureq = { version = "3", features = ["rustls", "json"], optional = true } +ureq = { version = "3", features = ["rustls", "json", "platform-verifier"], optional = true } # The #8583 local coordination replica's durable store; bundled so # the broker surfaces need no system SQLite (atlas-core pins the same # stack). Only the queue-broker surface carries the replica. diff --git a/pkgs/fleet/crates/fleet-queue/src/placement.rs b/pkgs/fleet/crates/fleet-queue/src/placement.rs index c330eec5c3..b058089ccc 100644 --- a/pkgs/fleet/crates/fleet-queue/src/placement.rs +++ b/pkgs/fleet/crates/fleet-queue/src/placement.rs @@ -293,9 +293,19 @@ fn first_token(lookups: &[&dyn Fn() -> Option]) -> Option { impl RealGh { fn new() -> Self { + // Platform root store, not webpki-roots alone: hosts + // behind a TLS-intercepting egress proxy present the + // proxy's CA, which only the platform store carries (the + // sandbox seat's dispatch died with UnknownIssuer before + // this — code#13122; same fix as fleet's gh.rs App leg). let agent: ureq::Agent = ureq::Agent::config_builder() .http_status_as_error(false) .timeout_global(Some(Duration::from_secs(60))) + .tls_config( + ureq::tls::TlsConfig::builder() + .root_certs(ureq::tls::RootCerts::PlatformVerifier) + .build(), + ) .build() .into(); RealGh { diff --git a/pkgs/fleet/crates/fleet-queue/src/queue_broker.rs b/pkgs/fleet/crates/fleet-queue/src/queue_broker.rs index caefd4ba54..36c8bfa0c7 100644 --- a/pkgs/fleet/crates/fleet-queue/src/queue_broker.rs +++ b/pkgs/fleet/crates/fleet-queue/src/queue_broker.rs @@ -688,9 +688,19 @@ pub fn run() -> i32 { } }; + // Platform root store, not webpki-roots alone: this agent + // carries the broker's GitHub dep-probe reads, and a broker + // running behind a TLS-intercepting egress proxy presents + // the proxy's CA, which only the platform store carries + // (code#13122; same fix as fleet's gh.rs App leg). let agent: ureq::Agent = ureq::Agent::config_builder() .http_status_as_error(false) .timeout_global(Some(Duration::from_secs(90))) + .tls_config( + ureq::tls::TlsConfig::builder() + .root_certs(ureq::tls::RootCerts::PlatformVerifier) + .build(), + ) .build() .into(); // Turso is the only queue backend: QUEUE_BROKER_BACKEND unset From 044a6bda94bdd2fead70566816a3e4cfcc2e3d5a Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 04:02:41 -0600 Subject: [PATCH 2/2] docs(fleet): name the sandbox-seat dispatch route in the runbook (code#13122) Sandbox seats dispatch with the ambient environment on a current binary; older builds fail UnknownIssuer under the TLS-intercepting egress proxy. Documents the update route and the plain-tunnel relay workaround. --- pkgs/fleet/doc/agents/remote-build-and-test.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/fleet/doc/agents/remote-build-and-test.md b/pkgs/fleet/doc/agents/remote-build-and-test.md index 7508ab7d9b..2440878e6a 100644 --- a/pkgs/fleet/doc/agents/remote-build-and-test.md +++ b/pkgs/fleet/doc/agents/remote-build-and-test.md @@ -94,6 +94,12 @@ For a detached laptop command, add `--detach` and track the returned job ID with Random `fp_...` handles and their records remain in `~/.local/state/fleet-place/sessions.json`. They work where that local store is available. For a follow-up from another agent or workspace, use the portable `OWNER/REPO#RUN_ID` identifier; Fleet resolves it through GitHub without the local session record. If dispatch has not correlated a run ID yet, keep using the local handle. +## Sandbox seats + +Sandbox seats run the static `fleet` build (installed by `scripts/muse/bootstrap.sh`). Dispatch and `dispatch-test` call the GitHub API directly from the seat, and the binary validates TLS against the platform root store, so both work under the sandbox's TLS-intercepting egress proxy with the ambient environment — no proxy overrides needed. + +On a binary old enough to predate the platform-verifier fix (code#13122), the same calls fail with `invalid peer certificate: UnknownIssuer`: that build trusted webpki roots only, and the egress proxy's CA is not among them. Do not conclude dispatch is unavailable from a sandbox seat on that error — update the binary (re-run `scripts/muse/bootstrap.sh` on a current checkout), or route every proxy variable (`HTTPS_PROXY`, `https_proxy`, `HTTP_PROXY`, `http_proxy`, `ALL_PROXY`, `all_proxy`) through the seat's plain-tunnel relay, `http://broker:broker@127.0.0.1:3130`, which presents the real GitHub certificate. + ## Other dispatch routes - **`fleet dispatch-test scan|submit|status`** — the explicit-dispatch route for work inside a fleet-umbrella submodule. `scan` lists the execution homes (dezren39/fleet and its fork network) with their live Actions load and picks the first with free capacity; `submit --submodule --ref --commands ''` stores the job in the fleet-dispatch Turso store and dispatches `fleet-dispatch-test.yml` there; `status ` reads the stored result. Linux, GitHub-hosted only; use it when the job is naturally "run inside submodule X at ref Y".