Fix headless build after permission rules signature change
PR #27 (headless mode) and PR #28 (permission rule patterns) were developed in parallel. #28 added an arguments parameter to decision_for and grant_for_session, and merging it after #27 left the two call sites in headless.rs on the old signatures, so cargo clippy --tests no longer compiles on development. Pass the tool call's raw arguments to decision_for, and an empty string for --allow-tool grants, which records the bare tool name and keeps the whole-tool grant the flag intends.
paydii committed
Jul 6, 2026 at 20:52 UTC
43cd3513b05bbd3716449e46a4e1e162d3cef3ba
1 file changed
+2
-2
src/headless.rs
+2
-2
@@ -144,7 +144,7 @@ pub async fn run(config: HeadlessConfig) -> i32 {
144
// Fresh permission state for the run, then apply the flag grants.
145
permissions::reset_session(HEADLESS_SESSION);
146
for tool in &config.allow_tools {
147
- permissions::grant_for_session(HEADLESS_SESSION, tool);
147
+ permissions::grant_for_session(HEADLESS_SESSION, tool, "");
148
}
149
let denied: HashSet<&str> = config.deny_tools.iter().map(String::as_str).collect();
150
@@ -269,7 +269,7 @@ async fn run_prompt(
269
log::info!("headless: {} blocked by --deny-tool", tc.name);
270
deny_flag_denial(&tc.name)
271
} else {
272
- match permissions::decision_for(HEADLESS_SESSION, &tc.name) {
272
+ match permissions::decision_for(HEADLESS_SESSION, &tc.name, &tc.arguments) {
273
permissions::Decision::Allow => {
274
tools::execute_tool(&tc.name, &tc.arguments).await
275
}