fix(local-archive): default both archive settings to enabled - #4750
Merged
Conversation
Both local archive settings (observer frames kind 24200 and agent turn metrics kind 44200) previously defaulted to OFF in OSS builds via build-time env vars, silently losing data for users who didn't discover the Settings toggle. Observer frames are ephemeral (not stored by the relay), so any missed events are permanently unrecoverable. Make both defaults unconditionally true: - observer_archive_default_enabled() and agent_metric_archive_default_enabled() now return true without any option_env! check. - Remove BUZZ_BUILD_OBSERVER_ARCHIVE_DEFAULT and BUZZ_BUILD_AGENT_METRIC_ARCHIVE_DEFAULT from build.rs (rerun-if-env declarations and baked-env blocks). - Remove the desktop-tauri-test-compiled-flags Justfile recipe and its CI step — the dual-compile test machinery has no purpose now. Existing explicit opt-outs are preserved: the hasExplicitChoice guard in useAgentMetricArchiveSeed and the subscription reconciliation in useObserverArchiveSeed only run for identities that have never made a choice. Simplify the TS seed hooks to remove the policy-flag dep entirely. Update ObserverArchiveSection to remove the policy prop, enable the toggle unconditionally, and drop the stale 'Always on for internal builds' copy. Update e2e mock defaults from false to true. Update both test suites to match. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
reconcileObserverArchive previously merged kind 24200 unconditionally on every startup. Toggling the observer archive off then restarting caused reconciliation to re-enable it silently. Add observerArchivePreference.ts (mirrors agentMetricArchivePreference) with hasExplicitObserverArchiveChoice / getExplicitObserverArchiveChoice / setExplicitObserverArchiveChoice stored in localStorage, keyed by pubkey. Gate reconcileObserverArchive: skip merge when an explicit opt-out is stored. Persist an explicit enabled choice on first-run seeding so the guard is consistent from first startup onward. Wire setExplicitObserverArchiveChoice into handleObserverToggle (both toggle-on and toggle-off), matching the existing metric path. Tests: four new cases covering explicit opt-out, explicit opt-in, first-run seeding + choice persistence, and the toggle-off-then-restart failure mode. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
- Remove dead nest_is_dev() / path_is_dev_nest() helpers and their four orphaned tests (no caller outside nest.rs since the build-flag code was dropped in the prior commit) - Collapse observer preference storage to a single tri-state read (readExplicitObserverArchiveChoice → true | false | "unset"); storage errors now fail-closed (return true, skip merge) matching the metric path - Update ObserverArchiveSeedDeps interface: replace hasExplicitChoice + getExplicitChoice with single readExplicitChoice; reconcileObserverArchive skips merge for any non-"unset" result - Update useObserverArchiveSeed.test.mjs: migrate all makeDeps factories and inline deps objects to new interface; fix test that expected re-merge on already-seeded opt-in (wrong under new model); add storage-error path test - Rewrite observer-archive-policy.spec.ts around the default-on model: drop internal/OSS/policy-pending/error cases; add fresh-identity-defaults-on, toggle-off-persists, toggle-on-off-cycle, reconciliation-gate, and fresh-install-seeding tests - Remove stale bridge seams: observerArchiveDefaultEnabled, observerArchiveDefaultEnabledDelayMs, deferObserverArchiveDefaultEnabled, observerArchiveDefaultEnabledError from bridge.ts types, e2eBridge.ts mock config type, window global declarations, deferredObserverArchivePolicyQueue let, install-reset block, and observer_archive_default_enabled IPC case Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…model The two failing smoke tests encoded the old default-off assumption: seeding saveSubscriptions:[] and expecting the toggle OFF. Under the new model, empty subscriptions + no recorded choice = seed 24200 (ON). observer-archive-policy.spec.ts: - explicit-opt-out test: seed the identity-scoped localStorage key (buzz:observer-archive-default-seeded:<pubkey> = "0") before navigation so reconciliation honours the stored choice and leaves the toggle unchecked. - no-subscriptions test: invert premise — assert default-on seeding (toggle checked) first, then exercise OFF removal and ON re-creation. Spec result: 6 passed, 0 failed (pnpm build:e2e + playwright smoke). Stale comments updated: - AppShell.tsx: replace "unconditionally repairs on internal builds" with build-agnostic description (default-on seeding / opt-out no-op). - e2eBridge.ts: replace "fresh-internal-repair" / "OSS toggle" framing with default-on seeding and toggle ON/OFF language. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…-enabled * origin/main: Dock Buzz Term within channel workspace (#4724) perf(relay): index channel-id lookups and skip trace-only reads (#4647) fix(agents): canonicalize stale persona harness pins (#4631) Refine community invite links (#4734) Signed-off-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
The deleted desktop-tauri-test-compiled-flags recipe covered two flags: observer-archive (now removed) and auto-connect (still present). Removing the full recipe orphaned the compiled_flag_matches_expected test in identity.rs with no invoker. Restore a slimmed recipe covering only BUZZ_BUILD_AUTO_CONNECT_DEFAULT_RELAY: - Clean state: unset flag, expect false - Internal state: flag set, expect true build.rs rerun-if-env-changed triggers real recompilation between passes. Restore the corresponding Desktop Tauri compiled-flag verification step in ci.yml so the coverage runs in CI on every Desktop Core build. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…-enabled * origin/main: fix(desktop): close reconnect gaps that previously required CMD+R (#4737) Signed-off-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
loganj
pushed a commit
that referenced
this pull request
Aug 4, 2026
…links * origin/main: fix(desktop): integer-align custom reaction emoji (#4779) Polish Huddle voice controls (#4694) fix(local-archive): default both archive settings to enabled (#4750) fix(mobile): stop oversized read-state retry loop (#4595) Signed-off-by: npub13n66s06epmqf2kc3v373ez8hj65cuzyvxzjf93vwpervxqn2u7jq2qd9je <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
wpfleger96
added a commit
that referenced
this pull request
Aug 4, 2026
* commit 'ce3cf3cd2': (76 commits) Polish Huddle voice controls (#4694) fix(local-archive): default both archive settings to enabled (#4750) fix(mobile): stop oversized read-state retry loop (#4595) fix(desktop): close reconnect gaps that previously required CMD+R (#4737) Dock Buzz Term within channel workspace (#4724) perf(relay): index channel-id lookups and skip trace-only reads (#4647) fix(agents): canonicalize stale persona harness pins (#4631) Refine community invite links (#4734) feat(desktop): persist sidebar observed-unread across webview reload (#3976) feat(desktop): surface config diff in restart-required badge (#3637) Polish sidebar unread hierarchy (#4573) fix(desktop): show cached display names on startup (#3317) docs(acp): explain per-channel session model in base prompt (#4729) docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632) Remove blur from Welcome composer guidance (#4691) Refine desktop timeline activity presentation (#4582) Defer desktop media uploads until send (#4522) fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374) Polish mobile inbox and media flows (#4512) feat: ship Buzz Term (#4347) ... Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Both local archive settings — "Archive my agents' observer frames" (kind 24200) and "Archive my agents' turn metrics" (kind 44200) — previously defaulted to OFF in OSS builds, controlled by build-time env vars. This had an irreversible cost: observer frames are ephemeral (not stored by the relay), so any missed events are permanently unrecoverable. This PR makes both settings default to enabled for all builds and removes the build-time flag machinery entirely.
What changed
Rust
observer_archive_default_enabled()— returnstrueunconditionally; removedoption_env!("BUZZ_DESKTOP_BUILD_OBSERVER_ARCHIVE_DEFAULT")check andnest_is_dev()runtime fallback.agent_metric_archive_default_enabled()— returnstrueunconditionally; removedoption_env!("BUZZ_DESKTOP_BUILD_AGENT_METRIC_ARCHIVE_DEFAULT")check and its OSS-build test.build.rs— removed bothrerun-if-env-changeddeclarations (BUZZ_BUILD_OBSERVER_ARCHIVE_DEFAULT,BUZZ_BUILD_AGENT_METRIC_ARCHIVE_DEFAULT) and the two baked-env emitting blocks.Build / CI
Justfile— removeddesktop-tauri-test-compiled-flagsrecipe (the dual-compile test machinery)..github/workflows/ci.yml— removed the "Desktop Tauri compiled-flag verification" CI step.TypeScript
useObserverArchiveSeed.ts— removedobserverArchiveDefaultEnableddep fromObserverArchiveSeedDepsand thepolicyOngate inreconcileObserverArchive; the function now unconditionally callsmergeSaveSubscriptionKinds.useAgentMetricArchiveSeed.ts— removedagentMetricArchiveDefaultEnableddep fromAgentMetricArchiveSeedDepsand thedefaultOnflag-check path inmaybeSeed; thehasExplicitChoiceguard is preserved as the sole gate against re-seeding.LocalArchiveSettingsCard.tsx— removedpolicyprop,observerPolicystate, andobserverArchiveDefaultEnabledfetch fromObserverArchiveSection; toggle is now always enabled (justtogglingdisables it); removed the stale "Always on for internal builds" copy branch; removed theobserverPolicy !== falseguard fromhandleObserverToggle.tauriArchive.ts— updated JSDoc on both default-enabled functions to reflect always-true.e2eBridge.ts— changed both mock defaults from?? falseto?? trueso E2E tests without an explicit mock override exercise the real default behavior.Tests
useObserverArchiveSeed.test.mjs— replacedpolicyOndep with direct merge dep; updatedtest_oss_policy_off_no_merge→test_reconcile_always_seeds_24200; all cancellation, identity-switch, and ordering tests adapted.useAgentMetricArchiveSeed.test.mjs— removeddefaultOndep andtest_oss_build_does_not_seed; updatedtest_internal_build_unset_seeds_*→test_default_enabled_*;hasExplicitChoiceguard tests unchanged.Preservation of explicit opt-outs
Users who have previously toggled the setting off are unaffected:
useAgentMetricArchiveSeedskips seeding whenhasExplicitChoice(pubkey)returns true (localStorage-persisted per identity).mergeSaveSubscriptionKinds, but a user who already deleted the subscription can turn it off via the Settings toggle, which callsremoveSaveSubscriptionKind— this is the existing explicit opt-out path, and the toggle is now always enabled (not locked by a policy flag).Result
BUZZ_BUILD_*_ARCHIVE_DEFAULT/BUZZ_DESKTOP_BUILD_*_ARCHIVE_DEFAULTreferences remain outside CHANGELOG/history.just desktop-tauri-check: clean.just desktop-tauri-test: all pass.