Skip to content

Commit 74c9200

Browse files
Duncanwpfleger96
andcommitted
Merge remote-tracking branch 'origin/main' into duncan/permission-policy
* origin/main: fix(desktop): welcome banner overlap and missing dismiss control (#5330) fix(desktop): prevent horizontal clipping in Prompt Context modal (#5324) chore(release): release Buzz Relay version 0.2.1 (#2856) chore(release): release Buzz Desktop version 0.5.8 (#5326) fix(buzz-agent): recover from 400-shaped image rejections; unbound benchmark agent rounds (#5318) Revert "fix(acp): reject unattended permission requests" (#5323) feat(desktop): unify add agent flows (#5015) fix(buzz-agent): budget summarizer reasoning separately so it cannot starve the handoff summary (#5248) infra: bind development services to loopback (#4871) chore(release): release Buzz Desktop version 0.5.7 (#5252) fix(desktop): isolate relay admission tests (#5221) fix(desktop): externalize boot <style> to prevent Tauri CSP nonce override (#5242) fix(desktop): let imported and recovered identities finish onboarding (#5228) Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
2 parents d808c4b + f029dea commit 74c9200

48 files changed

Lines changed: 1621 additions & 833 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.release/desktop-candidate.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"schema": 2,
3-
"version": "0.5.6",
4-
"base_sha": "78c87ae20e182fffdd99744d6c9ff99df82b159c",
5-
"previous_tag": "desktop-v0.5.5",
6-
"previous_base_sha": "25a9cf1be6d245fbd7373cb1160dbc790baf5bd5",
7-
"previous_merge_sha": "8342dfcc5890b81a269a8ec3db73a8a56f76ce79",
8-
"tag": "desktop-v0.5.6",
9-
"commit_count": 74
3+
"version": "0.5.8",
4+
"base_sha": "6a17d035f79ad582ca3f4f3cdc38d376f2c4087f",
5+
"previous_tag": "desktop-v0.5.7",
6+
"previous_base_sha": "74b913cff8512c015dc6f1a7473b253fa803f954",
7+
"previous_merge_sha": "13c9e900c84cac1e2c8eeb7551bd1510ecb544d3",
8+
"tag": "desktop-v0.5.8",
9+
"commit_count": 4
1010
}

‎CHANGELOG.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Changelog
22

3+
## v0.5.8
4+
5+
### Desktop and shared changes
6+
7+
- feat(desktop): unify add agent flows ([#5015](https://github.com/block/buzz/pull/5015)) ([`02f640bc4559c48ac0c2ec595ef34dd2c294b0db`](https://github.com/block/buzz/commit/02f640bc4559c48ac0c2ec595ef34dd2c294b0db))
8+
- fix(buzz-agent): budget summarizer reasoning separately so it cannot starve the handoff summary ([#5248](https://github.com/block/buzz/pull/5248)) ([`c7b663680a29a837dbd2fdde810f239f3d303025`](https://github.com/block/buzz/commit/c7b663680a29a837dbd2fdde810f239f3d303025))
9+
10+
### Other repository changes
11+
12+
- Revert "fix(acp): reject unattended permission requests" ([#5323](https://github.com/block/buzz/pull/5323)) ([`6a17d035f79ad582ca3f4f3cdc38d376f2c4087f`](https://github.com/block/buzz/commit/6a17d035f79ad582ca3f4f3cdc38d376f2c4087f))
13+
- infra: bind development services to loopback ([#4871](https://github.com/block/buzz/pull/4871)) ([`65834d68d0d3441c4e628540d6d5c8b0a2e757c9`](https://github.com/block/buzz/commit/65834d68d0d3441c4e628540d6d5c8b0a2e757c9))
14+
15+
[Compare desktop-v0.5.7...desktop-v0.5.8](https://github.com/block/buzz/compare/desktop-v0.5.7...desktop-v0.5.8)
16+
17+
## v0.5.7
18+
19+
### Desktop and shared changes
20+
21+
- fix(desktop): isolate relay admission tests ([#5221](https://github.com/block/buzz/pull/5221)) ([`74b913cff8512c015dc6f1a7473b253fa803f954`](https://github.com/block/buzz/commit/74b913cff8512c015dc6f1a7473b253fa803f954))
22+
- fix(desktop): externalize boot <style> to prevent Tauri CSP nonce override ([#5242](https://github.com/block/buzz/pull/5242)) ([`dcc1231d6d6935819597bc42f7bc59fa0a47c8e5`](https://github.com/block/buzz/commit/dcc1231d6d6935819597bc42f7bc59fa0a47c8e5))
23+
- fix(desktop): let imported and recovered identities finish onboarding ([#5228](https://github.com/block/buzz/pull/5228)) ([`a5a9240241ad584c839f79af546df9bf0216ca1f`](https://github.com/block/buzz/commit/a5a9240241ad584c839f79af546df9bf0216ca1f))
24+
- Recover from max-token response truncation ([#5223](https://github.com/block/buzz/pull/5223)) ([`2b873cf208bf2143bfdb77dbe34b04edcdb723a1`](https://github.com/block/buzz/commit/2b873cf208bf2143bfdb77dbe34b04edcdb723a1))
25+
26+
### Other repository changes
27+
28+
- fix(mobile): keep latest messages above composer ([#4981](https://github.com/block/buzz/pull/4981)) ([`07999425dca4a94ca0dea4f47d674661ea52fac3`](https://github.com/block/buzz/commit/07999425dca4a94ca0dea4f47d674661ea52fac3))
29+
30+
[Compare desktop-v0.5.6...desktop-v0.5.7](https://github.com/block/buzz/compare/desktop-v0.5.6...desktop-v0.5.7)
31+
332
## v0.5.6
433

534
### Desktop and shared changes

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎benchmarks/harbor-buzz-orchestra/src/harbor_buzz_orchestra/container_runtime.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from .provisioning import AgentCredential, TrialHandle
2525
from .runtime import RuntimeResult
2626

27-
DEFAULT_MAX_AGENT_ROUNDS = 32
27+
DEFAULT_MAX_AGENT_ROUNDS = 0 # 0 = unbounded (BUZZ_AGENT_MAX_ROUNDS=0); the trial budget is the clock
2828
# Container-side layout for the uploaded Buzz stack.
2929
REMOTE_ROOT = "/opt/buzz"
3030
REMOTE_BIN = f"{REMOTE_ROOT}/bin"
@@ -80,8 +80,8 @@ def __init__(
8080
readiness_timeout_seconds: float = 60.0,
8181
poll_seconds: float = 1.0,
8282
) -> None:
83-
if max_agent_rounds <= 0:
84-
raise ValueError("max_agent_rounds must be positive")
83+
if max_agent_rounds < 0:
84+
raise ValueError("max_agent_rounds must be >= 0 (0 = unbounded)")
8585
if readiness_timeout_seconds <= 0:
8686
raise ValueError("readiness_timeout_seconds must be positive")
8787
self.logs_dir = Path(logs_dir)

‎benchmarks/harbor-buzz-orchestra/tests/test_container_runtime.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ async def test_forwarder_bridges_the_canonical_relay_address(tmp_path):
247247
rt._ws_authority("http://relay")
248248

249249

250-
@pytest.mark.parametrize(("configured", "expected"), [(None, "32"), (7, "7")])
250+
@pytest.mark.parametrize(("configured", "expected"), [(None, "0"), (7, "7")])
251251
async def test_launch_wires_the_desktop_environment(tmp_path, configured, expected):
252252
manifest = write_manifest(tmp_path)
253253
agent_class = manifest.roster[0]
@@ -290,9 +290,12 @@ async def test_launch_wires_the_desktop_environment(tmp_path, configured, expect
290290
)
291291

292292

293-
def test_runtime_rejects_unbounded_agent_rounds(tmp_path):
294-
with pytest.raises(ValueError, match="positive"):
295-
runtime(tmp_path, max_agent_rounds=0)
293+
def test_runtime_validates_construction_bounds(tmp_path):
294+
# 0 is legal and means unbounded (BUZZ_AGENT_MAX_ROUNDS=0); the trial
295+
# budget is the clock. Only negatives are rejected.
296+
runtime(tmp_path, max_agent_rounds=0)
297+
with pytest.raises(ValueError, match="unbounded"):
298+
runtime(tmp_path, max_agent_rounds=-1)
296299
with pytest.raises(ValueError, match="positive"):
297300
runtime(tmp_path, readiness_timeout_seconds=0)
298301

‎crates/buzz-acp/src/acp.rs‎

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub struct AcpClient {
235235
/// Under `ask` the full map is `pending_permissions` below.
236236
pending_permission_id: Option<serde_json::Value>,
237237
/// Whether we have already sent a response to the pending permission request.
238-
/// Guards against double-response if a timeout fires after the rejection
238+
/// Guards against double-response if a timeout fires after the allow_once
239239
/// response was written but before `pending_permission_id` was cleared.
240240
permission_responded: bool,
241241
/// Pending `session/request_permission` entries under the `ask` policy.
@@ -1724,8 +1724,7 @@ impl AcpClient {
17241724
///
17251725
/// While waiting, handles:
17261726
/// - `session/update` notifications → logged via tracing
1727-
/// - `session/request_permission` requests → rejected unless an owner has
1728-
/// already selected a non-interactive permission mode at session setup
1727+
/// - `session/request_permission` requests → auto-approved with `allow_once`
17291728
/// - Any other messages → debug-logged and ignored; if they carry an `id`
17301729
/// (i.e. they are requests, not notifications), a JSON-RPC -32601 error is sent.
17311730
///
@@ -3762,53 +3761,42 @@ mod tests {
37623761
assert_eq!(StopReason::from_str("Refusal"), Some(StopReason::Refusal));
37633762
}
37643763

3765-
fn options(json: &str) -> Vec<serde_json::Value> {
3766-
serde_json::from_str(json).expect("option list")
3767-
}
3768-
3769-
fn outcome(response: &serde_json::Value) -> Option<&str> {
3770-
response["result"]["outcome"]["outcome"].as_str()
3771-
}
3772-
3773-
/// The offered `allow_once` and `allow_always` options must be ignored:
3774-
/// there is no human to click them, so choosing either would make every
3775-
/// admitted prompt an implicit approval. `optionId`s are deliberately
3776-
/// non-obvious to prove they are matched by `kind`, never hardcoded.
37773764
#[test]
3778-
fn permission_requests_select_reject_once_not_allow_once() {
3779-
let options = options(
3765+
fn find_allow_once_by_kind_not_by_option_id() {
3766+
// optionId values are intentionally non-obvious to prove we don't hardcode them.
3767+
let options: Vec<serde_json::Value> = serde_json::from_str(
37803768
r#"[
37813769
{"optionId": "opt-reject-42", "name": "Reject", "kind": "reject_once"},
37823770
{"optionId": "opt-allow-99", "name": "Allow once", "kind": "allow_once"},
37833771
{"optionId": "opt-always-7", "name": "Always allow", "kind": "allow_always"}
37843772
]"#,
3785-
);
3773+
)
3774+
.unwrap();
37863775

3787-
let response =
3788-
permission_denial_response(&serde_json::json!(7), &options).expect("denial response");
3776+
let allow_once = options
3777+
.iter()
3778+
.find(|opt| opt.get("kind").and_then(|k| k.as_str()) == Some("allow_once"));
37893779

3790-
assert_eq!(outcome(&response), Some("selected"));
3791-
assert_eq!(
3792-
response["result"]["outcome"]["optionId"].as_str(),
3793-
Some("opt-reject-42"),
3794-
"must select reject_once even when allow options are offered"
3795-
);
3780+
assert!(allow_once.is_some(), "should find allow_once option");
3781+
let opt = allow_once.unwrap();
3782+
// Found by kind, not by hardcoded optionId
3783+
assert_eq!(opt["kind"].as_str(), Some("allow_once"));
3784+
assert_eq!(opt["optionId"].as_str(), Some("opt-allow-99"));
37963785
}
37973786

3798-
/// Fail-closed backstop: an adapter that offers no `reject_once` must still
3799-
/// be denied, via the protocol's cancelled outcome rather than an error or
3800-
/// an approval.
38013787
#[test]
3802-
fn permission_request_without_reject_once_is_cancelled() {
3803-
let options = options(
3788+
fn find_allow_once_returns_none_when_absent() {
3789+
let options: Vec<serde_json::Value> = serde_json::from_str(
38043790
r#"[
3805-
{"optionId": "opt-allow-99", "name": "Allow once", "kind": "allow_once"},
3806-
{"optionId": "opt-always-7", "name": "Always allow", "kind": "allow_always"}
3791+
{"optionId": "reject-1", "name": "Reject", "kind": "reject_once"},
3792+
{"optionId": "reject-always", "name": "Always reject", "kind": "reject_always"}
38073793
]"#,
3808-
);
3794+
)
3795+
.unwrap();
38093796

3810-
let response = permission_denial_response(&serde_json::json!("req-1"), &options)
3811-
.expect("cancelled response");
3797+
let allow_once = options
3798+
.iter()
3799+
.find(|opt| opt.get("kind").and_then(|k| k.as_str()) == Some("allow_once"));
38123800

38133801
assert_eq!(outcome(&response), Some("cancelled"));
38143802
assert_eq!(
@@ -3845,17 +3833,22 @@ mod tests {
38453833
}
38463834

38473835
#[test]
3848-
fn find_reject_once_by_kind() {
3849-
let options =
3850-
options(r#"[{"optionId": "rej-x", "name": "Reject", "kind": "reject_once"}]"#);
3836+
fn find_reject_once_fallback_when_no_allow_once() {
3837+
let options: Vec<serde_json::Value> = serde_json::from_str(
3838+
r#"[{"optionId": "rej-x", "name": "Reject", "kind": "reject_once"}]"#,
3839+
)
3840+
.unwrap();
38513841

3852-
let response =
3853-
permission_denial_response(&serde_json::json!(1), &options).expect("denial response");
3842+
let allow_once = options
3843+
.iter()
3844+
.find(|opt| opt.get("kind").and_then(|k| k.as_str()) == Some("allow_once"));
3845+
assert!(allow_once.is_none());
38543846

3855-
assert_eq!(
3856-
response["result"]["outcome"]["optionId"].as_str(),
3857-
Some("rej-x")
3858-
);
3847+
let reject_once = options
3848+
.iter()
3849+
.find(|opt| opt.get("kind").and_then(|k| k.as_str()) == Some("reject_once"));
3850+
assert!(reject_once.is_some());
3851+
assert_eq!(reject_once.unwrap()["optionId"].as_str(), Some("rej-x"));
38593852
}
38603853

38613854
#[test]

‎crates/buzz-acp/src/config.rs‎

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ impl std::fmt::Display for RespondTo {
121121
/// `session/request_permission` escalations may still cross ACP when the model
122122
/// chooses manual approval for a specific call.
123123
/// - `acceptEdits` — auto-approve file edits, still ask for other tools.
124+
/// - `bypassPermissions` — skip the permission flow entirely.
124125
/// - `dontAsk` — never prompt; reject anything that would require permission.
125126
/// - `plan` — planning-only mode (no tool execution).
126127
#[derive(Debug, Clone, Copy, PartialEq, clap::ValueEnum)]
@@ -147,6 +148,9 @@ pub enum PermissionMode {
147148
/// Auto-approve file edits, still ask for other tools.
148149
#[value(alias = "acceptEdits")]
149150
AcceptEdits,
151+
/// Skip the permission flow entirely.
152+
#[value(alias = "bypassPermissions")]
153+
BypassPermissions,
150154
/// Never prompt; reject anything that would require permission.
151155
#[value(alias = "dontAsk")]
152156
DontAsk,
@@ -163,6 +167,7 @@ impl PermissionMode {
163167
Self::Default => "default",
164168
Self::Auto => "auto",
165169
Self::AcceptEdits => "acceptEdits",
170+
Self::BypassPermissions => "bypassPermissions",
166171
Self::DontAsk => "dontAsk",
167172
Self::Plan => "plan",
168173
}
@@ -624,6 +629,7 @@ pub struct CliArgs {
624629
///
625630
/// Desktop injects the resolved per-agent or fleet-wide value.
626631
/// Headless installations should leave this unset (defaults to `reject`).
632+
627633
#[arg(
628634
long,
629635
env = "BUZZ_ACP_PERMISSION_POLICY",
@@ -1678,6 +1684,7 @@ mod tests {
16781684
Some(PermissionMode::DontAsk),
16791685
)
16801686
.expect("test config"),
1687+
16811688
respond_to: RespondTo::Anyone,
16821689
respond_to_allowlist: HashSet::new(),
16831690
allowed_respond_to: Vec::new(),
@@ -2478,21 +2485,29 @@ channels = "ALL"
24782485
fn test_permission_mode_wire_strings() {
24792486
assert_eq!(PermissionMode::Default.as_wire_str(), "default");
24802487
assert_eq!(PermissionMode::AcceptEdits.as_wire_str(), "acceptEdits");
2488+
assert_eq!(
2489+
PermissionMode::BypassPermissions.as_wire_str(),
2490+
"bypassPermissions"
2491+
);
24812492
assert_eq!(PermissionMode::DontAsk.as_wire_str(), "dontAsk");
24822493
assert_eq!(PermissionMode::Plan.as_wire_str(), "plan");
24832494
}
24842495

24852496
#[test]
24862497
fn test_permission_mode_is_default() {
24872498
assert!(PermissionMode::Default.is_default());
2499+
assert!(!PermissionMode::BypassPermissions.is_default());
24882500
assert!(!PermissionMode::AcceptEdits.is_default());
24892501
assert!(!PermissionMode::DontAsk.is_default());
24902502
assert!(!PermissionMode::Plan.is_default());
24912503
}
24922504

24932505
#[test]
24942506
fn test_permission_mode_display() {
2495-
assert_eq!(format!("{}", PermissionMode::DontAsk), "dontAsk");
2507+
assert_eq!(
2508+
format!("{}", PermissionMode::BypassPermissions),
2509+
"bypassPermissions"
2510+
);
24962511
assert_eq!(format!("{}", PermissionMode::Default), "default");
24972512
}
24982513

@@ -2504,9 +2519,10 @@ channels = "ALL"
25042519
Some(PermissionMode::DontAsk),
25052520
)
25062521
.expect("test config");
2522+
25072523
let s = config.summary();
25082524
assert!(
2509-
s.contains("permission_mode=dontAsk"),
2525+
s.contains("permission_mode=bypassPermissions"),
25102526
"summary should include permission_mode, got: {s}"
25112527
);
25122528
}
@@ -2524,7 +2540,7 @@ channels = "ALL"
25242540
}
25252541

25262542
#[test]
2527-
fn test_default_config_rejects_interactive_permissions() {
2543+
fn test_default_config_uses_bypass_permissions() {
25282544
let config = test_config(SubscribeMode::Mentions);
25292545
assert_eq!(
25302546
config.permission_config.effective_mode,
@@ -2540,6 +2556,7 @@ channels = "ALL"
25402556
let cases = [
25412557
("default", PermissionMode::Default),
25422558
("accept-edits", PermissionMode::AcceptEdits),
2559+
("bypass-permissions", PermissionMode::BypassPermissions),
25432560
("dont-ask", PermissionMode::DontAsk),
25442561
("plan", PermissionMode::Plan),
25452562
];
@@ -2554,12 +2571,14 @@ channels = "ALL"
25542571

25552572
#[test]
25562573
fn test_permission_mode_value_enum_camel_case_aliases() {
2557-
// Operators may set env vars using the camelCase wire-format strings.
2558-
// The #[value(alias)] attributes ensure these parse correctly.
2574+
// Operators may set env vars using the camelCase wire-format strings
2575+
// (e.g. BUZZ_ACP_PERMISSION_MODE=bypassPermissions). The #[value(alias)]
2576+
// attributes ensure these parse correctly.
25592577
use clap::ValueEnum;
25602578
let cases = [
25612579
("default", PermissionMode::Default),
25622580
("acceptEdits", PermissionMode::AcceptEdits),
2581+
("bypassPermissions", PermissionMode::BypassPermissions),
25632582
("dontAsk", PermissionMode::DontAsk),
25642583
("plan", PermissionMode::Plan),
25652584
];
@@ -2572,18 +2591,6 @@ channels = "ALL"
25722591
}
25732592
}
25742593

2575-
#[test]
2576-
fn test_permission_mode_rejects_unattended_bypass() {
2577-
use clap::ValueEnum;
2578-
2579-
for input in ["bypass-permissions", "bypassPermissions"] {
2580-
assert!(
2581-
PermissionMode::from_str(input, true).is_err(),
2582-
"{input:?} must not disable the ACP permission boundary"
2583-
);
2584-
}
2585-
}
2586-
25872594
/// Helper: resolve idle_timeout_secs using the same precedence logic as Config::from_args.
25882595
/// Precedence: explicit --idle-timeout > --turn-timeout (deprecated) > `DEFAULT_IDLE_TIMEOUT_SECS`.
25892596
fn resolve_idle_timeout(idle: Option<u64>, turn: Option<u64>) -> u64 {

‎crates/buzz-acp/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6369,6 +6369,7 @@ mod build_mcp_servers_tests {
63696369
None,
63706370
)
63716371
.expect("test config"),
6372+
63726373
respond_to: config::RespondTo::Anyone,
63736374
respond_to_allowlist: std::collections::HashSet::new(),
63746375
allowed_respond_to: vec![],
@@ -6595,6 +6596,7 @@ mod error_outcome_emission_tests {
65956596
None,
65966597
)
65976598
.expect("test config"),
6599+
65986600
respond_to: config::RespondTo::Anyone,
65996601
respond_to_allowlist: HashSet::new(),
66006602
allowed_respond_to: vec![],

0 commit comments

Comments
 (0)