diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c8cb41..8085a40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable with: components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 - name: Format run: cargo fmt --check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d0d87f6..5aeb3af 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,11 +28,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 - name: Are these versions already on crates.io? id: check diff --git a/Cargo.lock b/Cargo.lock index 6433a72..cb6814b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "agency-proxy" -version = "0.1.7" +version = "0.1.8" dependencies = [ "agency-proxy-client", "agency-proxy-protocol", @@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "agency-proxy-client" -version = "0.1.7" +version = "0.1.8" dependencies = [ "agency-proxy-protocol", "endpoint-libs", @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "agency-proxy-protocol" -version = "0.1.7" +version = "0.1.8" dependencies = [ "serde", "serde_json", @@ -58,17 +58,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "1.1.5" @@ -617,30 +606,6 @@ dependencies = [ "hybrid-array", ] -[[package]] -name = "borsh" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" -dependencies = [ - "borsh-derive", - "bytes", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f347189c62a579b8cd5f80714efa178f52e461dc2e6d701d264f5ff22e566c" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "bs58" version = "0.5.1" @@ -662,28 +627,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -720,9 +663,9 @@ checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0", @@ -1127,9 +1070,9 @@ dependencies = [ [[package]] name = "endpoint-libs" -version = "2.1.5" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5608ed7999ec93039de772a217bfa8c52175b42b41de1d2c1a73e7189ef92cb7" +checksum = "64708d7972a5c06112029ef04599061238abc55ba5e879a0e02dfc373d24df34" dependencies = [ "alloy-primitives", "async-trait", @@ -1157,7 +1100,6 @@ dependencies = [ "opentelemetry_sdk", "parking_lot", "reqwest", - "rust_decimal", "rustls", "serde", "serde_json", @@ -1475,9 +1417,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.15" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" +checksum = "ef8e5e5a340588f4452631496976cf8636d4a7ecf600239fdc27615d2530bc16" dependencies = [ "atomic-waker", "bytes", @@ -1497,9 +1439,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] [[package]] name = "hashbrown" @@ -2414,26 +2353,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quinn" version = "0.11.11" @@ -2666,15 +2585,6 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - [[package]] name = "reqwest" version = "0.12.28" @@ -2742,35 +2652,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rkyv" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rlp" version = "0.5.2" @@ -2816,23 +2697,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" -[[package]] -name = "rust_decimal" -version = "1.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2a24f50780bc85f09cc6ac299bdf1424302742d77221106859c9d8b102126a" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand 0.8.7", - "rkyv", - "serde", - "serde_json", - "wasm-bindgen", -] - [[package]] name = "rustc-hash" version = "2.1.3" @@ -2954,12 +2818,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "sec1" version = "0.7.3" @@ -3180,12 +3038,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - [[package]] name = "slab" version = "0.4.12" @@ -3878,7 +3730,6 @@ dependencies = [ "cfg-if", "once_cell", "rustversion", - "serde", "wasm-bindgen-macro", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 19572dd..a8513d4 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.7" +version = "0.1.8" edition = "2024" license = "Apache-2.0" publish = true @@ -11,11 +11,11 @@ homepage = "https://github.com/pathscale/agencyproxy" repository = "https://github.com/pathscale/agencyproxy" [workspace.dependencies] -agency-proxy-protocol = { version = "0.1.7", path = "crates/protocol" } -agency-proxy-client = { version = "0.1.7", path = "crates/client" } +agency-proxy-protocol = { version = "^0.1.8", path = "crates/protocol" } +agency-proxy-client = { version = "^0.1.8", path = "crates/client" } async-trait = "0.1" clap = { version = "4", features = ["derive"] } -endpoint-libs = { version = "=2.1.5", default-features = false, features = ["framed-transport"] } +endpoint-libs = { version = "^3", default-features = false, features = ["framed-transport"] } eyre = "0.6" futures = "0.3" serde = { version = "1", features = ["derive"] } diff --git a/crates/client/src/lib.rs b/crates/client/src/lib.rs index 56fb1bd..41d17b0 100644 --- a/crates/client/src/lib.rs +++ b/crates/client/src/lib.rs @@ -110,7 +110,7 @@ async fn drive( continue; } }; - if let Err(error) = transport.send(WireMessage::Text(encoded)).await { + if let Err(error) = transport.send(WireMessage::Text(encoded.into())).await { let detail = error.to_string(); let _ = request.response.send(Err(ClientError::Transport(detail.clone()))); break detail; diff --git a/crates/proxy/src/lib.rs b/crates/proxy/src/lib.rs index 27819ba..a8882f3 100644 --- a/crates/proxy/src/lib.rs +++ b/crates/proxy/src/lib.rs @@ -401,7 +401,7 @@ where E: std::error::Error, { transport - .send(WireMessage::Text(serde_json::to_string(frame)?)) + .send(WireMessage::Text(serde_json::to_string(frame)?.into())) .await .map_err(|error| Error::Transport(error.to_string())) } diff --git a/crates/proxy/tests/local_socket.rs b/crates/proxy/tests/local_socket.rs index 93ac336..0ff9e36 100644 --- a/crates/proxy/tests/local_socket.rs +++ b/crates/proxy/tests/local_socket.rs @@ -243,10 +243,11 @@ async fn cancel_stops_an_uncooperative_provider_and_publishes_a_terminal_event() async fn draining_shutdown_rejects_new_runs_and_waits_for_the_active_run() { let dir = tempdir().expect("temp dir should exist"); let binary = dir.path().join("slow-claude"); + let release = dir.path().join("release-provider"); std::fs::write( &binary, r#"#!/bin/sh -sleep 1 +while [ ! -f "$AGENCY_PROXY_TEST_RELEASE" ]; do sleep 0.01; done printf '%s\n' '{"type":"result","subtype":"success","is_error":false,"result":"done","session_id":"proxy-session","usage":{"input_tokens":1,"output_tokens":1}}' "#, ) @@ -276,7 +277,10 @@ printf '%s\n' '{"type":"result","subtype":"success","is_error":false,"result":"d workspace_roots: vec![dir.path().to_string_lossy().into_owned()], resume_session_id: None, binary: Some(binary.to_string_lossy().into_owned()), - environment: BTreeMap::new(), + environment: BTreeMap::from([( + "AGENCY_PROXY_TEST_RELEASE".into(), + release.to_string_lossy().into_owned(), + )]), unchecked_args: Vec::new(), metadata: BTreeMap::new(), }; @@ -320,6 +324,7 @@ printf '%s\n' '{"type":"result","subtype":"success","is_error":false,"result":"d ), "draining closes admission before acknowledging" ); + std::fs::write(&release, "release").expect("provider release should write"); tokio::time::timeout(Duration::from_secs(2), task) .await .expect("server should stop after the run drains") @@ -405,7 +410,9 @@ async fn commands_before_hello_are_rejected() { }; transport .send(WireMessage::Text( - serde_json::to_string(&frame).expect("frame should encode"), + serde_json::to_string(&frame) + .expect("frame should encode") + .into(), )) .await .expect("frame should write");