enable WebFetch/WebSearch via --settings permission grant
This commit is contained in:
parent
780f80615d
commit
1cd75ee857
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,12 @@ use crate::paths;
|
|||
/// Followed by SYSTEM.md content at runtime. Source: `prompts/shard_preamble.md`.
|
||||
const SYSTEM_PROMPT_PREAMBLE: &str = include_str!("../prompts/shard_preamble.md");
|
||||
|
||||
/// Permissions JSON passed via --settings. Without this, WebFetch and
|
||||
/// WebSearch fall back to interactive permission prompts, which the daemon
|
||||
/// has no way to answer (claude is a child process). Allowing them broadly
|
||||
/// is fine: the lab is sandboxed, and the tools are read-only HTTP GET.
|
||||
const SHARD_SETTINGS_JSON: &str = r#"{"permissions":{"allow":["WebFetch","WebSearch"]}}"#;
|
||||
|
||||
/// One stream-json event from claude's stdout. Only fields we care about.
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
|
|
@ -131,6 +137,8 @@ impl ShardSession {
|
|||
&cfg.mcp_config_path.to_string_lossy(),
|
||||
"--system-prompt",
|
||||
&system_prompt,
|
||||
"--settings",
|
||||
SHARD_SETTINGS_JSON,
|
||||
]);
|
||||
cmd.current_dir(&identity_dir);
|
||||
cmd.stdin(Stdio::piped());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue