From 1b7497c7c694c9245a7bd10de6df9bc4ab78689e Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 30 Nov 2026 16:45:56 -0800 Subject: [PATCH] Pin Harness, Plugin SDK, and Plugins to latest master Update `runvil`, `harness-gateway-client`, and `plugin-mcp` to `a4c98668`, `runvil-plugin-sdk` to `450afa2d`, `std-plugin` to `f1541bf9`, `bashkit-plugin` to `35f8e4b7`, and `web-plugin` to `1d5aefcc` in `Cargo.toml` and `Cargo.lock`. Adapt call sites for typed `RunSetup::selected_model` via `ModelId::gateway`, infallible `insert_plugin_dir`, and the removal of `runvil::harness::display_chain`. --- Cargo.lock | 95 ++++++++----------- Cargo.toml | 14 +-- .../workshop/agents/src/conversation-run.rs | 4 +- crates/workshop/agents/src/tee-tests.rs | 2 +- crates/workshop/server/src/agents.rs | 12 ++- .../server/src/agents/bindings-tests.rs | 5 +- crates/workshop/server/src/agents/bindings.rs | 4 +- crates/workshop/server/src/agents/socket.rs | 9 +- .../server/tests/it/std_real_directory.rs | 3 +- 9 files changed, 78 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78f037ba..f15c30f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1379,7 +1379,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1606,7 +1606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -2020,8 +2020,8 @@ dependencies = [ "libc", "log", "rustversion", - "windows-link 0.2.1", - "windows-result 0.4.1", + "windows-link 0.1.3", + "windows-result 0.3.4", ] [[package]] @@ -2243,7 +2243,7 @@ dependencies = [ [[package]] name = "harness-gateway-client" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "gateway-client", "runvil", @@ -2255,7 +2255,7 @@ dependencies = [ [[package]] name = "harness-plugin-loader" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "libloading 0.8.9", "runvil-plugin", @@ -2266,7 +2266,7 @@ dependencies = [ [[package]] name = "harness-runner" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "futures-util", "harness-plugin-loader", @@ -2496,7 +2496,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -3504,7 +3504,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4030,7 +4030,7 @@ dependencies = [ [[package]] name = "plugin-bashkit" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-bashkit?rev=488e845ad2bd7b3114092a3255b7b3d6105489f4#488e845ad2bd7b3114092a3255b7b3d6105489f4" +source = "git+https://github.com/cppalliance/runvil-plugin-bashkit?rev=35f8e4b72a9c14a4611899abcdb43a888a3287a3#35f8e4b72a9c14a4611899abcdb43a888a3287a3" dependencies = [ "bashkit", "runvil-plugin-sdk", @@ -4042,8 +4042,9 @@ dependencies = [ [[package]] name = "plugin-mcp" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ + "futures-util", "reqwest", "rmcp", "runvil-plugin", @@ -4055,7 +4056,7 @@ dependencies = [ [[package]] name = "plugin-std" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-std?rev=1da424b5ee5beac900c7ce93653a54b4e957c893#1da424b5ee5beac900c7ce93653a54b4e957c893" +source = "git+https://github.com/cppalliance/runvil-plugin-std?rev=f1541bf93b2a7fe75abfc905e4588906104f3a16#f1541bf93b2a7fe75abfc905e4588906104f3a16" dependencies = [ "regex", "runvil-plugin-sdk", @@ -4066,7 +4067,7 @@ dependencies = [ [[package]] name = "plugin-web" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-web?rev=2bde099da58faaef7285e6ec46f4344806b3472f#2bde099da58faaef7285e6ec46f4344806b3472f" +source = "git+https://github.com/cppalliance/runvil-plugin-web?rev=1d5aefccada1b49d924cada1d2c2080a22b3db3b#1d5aefccada1b49d924cada1d2c2080a22b3db3b" dependencies = [ "encoding_rs", "htmd", @@ -4362,7 +4363,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4711,7 +4712,7 @@ dependencies = [ [[package]] name = "runvil" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "harness-plugin-loader", "harness-runner", @@ -4722,7 +4723,7 @@ dependencies = [ [[package]] name = "runvil-engine" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "runvil-lua", "runvil-model-client", @@ -4735,7 +4736,7 @@ dependencies = [ [[package]] name = "runvil-lua" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "mlua", "runvil-markdown", @@ -4749,9 +4750,10 @@ dependencies = [ [[package]] name = "runvil-markdown" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "pulldown-cmark", + "serde", "serde_json", "serde_yaml_ng", ] @@ -4759,7 +4761,7 @@ dependencies = [ [[package]] name = "runvil-model-client" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "runvil-types", "serde", @@ -4769,7 +4771,7 @@ dependencies = [ [[package]] name = "runvil-plugin" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "runvil-types", "runvil-vfs", @@ -4779,7 +4781,7 @@ dependencies = [ [[package]] name = "runvil-plugin-sdk" version = "0.7.0" -source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=42c109fdc8bffd15ee6b6d7afcc04383aa27373a#42c109fdc8bffd15ee6b6d7afcc04383aa27373a" +source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78#450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" dependencies = [ "runvil-plugin-sys", ] @@ -4787,12 +4789,12 @@ dependencies = [ [[package]] name = "runvil-plugin-sys" version = "0.7.0" -source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=42c109fdc8bffd15ee6b6d7afcc04383aa27373a#42c109fdc8bffd15ee6b6d7afcc04383aa27373a" +source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78#450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" [[package]] name = "runvil-prompt" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "pulldown-cmark", "runvil-lua", @@ -4805,7 +4807,7 @@ dependencies = [ [[package]] name = "runvil-runtime" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "mlua", "regex", @@ -4823,7 +4825,7 @@ dependencies = [ [[package]] name = "runvil-types" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" dependencies = [ "serde", "serde_json", @@ -4833,7 +4835,7 @@ dependencies = [ [[package]] name = "runvil-vfs" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=af336702ac76ca8f9c1ebe918028a776473ae917#af336702ac76ca8f9c1ebe918028a776473ae917" +source = "git+https://github.com/cppalliance/runvil-harness?rev=a4c98668d7cc5ce67d57fb3e6623e385d3bbb144#a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" [[package]] name = "rust-embed" @@ -4925,7 +4927,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4982,7 +4984,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -5664,7 +5666,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5864,7 +5866,7 @@ dependencies = [ "unicode-segmentation", "url", "windows", - "windows-core 0.61.2", + "windows-core", "windows-version", "x11-dl", ] @@ -6263,7 +6265,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix 1.1.4", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -7398,7 +7400,7 @@ dependencies = [ "webview2-com-macros", "webview2-com-sys", "windows", - "windows-core 0.61.2", + "windows-core", "windows-implement", "windows-interface", ] @@ -7422,7 +7424,7 @@ checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" dependencies = [ "thiserror 2.0.19", "windows", - "windows-core 0.61.2", + "windows-core", ] [[package]] @@ -7468,7 +7470,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -7499,7 +7501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ "windows-collections", - "windows-core 0.61.2", + "windows-core", "windows-future", "windows-link 0.1.3", "windows-numerics", @@ -7511,7 +7513,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core 0.61.2", + "windows-core", ] [[package]] @@ -7527,26 +7529,13 @@ dependencies = [ "windows-strings 0.4.2", ] -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - [[package]] name = "windows-future" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", "windows-threading", ] @@ -7591,7 +7580,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", ] @@ -7950,7 +7939,7 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows-core 0.61.2", + "windows-core", "workshop-server-api", ] @@ -8233,7 +8222,7 @@ dependencies = [ "webkit2gtk-sys", "webview2-com", "windows", - "windows-core 0.61.2", + "windows-core", "windows-version", "x11-dl", ] diff --git a/Cargo.toml b/Cargo.toml index 535becfa..201bb70f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,35 +25,35 @@ repository = "https://github.com/cppalliance/runvil-workshop" # Workshop links in. All three name one commit, because two commits would # be two copies of every type the crates share. `version` beside `git` # keeps cargo-deny's wildcard check quiet. -runvil = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "af336702ac76ca8f9c1ebe918028a776473ae917" } -harness-gateway-client = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "af336702ac76ca8f9c1ebe918028a776473ae917" } -plugin-mcp = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "af336702ac76ca8f9c1ebe918028a776473ae917" } +runvil = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" } +harness-gateway-client = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" } +plugin-mcp = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "a4c98668d7cc5ce67d57fb3e6623e385d3bbb144" } # The safe layer over the C Plugin contract, version 0.7, from its own # repository, pinned by commit. Only the library Plugin crates under # `crates/workshop/` name it, for `export_plugin!`. The commit is the one # runvil-harness pins the contract's `runvil-plugin-sys` at: that crate # sets `links`, so Cargo refuses two commits of the contract in one build. -runvil-plugin-sdk = { version = "0.7.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "42c109fdc8bffd15ee6b6d7afcc04383aa27373a" } +runvil-plugin-sdk = { version = "0.7.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" } # The std Plugin, from its own repository, pinned by commit, which must be # built against the contract commit above. default-features off drops its # own export of `runvil_plugin`, which `workshop-plugin-std` makes instead. # The key is `std-plugin` because that crate's own library is named # `plugin_std`, the name of the file Workshop ships. -std-plugin = { package = "plugin-std", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-std", rev = "1da424b5ee5beac900c7ce93653a54b4e957c893", default-features = false } +std-plugin = { package = "plugin-std", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-std", rev = "f1541bf93b2a7fe75abfc905e4588906104f3a16", default-features = false } # The bashkit Plugin, from its own repository, pinned by commit and built # against the same contract commit. default-features off drops its own # export of `runvil_plugin`, which `workshop-plugin-bashkit` makes # instead. The key is `bashkit-plugin` for the reason std's is # `std-plugin`: the crate's own library has the name of the file Workshop # ships, `plugin_bashkit`. -bashkit-plugin = { package = "plugin-bashkit", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-bashkit", rev = "488e845ad2bd7b3114092a3255b7b3d6105489f4", default-features = false } +bashkit-plugin = { package = "plugin-bashkit", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-bashkit", rev = "35f8e4b72a9c14a4611899abcdb43a888a3287a3", default-features = false } # The web Plugin, from its own repository, pinned by commit and built # against the same contract commit. default-features off drops its own # export of `runvil_plugin`, which `workshop-plugin-web` makes instead. # The key is `web-plugin` for the reason std's is `std-plugin`: the # crate's own library has the name of the file Workshop ships, # `plugin_web`. -web-plugin = { package = "plugin-web", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-web", rev = "2bde099da58faaef7285e6ec46f4344806b3472f", default-features = false } +web-plugin = { package = "plugin-web", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-web", rev = "1d5aefccada1b49d924cada1d2c2080a22b3db3b", default-features = false } workshop-gateway-discovery = { path = "crates/workshop/gateway-discovery" } workshop-server = { path = "crates/workshop/server" } workshop-server-api = { path = "crates/workshop/server-api" } diff --git a/crates/workshop/agents/src/conversation-run.rs b/crates/workshop/agents/src/conversation-run.rs index dfce171d..6c64c796 100644 --- a/crates/workshop/agents/src/conversation-run.rs +++ b/crates/workshop/agents/src/conversation-run.rs @@ -5,7 +5,7 @@ use std::sync::Arc; -use runvil::harness::{IntoShared, RunRecorder, display_chain}; +use runvil::harness::{IntoShared, RunRecorder}; use runvil::ids::RoundId; use runvil::{Error, Harness, Host, Prompt, RunReport, RunSetup}; @@ -85,7 +85,7 @@ impl Conversation { Err(error) => error.located_message(), } } - Err(error) => display_chain(&error), + Err(error) => error.to_string(), }; tracing::warn!( conversation = %self.core.id, diff --git a/crates/workshop/agents/src/tee-tests.rs b/crates/workshop/agents/src/tee-tests.rs index 92b33b9f..7e5a4dc9 100644 --- a/crates/workshop/agents/src/tee-tests.rs +++ b/crates/workshop/agents/src/tee-tests.rs @@ -132,7 +132,7 @@ async fn the_tee_returns_the_inner_recorders_refusal_and_keeps_the_event_out() { .await .expect_err("the inner recorder's refusal is the tee's"); assert_eq!( - runvil::harness::display_chain(&refusal), + refusal.to_string(), "the run recorder failed: the log is full", "the refusal is the inner recorder's own" ); diff --git a/crates/workshop/server/src/agents.rs b/crates/workshop/server/src/agents.rs index fa724481..215352ee 100644 --- a/crates/workshop/server/src/agents.rs +++ b/crates/workshop/server/src/agents.rs @@ -246,10 +246,20 @@ pub struct PluginListing { /// Returns the I/O error when `directory` cannot be read, as when it does /// not exist. pub fn list_plugin_dir(directory: &Path) -> io::Result { + let _ = std::fs::read_dir(directory)?; let mut packs = PackRegistry::new(); // A listing only loads and unloads the Plugins, so it offers them // empty resources. - let report = insert_plugin_dir(&mut packs, directory, &HostResources::new())?; + let report = insert_plugin_dir(&mut packs, directory, &HostResources::new()); + if let Some(failure) = report.failures().iter().find(|failure| { + failure + .facts + .get(&ErrorFact::Reason) + .and_then(Value::as_str) + == Some("directory") + }) { + return Err(io::Error::other(failure.to_string())); + } let loaded = report .plugins() .iter() diff --git a/crates/workshop/server/src/agents/bindings-tests.rs b/crates/workshop/server/src/agents/bindings-tests.rs index da56da06..718f898d 100644 --- a/crates/workshop/server/src/agents/bindings-tests.rs +++ b/crates/workshop/server/src/agents/bindings-tests.rs @@ -34,5 +34,8 @@ fn a_runs_setup_takes_the_menus_selection() { .expect("the id is in the catalog"); let setup = with_host_state(®istry, empty_setup()); - assert_eq!(setup.selected_model.as_deref(), Some("test-model")); + assert_eq!( + setup.selected_model, + Some(ModelId::gateway("test-model").expect("a valid model id")) + ); } diff --git a/crates/workshop/server/src/agents/bindings.rs b/crates/workshop/server/src/agents/bindings.rs index f998627b..a8796d31 100644 --- a/crates/workshop/server/src/agents/bindings.rs +++ b/crates/workshop/server/src/agents/bindings.rs @@ -3,6 +3,7 @@ //! Harness resolves the run's model from it. use runvil::RunSetup; +use runvil::model::ModelId; use workshop_menu::MenuHandles; use workshop_registry::Registry; @@ -13,7 +14,8 @@ pub(super) fn with_host_state(registry: &Registry, setup: RunSetup) -> RunSetup let selected_model = registry .state::() .and_then(|handles| handles.menu().latest()) - .and_then(|snapshot| snapshot.selected_model); + .and_then(|snapshot| snapshot.selected_model) + .and_then(|name| ModelId::gateway(name).ok()); RunSetup { selected_model, ..setup diff --git a/crates/workshop/server/src/agents/socket.rs b/crates/workshop/server/src/agents/socket.rs index 163cdff4..49ca3c2a 100644 --- a/crates/workshop/server/src/agents/socket.rs +++ b/crates/workshop/server/src/agents/socket.rs @@ -30,7 +30,6 @@ use axum::extract::State; use axum::extract::ws::{Message, WebSocket, WebSocketUpgrade}; use axum::http::HeaderMap; use axum::response::Response; -use runvil::harness::display_chain; use tokio::sync::broadcast; use tokio::sync::broadcast::error::RecvError; @@ -400,7 +399,13 @@ async fn handle_open( /// client as the bare "agent session state unavailable" with the /// filesystem's diagnosis gone. fn refusal_text(refusal: &LaunchRefusal) -> String { - display_chain(refusal) + let mut text = refusal.to_string(); + let mut next = std::error::Error::source(refusal); + while let Some(cause) = next { + let _ = std::fmt::Write::write_fmt(&mut text, format_args!(": {cause}")); + next = cause.source(); + } + text } /// Attaches the socket to `conversation`: takes `receivers` as the diff --git a/crates/workshop/server/tests/it/std_real_directory.rs b/crates/workshop/server/tests/it/std_real_directory.rs index 9a188dbb..ece3b1f6 100644 --- a/crates/workshop/server/tests/it/std_real_directory.rs +++ b/crates/workshop/server/tests/it/std_real_directory.rs @@ -91,8 +91,7 @@ fn std_pack() -> (Arc, PluginReport) { let mut packs = PackRegistry::new(); // The file tools work on the run's files alone, so the Plugins of the // directory get empty resources. - let report = insert_plugin_dir(&mut packs, &plugin_dir(), &HostResources::new()) - .expect("the directory is read"); + let report = insert_plugin_dir(&mut packs, &plugin_dir(), &HostResources::new()); assert!(report.failures().is_empty(), "{:?}", report.failures()); let (_info, id, factory) = packs .into_entries()