Files
buzz/desktop/src-tauri
npub1anev4pmmnnkaq8qqrs4wz7vd9je27pmvkr8gycrszdgwzutag6cshucm90 b91ac88d3a fix(desktop): make team agent_pubkeys Option on the wire — omission must not wipe membership
kind:30176 events serialized agent_pubkeys with skip_serializing_if =
Vec::is_empty, making 'old client omitted the field' and 'new client
explicitly emptied the team' byte-identical. apply_inbound_team blindly
overwrote, so an old client merely renaming a team wiped its agent
membership on every newer device.

- TeamEventContent.agent_pubkeys is now Option<Vec<String>>. The Option
  is PERMANENT wire semantics, not a transitional shim (doc comment says
  so): None = publisher predates the field, Some(vec![]) = explicitly
  emptied. New clients always publish Some, even when empty.
- apply_inbound_team overwrites local membership only on Some; None
  preserves local. Fresh inserts unwrap_or_default.
- persona_ids deliberately left unwrapped, with a doc comment explaining
  why: it predates agent_pubkeys, every shipped client emits it, so
  omitted genuinely means empty — wrapping it would freeze stale members
  when an old client legitimately empties a team.
- Tests: parse test flips to assert None (not empty); new tests cover
  always-publish-Some, None-preserves-local reconcile, and
  Some(vec![])-clears reconcile.

Fixes the pre-merge blocker from the tho/agents-first-remove-personas
review (Chuckie/Angelica/Tommy consensus). Zero events with the
ambiguous shape existed in the wild before this fix.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
2026-07-07 11:41:55 -07:00
..
2026-07-01 10:58:43 -07:00