fix(desktop): seed nest Claude settings with buzz CLI allowlist - #5263
fix(desktop): seed nest Claude settings with buzz CLI allowlist#5263thomaspblock wants to merge 1 commit into
Conversation
Since #4609 the ACP harness rejects every session/request_permission (fail closed) and desktop managed sessions run in dontAsk mode with no in-app approval prompt. Claude Code raises a permission request for any Bash pattern not pre-authorized in its settings, so managed Claude agents lost all access to the bundled `buzz` CLI — they could not read channels or send replies (#5262, #5260). Claude Code evaluates permissions.allow rules before the permission mode, so a project-level allow rule survives dontAsk. Seed `<nest>/.claude/settings.json` with `Bash(buzz)` and `Bash(buzz:*)` at nest creation: managed sessions start with the nest root as cwd and the ACP adapter passes settingSources ["user", "project", "local"], so the rules apply to every managed Claude agent without touching the user's own ~/.claude/settings.json. The merge is conservative: existing settings are preserved, only missing rules are appended, unparseable or unexpectedly-shaped files are left untouched, and the write is atomic (temp file + persist, matching refresh_skill_md_if_stale). Idempotent across launches. This deliberately does not reopen the blanket auto-approval that #4609 removed: only the platform's own CLI is pre-authorized, agent-side, which #4609 explicitly scopes as outside the harness guarantee. The broader fix (harness permission policy with desktop approval cards) is in flight as #5106; this unblocks agents until it lands. Known limitation: allow rules match single commands only — `buzz feed get` runs, but `buzz ... | head` or `buzz ...; echo $?` still raises a request and is rejected under dontAsk. Fixes #5262. Co-authored-by: Thomas Petersen <thomasp@squareup.com> Signed-off-by: Thomas Petersen <thomasp@squareup.com>
|
yea need this one in asap boys |
Yeah, spent about 90 minutes on this one today until narrowed it down to the conflicting startup and config. Anyways, reported, and being handled it appears. |
|
I tested this patch strategy against Claude Code 2.1.220 on Buzz Desktop 0.5.6, macOS, with a locally managed agent connected to a self-hosted relay. The proposed The fresh headless Claude process emitted: This matches the current Claude Code workspace-trust behavior: project I then moved the exact same rules: {
"permissions": {
"allow": [
"Bash(buzz)",
"Bash(buzz:*)"
]
}
}to Recommendation: seed and conservatively merge I posted the full reproduction on #5262 as well. |
Fixes #5262. Related: #5260 (same root cause, independently reported twice today).
Problem
Since #4609 the ACP harness rejects every
session/request_permission(fail closed), and desktop managed sessions run indontAskmode with no in-app approval prompt. Claude Code raises a permission request for any Bash pattern not pre-authorized in its settings — so managed Claude agents lost all access to the bundledbuzzCLI. They cannot read channels or send replies while appearing online. Reported by an X user and reproduced independently on Linux self-hosted, Windows/ECS, and macOS/hosted (#5260).Fix
Claude Code evaluates
permissions.allowrules before the permission mode, so a project-level allow rule survivesdontAsk(confirmed as a manual workaround by a reporter in #5260). This PR seeds<nest>/.claude/settings.jsonwithBash(buzz)andBash(buzz:*)duringensure_nest_at:claude-agent-acpadapter passessettingSources: ["user", "project", "local"], so the project rules apply to every managed Claude agent.~/.claude/settings.jsonis never touched.refresh_skill_md_if_stale), idempotent across launches.This deliberately does not reopen the blanket auto-approval #4609 removed — only the platform's own CLI is pre-authorized, agent-side, which #4609 explicitly scopes as outside the harness guarantee ("An agent that pre-authorizes tools in its own configuration … is outside this harness"). The broader fix (harness permission policy + desktop approval cards) is in flight as #5106; this unblocks agents until it lands.
Known limitation
Allow rules match single commands only:
buzz feed getruns, butbuzz ... | headorbuzz ...; echo $?still raises a request and is rejected underdontAsk. Agents that chain the CLI with shell operators remain affected until #5106.Testing
cargo test --libindesktop/src-tauriat724fed49d: 2280 passed, 0 failed (2275 base + 5 newclaude_settingstests: create-when-absent, merge-preserving-other-keys, idempotence, invalid-JSON untouched, unexpected-shape untouched)cargo clippy --lib: no warningscargo fmt -- --check: clean