Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
17f0e69
feat(plugins): install the recommended plugin set by default in setup
ethanyzhang Nov 23, 2026
f0d34a7
fix(plugins): list the available sets when an unknown set is requested
ethanyzhang Nov 23, 2026
729ee0b
fix(plugins): report members unavailable on this platform and survive…
ethanyzhang Nov 23, 2026
f0d23d0
feat(plugins): offer the recommended set once per machine
ethanyzhang Nov 23, 2026
3719e63
fix(plugins): retry a failed recommended-set member at the next setup
ethanyzhang Nov 23, 2026
7738935
fix(plugins): keep later-added members out of a retried set offer and…
ethanyzhang Nov 23, 2026
5c4b87f
fix(plugins): use a per-process temp file for the offer record and do…
ethanyzhang Nov 23, 2026
a95e481
fix(plugins): keep setup's plugin result when the offer record cannot…
ethanyzhang Nov 25, 2026
27b2c25
docs(plugins): keep every install path in the plugin architecture page
ethanyzhang Nov 25, 2026
7da780f
docs(plugins): say the recommended set is offered once per plugin store
ethanyzhang Nov 25, 2026
26cc4c2
fix(plugins): keep concurrent plugin changes and install into the ser…
ethanyzhang Nov 26, 2026
7e47a52
fix(plugins): complete a merged set offer only when its snapshot is o…
ethanyzhang Nov 26, 2026
ed1de3b
fix(setup): name the service's plugin store and keep reporters off th…
ethanyzhang Nov 26, 2026
7d1b3d8
fix(setup): refuse mixed quoting in service.env and isolate catalog t…
ethanyzhang Nov 26, 2026
d83634c
fix(setup): resolve a relative service plugin store against the servi…
ethanyzhang Nov 26, 2026
6b7eb21
test(setup): use a host-absolute store path in the service.env test
ethanyzhang Nov 27, 2026
9c90148
fix(setup): keep setup's plugin install inside its deadline and offer…
ethanyzhang Nov 30, 2026
0a32c99
feat(setup): keep capsules checkpoints local when a plugin set instal…
ethanyzhang Dec 1, 2026
1373538
docs(plugins): describe capsules v0.1.26's witness default and why se…
ethanyzhang Dec 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions mesh/crates/mesh-llm-cli/src/parser/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,18 @@ pub enum ConfigCommand {

#[derive(Subcommand, Debug)]
pub enum PluginCommand {
/// Install the default plugins from this release's bundled copy (no download).
/// A node also does this when it starts.
/// Install native plugins in order, or install one local release archive.
/// Install native plugins in order, install one local release archive, or
/// install a catalog plugin set.
Install {
/// Plugin catalog names, GitHub owner/repo references, or GitHub URLs.
/// Stops on the first failure; earlier installs are kept.
#[arg(num_args = 1.., required_unless_present = "archive", conflicts_with_all = ["archive", "name", "version"])]
#[arg(num_args = 1.., required_unless_present_any = ["archive", "set"], conflicts_with_all = ["archive", "name", "version", "set"])]
reference: Vec<String>,
/// Install the members of a catalog plugin set, such as `recommended`, that
/// are not installed yet, including one you removed earlier. Members already
/// installed are left as they are.
#[arg(long, value_name = "NAME", conflicts_with_all = ["archive", "name", "version"])]
set: Option<String>,
/// Install a local .tar.gz or .zip release archive. Requires --name.
#[arg(long, value_name = "PATH", requires = "name")]
archive: Option<PathBuf>,
Expand Down
36 changes: 36 additions & 0 deletions mesh/crates/mesh-llm-cli/src/parser/plugin_install_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn plugins_install_accepts_local_archive_options() {
command:
PluginCommand::Install {
reference,
set: None,
archive: Some(archive),
name: Some(name),
version: Some(version),
Expand Down Expand Up @@ -66,6 +67,7 @@ fn accepts_one_or_multiple_references_in_order() {
command:
PluginCommand::Install {
reference,
set: None,
archive: None,
name: None,
version: None,
Expand Down Expand Up @@ -98,3 +100,37 @@ fn rejects_missing_references_and_invalid_archive_options() {
assert!(Cli::try_parse_from(&args).is_err(), "accepted {args:?}");
}
}

#[test]
fn plugins_install_accepts_a_catalog_set_alone() {
let cli = Cli::try_parse_from(["mesh-llm", "plugins", "install", "--set", "recommended"])
.expect("--set parses by itself");
match cli.command.expect("plugins command") {
Command::Plugin {
command:
PluginCommand::Install {
reference,
set: Some(set),
archive: None,
..
},
} => {
assert!(reference.is_empty());
assert_eq!(set, "recommended");
}
other => panic!("unexpected command: {other:?}"),
}
}

#[test]
fn plugins_install_rejects_a_set_with_references_or_an_archive() {
for extra in [
vec!["notes"],
vec!["--archive", "/tmp/demo.tar.gz", "--name", "demo"],
] {
let mut args = vec!["mesh-llm", "plugins", "install", "--set", "recommended"];
args.extend(extra);
let error = Cli::try_parse_from(args).expect_err("--set conflicts");
assert_eq!(error.kind(), clap::error::ErrorKind::ArgumentConflict);
}
}
16 changes: 16 additions & 0 deletions mesh/crates/mesh-llm-cli/src/parser/setup_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fn setup_command_parses_without_plugin_fallback() {
"--yes",
"--no-interactive",
"--skip-runtime",
"--skip-plugin-install",
"--verbose",
]);

Expand All @@ -19,13 +20,15 @@ fn setup_command_parses_without_plugin_fallback() {
service,
no_service,
skip_runtime,
skip_plugin_install,
verbose,
}) => {
assert!(yes);
assert!(no_interactive);
assert!(!service);
assert!(!no_service);
assert!(skip_runtime);
assert!(skip_plugin_install);
assert!(verbose);
}
other => panic!("unexpected command: {other:?}"),
Expand All @@ -50,3 +53,16 @@ fn setup_command_rejects_skip_doctor_flag() {
assert_eq!(err.kind(), ErrorKind::UnknownArgument);
assert!(err.to_string().contains("--skip-doctor"));
}

#[test]
fn setup_installs_plugins_by_default_and_skip_plugin_install_opts_out() {
for (flag, expected) in [(None, false), (Some("--skip-plugin-install"), true)] {
let mut args = vec!["mesh-llm", "setup"];
args.extend(flag);
let cli = Cli::parse_from(args);
let Some(Command::Setup(setup)) = cli.command else {
panic!("setup command expected");
};
assert_eq!(setup.skip_plugin_install, expected);
}
}
3 changes: 3 additions & 0 deletions mesh/crates/mesh-llm-cli/src/parser/subcommand_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ pub struct SetupArgs {
/// Skip downloading or configuring the native runtime.
#[arg(long = "skip-runtime")]
pub skip_runtime: bool,
/// Do not install the catalog's `recommended` plugin set.
#[arg(long = "skip-plugin-install")]
pub skip_plugin_install: bool,
/// Print detailed setup paths, commands, and follow-up guidance.
#[arg(long)]
pub verbose: bool,
Expand Down
147 changes: 147 additions & 0 deletions mesh/crates/mesh-llm-commands/src/capsules_witness.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
//! Keeps checkpoint delivery off for a capsules install made through a plugin
//! set.
//!
//! Capsules v0.1.25 and earlier send signed checkpoints to Action State's
//! hosted witness when the `witness` setting is unset; v0.1.26 and later
//! default to off. A plugin set installs capsules without the operator
//! choosing it (`mesh-llm setup` installs the `recommended` set with no
//! prompt), so a set install writes `witness = "off"` into the plugin's
//! settings whichever release the catalog pins, and an operator who wants a
//! witness sets it. Agreed on Mesh-LLM/mesh-llm#3219.

use std::io::Write;

use anyhow::{Context, Result};
use mesh_llm_config::ConfigStore;
use toml_edit::{ArrayOfTables, DocumentMut, Item, Table, value};

const CAPSULES: &str = "capsules";
const WITNESS_SETTING: &str = "witness";

/// For each newly installed set member that is capsules, keep its checkpoints
/// local. Never fails the install: a config that cannot be written is
/// reported with how to set it by hand.
pub fn keep_installed_capsules_local(installed: &[String]) {
if !installed.iter().any(|name| name == CAPSULES) {
return;
}
let mut err = mesh_llm_events::console_err();
let outcome = ConfigStore::default_path().and_then(|store| keep_witness_off(&store));
let _ = match outcome {
Ok(true) => writeln!(
err,
"Capsules keeps its checkpoints on this node: its witness is set to off. To send them to a witness, set `witness` in the capsules plugin settings (Configuration tab or `[plugin.settings]` in config.toml)."
),
Ok(false) => Ok(()),
Err(error) => writeln!(
err,
"⚠️ Could not set the capsules witness to off ({error:#}). Until `witness = \"off\"` is set under `[plugin.settings]` for `capsules`, a capsules release before v0.1.26 sends signed checkpoints to Action State's hosted witness."
),
};
}

/// Set `[[plugin]] name = "capsules"` `settings.witness = "off"` unless the
/// operator already set a witness. True when the file changed.
fn keep_witness_off(store: &ConfigStore) -> Result<bool> {
let mut changed = false;
store
.edit_preserving(|doc| {
changed = set_witness_off(doc)?;
Ok(())
})
.with_context(|| format!("update {}", store.path().display()))?;
Ok(changed)
}

fn set_witness_off(doc: &mut DocumentMut) -> Result<bool> {
if doc.get("plugin").is_none() {
doc["plugin"] = Item::ArrayOfTables(ArrayOfTables::new());
}
let plugins = doc["plugin"]
.as_array_of_tables_mut()
.context("`plugin` in the config is not a list of [[plugin]] tables")?;
let index = plugins
.iter()
.position(|plugin| plugin.get("name").and_then(Item::as_str) == Some(CAPSULES));
let plugin = match index {
Some(index) => plugins.get_mut(index).context("capsules plugin entry")?,
None => {
let mut entry = Table::new();
entry["name"] = value(CAPSULES);
plugins.push(entry);
let last = plugins.len() - 1;
plugins.get_mut(last).context("capsules plugin entry")?
}
};
if plugin.get("settings").is_none() {
plugin["settings"] = Item::Table(Table::new());
}
let settings = plugin["settings"]
.as_table_like_mut()
.context("capsules `settings` in the config is not a table")?;
if settings.contains_key(WITNESS_SETTING) {
return Ok(false);
}
settings.insert(WITNESS_SETTING, value("off"));
Ok(true)
}

#[cfg(test)]
mod tests {
use super::*;

fn run(initial: Option<&str>) -> (bool, String) {
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join("config.toml");
if let Some(initial) = initial {
std::fs::write(&path, initial).unwrap();
}
let store = ConfigStore::open(&path);
let changed = keep_witness_off(&store).unwrap();
(changed, std::fs::read_to_string(&path).unwrap())
}

#[test]
fn a_missing_config_gets_a_capsules_entry_with_the_witness_off() {
let (changed, text) = run(None);
assert!(changed);
let config = mesh_llm_config::parse_config_toml(&text).unwrap();
assert_eq!(config.plugins.len(), 1);
assert_eq!(config.plugins[0].name, "capsules");
assert_eq!(config.plugins[0].settings["witness"].as_str(), Some("off"));
}

#[test]
fn an_operator_chosen_witness_is_left_alone() {
let initial = "[[plugin]]\nname = \"capsules\"\n\n[plugin.settings]\nwitness = \"https://witness.example.org\"\n";
let (changed, text) = run(Some(initial));
assert!(!changed);
assert_eq!(text, initial);
}

#[test]
fn other_settings_and_comments_survive_and_other_plugins_are_untouched() {
let initial = "# my node\n[[plugin]]\nname = \"other\"\n\n[[plugin]]\nname = \"capsules\"\nenabled = true\n\n[plugin.settings]\nshare_record_at_completion = \"off\"\n";
let (changed, text) = run(Some(initial));
assert!(changed);
assert!(text.starts_with("# my node\n"), "{text}");
let config = mesh_llm_config::parse_config_toml(&text).unwrap();
assert_eq!(config.plugins.len(), 2);
let capsules = &config.plugins[1];
assert_eq!(capsules.enabled, Some(true));
assert_eq!(capsules.settings["witness"].as_str(), Some("off"));
assert_eq!(
capsules.settings["share_record_at_completion"].as_str(),
Some("off")
);
assert!(config.plugins[0].settings.is_empty());
}

#[test]
fn a_second_run_changes_nothing() {
let (_, once) = run(None);
let (changed, twice) = run(Some(&once));
assert!(!changed);
assert_eq!(once, twice);
}
}
2 changes: 2 additions & 0 deletions mesh/crates/mesh-llm-commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod agent_cli;
pub mod analytics;
pub mod auth;
pub mod benchmark;
mod capsules_witness;
pub mod config;
pub mod doctor;
pub mod gpus;
Expand All @@ -13,6 +14,7 @@ pub mod model_package;
pub mod operational_logging;
pub mod owner_control;
pub mod plugin;
pub mod plugin_sets;
pub mod private_nodes;
pub mod runtime_native;
pub mod setup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ pub(super) fn format_plugin(command: &mesh_llm_cli::PluginCommand, assembly: &mu
match command {
PluginCommand::Install {
reference,
set,
archive,
name,
version,
} => {
assembly.command.push_str(" plugins install");
assembly.redact("reference", !reference.is_empty());
assembly.redact("--set", set.is_some());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] plugins install --set now emits --set [REDACTED], but the command-summary grammars don't recognize that option, so the new command loses its operational log summary. Add the redacted option to both the Rust and console grammars and cover it with an acceptance case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Ethan's agent) Fixed in 4f211c7. --set is now a redacted option of plugins install in both the Rust (mesh-llm-events) and console grammars, and it conflicts with reference, --archive, --name and --version, as the CLI does. --skip-plugin-install had the same gap in the setup flags and is added in both grammars too. Acceptance cases: plugin_set_install_and_setup_plugin_opt_out_survive_producer_sanitization (producer to sanitizer round trip, plus the conflicting shapes rejected) and the matching console test in command-summary.test.ts.

assembly.redact("--archive", archive.is_some());
assembly.redact("--name", name.is_some());
assembly.redact("--version", version.is_some());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub(super) fn format_command(command: &Command, assembly: &mut SummaryAssembly)
service,
no_service,
skip_runtime,
skip_plugin_install,
verbose,
}) => {
assembly.command.push_str(" setup");
Expand All @@ -70,6 +71,7 @@ pub(super) fn format_command(command: &Command, assembly: &mut SummaryAssembly)
assembly.flag("service", *service);
assembly.flag("no-service", *no_service);
assembly.flag("skip-runtime", *skip_runtime);
assembly.flag("skip-plugin-install", *skip_plugin_install);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
assembly.flag("verbose", *verbose);
}
Command::Uninstall(UninstallArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,36 @@ fn uninstall_boolean_flags_survive_producer_sanitization() {
}
}

#[test]
fn plugin_set_install_and_setup_plugin_opt_out_survive_producer_sanitization() {
let summaries = [
parsed_summary(&["mesh-llm", "plugins", "install", "--set", "private-set"]),
parsed_summary(&[
"mesh-llm",
"setup",
"--skip-runtime",
"--skip-plugin-install",
]),
];
assert_eq!(summaries[0], "mesh-llm plugins install --set [REDACTED]");
assert_eq!(
summaries[1],
"mesh-llm setup --skip-runtime --skip-plugin-install"
);
for summary in summaries {
let sanitized = CliCommandSummary::sanitize(&summary)
.unwrap_or_else(|| panic!("producer omitted valid summary: {summary}"));
assert_eq!(sanitized.as_str(), summary);
}
// A set install names no reference or archive.
for invalid in [
"mesh-llm plugins install reference [REDACTED] --set [REDACTED]",
"mesh-llm plugins install --set [REDACTED] --archive [REDACTED] --name [REDACTED]",
] {
assert!(CliCommandSummary::sanitize(invalid).is_none(), "{invalid}");
}
}

#[test]
fn command_summary_retains_static_prefix_nested_names_and_redacts_plugin_values() {
let summary = parsed_summary(&[
Expand Down
Loading
Loading