update_meta_inputs: require operator approval, rename to request_update_meta_inputs

This commit is contained in:
damocles 2026-05-22 09:26:09 +02:00 committed by Mara
parent 597e4ba03a
commit 3e098c56ff
7 changed files with 94 additions and 28 deletions

View file

@ -813,6 +813,9 @@ pub struct UpdateMetaInputsArgs {
/// Pass an empty list to update ALL inputs.
#[serde(default)]
pub inputs: Vec<String>,
/// Optional description shown on the dashboard approval card.
#[serde(default)]
pub description: Option<String>,
}
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
@ -1031,31 +1034,36 @@ impl ManagerServer {
}
#[tool(
description = "Run `nix flake update` on the meta flake and commit the resulting \
`flake.lock` changes. Pass specific input names to update only those inputs \
(e.g. `[\"bitburner-agent\"]`), or pass an empty list to update ALL inputs. \
Blocks until the lock step completes (~30-120s depending on download size). \
description = "Queue an approval for the operator to run `nix flake update` on the \
meta flake and commit the resulting lock changes. Pass specific input names to update \
only those inputs (e.g. `[\"bitburner-agent\"]`), or pass an empty list to update ALL \
inputs. Returns immediately the lock update runs when the operator approves. \
Does NOT trigger container rebuilds call `update` on each affected agent \
separately after the lock settles."
separately after the approval resolves."
)]
async fn update_meta_inputs(
async fn request_update_meta_inputs(
&self,
Parameters(args): Parameters<UpdateMetaInputsArgs>,
) -> String {
let log = format!("{args:?}");
run_tool_envelope("update_meta_inputs", log, async move {
run_tool_envelope("request_update_meta_inputs", log, async move {
let label = if args.inputs.is_empty() {
"all inputs".to_string()
} else {
args.inputs.join(", ")
};
let (resp, retries) = self
.dispatch(hive_sh4re::ManagerRequest::UpdateMetaInputs {
.dispatch(hive_sh4re::ManagerRequest::RequestUpdateMetaInputs {
inputs: args.inputs,
description: args.description,
})
.await;
annotate_retries(
format_ack(resp, "update_meta_inputs", format!("lock updated: {label}")),
format_ack(
resp,
"request_update_meta_inputs",
format!("approval queued: {label}"),
),
retries,
)
})