From 30e6bf11b38a58305b5c21f0cbcd54a38f164196 Mon Sep 17 00:00:00 2001 From: meh Date: Fri, 18 Sep 2026 00:39:05 +0700 Subject: [PATCH] feat(runtime): handle the Grok agent `agent-abstraction` gained `Agent::Grok` and this crate's matches did not, so building the sidecar against 0.4.21 fails outright: error[E0004]: non-exhaustive patterns: `Agent::Grok` not covered That takes AgencyZero's CI down with it, because `stage-agency-proxy-sidecar.sh` builds this from crates.io at the version `agency-proxy-client` pins, and cargo resolves it against the newer abstraction. `agent_name` and `agent_for_provider` gain the arm, and the two registry sweeps that enumerate agents include it, so a Grok run reports account usage and probe status like the other three. The dependency was a path into a sibling checkout, which no CI can resolve. It takes the published 0.4.21, which is where `Agent::Grok` is. --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- crates/proxy/Cargo.toml | 2 +- crates/proxy/src/runtime.rs | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96069b6..1274e91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "agency-proxy" -version = "0.1.9" +version = "0.1.10" dependencies = [ "agency-proxy-client", "agency-proxy-protocol", @@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "agency-proxy-client" -version = "0.1.9" +version = "0.1.10" dependencies = [ "agency-proxy-protocol", "endpoint-libs", @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "agency-proxy-protocol" -version = "0.1.9" +version = "0.1.10" dependencies = [ "serde", "serde_json", @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "agent-abstraction" -version = "0.4.19" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9610a85e179dd8575d24794f13920af19e86718fd5ed0d556367e4aa38c5c5a7" +checksum = "3ddf92d92000d84579f3344b73d62f04a4bc0ff32f90ff4ee69a8ff243f595c4" dependencies = [ "fs2", "libc", diff --git a/Cargo.toml b/Cargo.toml index 3709412..829bb8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/client", "crates/protocol", "crates/proxy"] [workspace.package] -version = "0.1.9" +version = "0.1.10" edition = "2024" license = "Apache-2.0" publish = true diff --git a/crates/proxy/Cargo.toml b/crates/proxy/Cargo.toml index 7c8c84e..bccb9b6 100644 --- a/crates/proxy/Cargo.toml +++ b/crates/proxy/Cargo.toml @@ -9,7 +9,7 @@ homepage.workspace = true repository.workspace = true [dependencies] -agent-abstraction = "0.4.19" +agent-abstraction = "0.4.21" agency-proxy-protocol.workspace = true async-trait.workspace = true clap.workspace = true diff --git a/crates/proxy/src/runtime.rs b/crates/proxy/src/runtime.rs index 1ae4b96..c4ad994 100644 --- a/crates/proxy/src/runtime.rs +++ b/crates/proxy/src/runtime.rs @@ -114,8 +114,8 @@ pub enum RuntimeError { impl RuntimeRegistry { pub async fn account_usage(&self) -> Vec { - futures::future::join_all([Agent::Claude, Agent::Codex, Agent::Copilot].map( - |agent| async move { + futures::future::join_all( + [Agent::Claude, Agent::Codex, Agent::Copilot, Agent::Grok].map(|agent| async move { let provider = agent_name(agent).to_string(); if !agent.reports_account_usage() { return agency_proxy_protocol::ProviderAccountUsage { @@ -139,14 +139,14 @@ impl RuntimeRegistry { error: Some(error.to_string()), }, } - }, - )) + }), + ) .await } pub async fn probe_providers(&self) -> Vec { - futures::future::join_all([Agent::Claude, Agent::Codex, Agent::Copilot].map( - |agent| async move { + futures::future::join_all( + [Agent::Claude, Agent::Codex, Agent::Copilot, Agent::Grok].map(|agent| async move { let probe = Probe::run(agent).await; let auth = AuthStatus::check(agent).await; let installed = @@ -194,8 +194,8 @@ impl RuntimeRegistry { plan, login_hint, } - }, - )) + }), + ) .await } @@ -601,6 +601,7 @@ fn agent_name(agent: Agent) -> &'static str { Agent::Claude => "claude", Agent::Codex => "codex", Agent::Copilot => "copilot", + Agent::Grok => "grok", } } @@ -609,6 +610,7 @@ fn agent_for_provider(provider: &str) -> Result { "claude" => Ok(Agent::Claude), "codex" => Ok(Agent::Codex), "copilot" => Ok(Agent::Copilot), + "grok" => Ok(Agent::Grok), other => Err(RuntimeError::Provider(other.into())), } }