Skip to content

Commit 5f4a420

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr-1991-admission-fixes
* origin/main: chore(release): release Buzz Desktop version 0.4.11 (#2010) feat(desktop): allow agents to manage relay profiles (#2009)
2 parents cfabf5a + 64c63da commit 5f4a420

17 files changed

Lines changed: 87 additions & 7 deletions

File tree

‎.intersect/sadscan.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Cargo registry checksums are integrity hashes generated by Cargo, not payment data.
2+
exclude_rules_for_files:
3+
sq.pii.cc.visa:
4+
- Cargo.lock

‎CHANGELOG.md‎

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

3+
## v0.4.11
4+
5+
- Fix policy receipts for cold-launch invite links ([#2005](https://github.com/block/buzz/pull/2005)) ([`1d8d006a`](https://github.com/block/buzz/commit/1d8d006aaf078ffd5b92eae06334b7bb908b680e))
6+
- Preserve persistent agent audience order ([#1989](https://github.com/block/buzz/pull/1989)) ([`fb8e6827`](https://github.com/block/buzz/commit/fb8e6827c758c73c9c6e16965dcdcecd00a5827c))
7+
- feat(desktop): create channels in sections ([#1996](https://github.com/block/buzz/pull/1996)) ([`9b649740`](https://github.com/block/buzz/commit/9b6497402f343e380f6c79b97a01c2d52bd12f17))
8+
- feat(desktop): graduate community rail ([#1995](https://github.com/block/buzz/pull/1995)) ([`f06b59ff`](https://github.com/block/buzz/commit/f06b59ff13bef0c031c8e4c3bdf979e120ea76d5))
9+
10+
311
## v0.4.10
412

513
- feat(desktop): onboarding step dots, identity/key page restyle, overflow scroll ([#1993](https://github.com/block/buzz/pull/1993)) ([`f2522995c`](https://github.com/block/buzz/commit/f2522995cbea67c96b79d5de6c19c665e465027d))

‎desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "buzz",
33
"private": true,
4-
"version": "0.4.10",
4+
"version": "0.4.11",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

‎desktop/src-tauri/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.

‎desktop/src-tauri/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "buzz-desktop"
5-
version = "0.4.10"
5+
version = "0.4.11"
66
description = "Buzz desktop app"
77
authors = ["you"]
88
edition = "2021"

‎desktop/src-tauri/src/app_state.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ pub struct AppState {
2525
/// restore. `apply_workspace` consumes it after installing the workspace
2626
/// relay and identity, so agents never start against the fallback relay.
2727
pub managed_agent_restore_pending: AtomicBool,
28+
/// Whether desktop may repair managed-agent kind:0 profiles from its local
29+
/// records. Disabled by the agent-managed profiles experiment so an agent's
30+
/// own profile updates are not overwritten on start or restore.
31+
pub managed_agent_profile_reconcile_enabled: AtomicBool,
2832
/// Shared shutdown signal checked by launch-time agent restoration.
2933
pub shutdown_started: AtomicBool,
3034
/// Serializes the restore spawn/register transition with shutdown cleanup,
@@ -161,6 +165,7 @@ pub fn build_app_state() -> AppState {
161165
.unwrap_or_else(|_| reqwest::Client::new()),
162166
relay_url_override: Mutex::new(None),
163167
managed_agent_restore_pending: AtomicBool::new(false),
168+
managed_agent_profile_reconcile_enabled: AtomicBool::new(true),
164169
shutdown_started: AtomicBool::new(false),
165170
managed_agent_restore_transition: Mutex::new(()),
166171
identity_mutation: Mutex::new(()),

‎desktop/src-tauri/src/commands/agent_settings.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use tauri::{AppHandle, Manager};
1+
use std::sync::atomic::Ordering;
2+
use tauri::{AppHandle, Manager, State};
23

34
use crate::{
45
app_state::AppState,
@@ -10,6 +11,13 @@ use crate::{
1011
util::now_iso,
1112
};
1213

14+
#[tauri::command]
15+
pub fn set_agent_managed_profiles(enabled: bool, state: State<'_, AppState>) {
16+
state
17+
.managed_agent_profile_reconcile_enabled
18+
.store(!enabled, Ordering::Release);
19+
}
20+
1321
#[tauri::command]
1422
pub async fn set_managed_agent_start_on_app_launch(
1523
pubkey: String,

‎desktop/src-tauri/src/commands/agents.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,11 @@ pub async fn start_managed_agent(
991991
// profile is published on the relay. This self-heals cases where the initial
992992
// profile sync at creation time failed silently. For legacy records (pre-PR-921)
993993
// with no persisted avatar, this also backfills the avatar from the relay.
994-
if result.is_ok() {
994+
if result.is_ok()
995+
&& state
996+
.managed_agent_profile_reconcile_enabled
997+
.load(std::sync::atomic::Ordering::Acquire)
998+
{
995999
let reconcile_pubkey = pubkey.clone();
9961000
let reconcile_app = app.clone();
9971001
tauri::async_runtime::spawn(async move {

‎desktop/src-tauri/src/commands/agents_profile.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ pub(crate) async fn reconcile_agent_profile(
8181
&relay_ws_url_with_override(state),
8282
);
8383

84+
if !state
85+
.managed_agent_profile_reconcile_enabled
86+
.load(std::sync::atomic::Ordering::Acquire)
87+
{
88+
return Ok(());
89+
}
90+
8491
// Query the relay for the agent's existing kind:0 profile.
8592
let existing = query_agent_profile(state, &relay_url, agent_pubkey).await?;
8693

@@ -136,6 +143,13 @@ pub(crate) async fn reconcile_agent_profile(
136143
let agent_keys = Keys::parse(&data.private_key_nsec)
137144
.map_err(|e| format!("failed to parse agent keys: {e}"))?;
138145

146+
if !state
147+
.managed_agent_profile_reconcile_enabled
148+
.load(std::sync::atomic::Ordering::Acquire)
149+
{
150+
return Ok(());
151+
}
152+
139153
sync_managed_agent_profile(
140154
state,
141155
&relay_url,

‎desktop/src-tauri/src/commands/workspace.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ pub async fn apply_workspace(
103103
relay_url: String,
104104
nsec: Option<String>,
105105
repos_dir: Option<String>,
106+
agent_managed_profiles: Option<bool>,
106107
app: AppHandle,
107108
) -> Result<(), String> {
108109
let restore_app = app.clone();
@@ -148,6 +149,13 @@ pub async fn apply_workspace(
148149
*keys_guard = keys;
149150
}
150151

152+
// Keep the backend-side reconcile guard aligned with the frontend
153+
// experiment before launch-time restore can spawn any agents. Missing
154+
// means the stable behavior: desktop remains authoritative.
155+
state
156+
.managed_agent_profile_reconcile_enabled
157+
.store(!agent_managed_profiles.unwrap_or(false), Ordering::Release);
158+
151159
// ── Filesystem side-effect (non-fatal) ────────────────────────────────
152160
// Persist the *effective* repos_dir (None when the candidate failed
153161
// validation) for the backend to read at boot, then re-point REPOS to

0 commit comments

Comments
 (0)