Commit Graph

1398 Commits

Author SHA1 Message Date
klopez4212
d493378835 fix(dictation): rate-limit session minting, disable auto-submit by default
Addresses Wes's review feedback on PR #1511:

1. Per-pubkey rate limit on POST /transcribe/session (5/min, configurable
   via BUZZ_TRANSCRIBE_SESSIONS_PER_MINUTE). Each session opens a metered
   OpenAI Realtime connection on the operator's bill.

2. Auto-submit disabled by default (DEFAULT_AUTO_SUBMIT_PHRASE = '').
   The infrastructure for configurable phrases remains in place and can
   be wired to a user setting later.

Also:
- Move BUZZ_TRANSCRIPTION_MODEL into Config (consistent with other knobs)
- Use a shared reqwest::Client via OnceLock (connection pooling)
- Stop dictation on manual send (stopDictationRef wiring)
2026-07-11 16:18:35 +01:00
klopez4212
062838ac8e fix(dictation): ignore stale transcript events after stop/send
When the user manually sends (Enter/click) while recording, the submit
flow already calls stopRecording(). However, queued data channel messages
could still fire handleRealtimeEvent after the peer connection teardown
began, writing stale transcript text back into the now-empty composer.

Fix: pass the run ID captured at startRecording into the data channel
message handler closure. handleRealtimeEvent now checks activeRunIdRef
against the captured run ID and drops events from stale runs. This
guarantees that once stopRecording() increments the run counter, no
further transcript events from that session can mutate composer state.
2026-07-11 16:18:08 +01:00
klopez4212
ae643bc302 fix(dictation): preserve transcript item order from committed events
Handle input_audio_buffer.committed events to register items in the
correct utterance order using previous_item_id before any transcript
events arrive. This ensures that when completions for different turns
arrive out of order (or when only completions are sent without deltas),
the composer reconstructs multi-utterance dictation in the correct
sequence rather than event-arrival order.

Added tests for committed-order preservation, out-of-order completions
with pre-registered order, and completion-only flows.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:08 +01:00
klopez4212
ed463c73bf fix(relay): wrap transcription config in session object
The OpenAI client_secrets endpoint expects the body as
{ session: { type, audio: { input: { transcription, turn_detection } } } }
not as top-level fields. Also moves turn_detection under audio.input per
the Realtime transcription guide.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:08 +01:00
klopez4212
586d0de244 fix: address review comments — nested audio schema, item separators, safe auto-submit clear
- Relay: restructure OpenAI client-secrets payload to use the current
  typed transcription schema (audio.input.transcription) instead of the
  deprecated top-level input_audio_transcription field.
- realtimeAudio: insert space separators between transcript items when
  neither the preceding nor following text has whitespace, preventing
  multi-utterance runs from merging into unreadable text.
- useDictation: remove premature setText('') after auto-submit — the
  send flow handles clearing on success, so dictated text survives if a
  mention dialog opens or the send is blocked.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:07 +01:00
klopez4212
cd669cbf3e fix(dictation): stop recording on channel/thread switch
When the composer's draftKey changes (channel or thread switch), stop any
active dictation session so transcript events from a stale WebRTC connection
don't leak into the wrong draft.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:07 +01:00
klopez4212
caa6bbfea8 fix(dictation): typed transcription session, sync editor before merge, block sends during upload
- Use OpenAI typed transcription session format (type: "transcription")
  instead of legacy realtime fields that would fail or produce no transcripts
- Sync editor content via syncContentRef before merging dictation text so
  manually typed prefixes are preserved when dictation starts
- Read send-blocked state from refs at transcript time so uploads prevent
  auto-submit from clearing the composer

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:07 +01:00
klopez4212
71580439bb fix(dictation): use client_secrets API, track transcripts by item_id
- Switch relay from /v1/realtime/sessions to /v1/realtime/client_secrets
  with the wrapped { session: { ... } } request shape per OpenAI's current
  WebRTC guide. The old endpoint returns non-2xx, breaking dictation.

- Redesign TranscriptSegmentState to track per-item segments keyed by
  item_id. Completed events for different turns can arrive out of order;
  reconciling by item_id preserves utterance ordering and prevents text
  reordering or partial-turn drops during fast consecutive speech.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:06 +01:00
klopez4212
53f96841c9 fix(dictation): address review — nonce, editor state, segment tracking
- Add nonce tag to NIP-98 auth events to prevent replay rejection when
  multiple components call /transcribe/status in the same second.

- Wire dictation text into both the Tiptap editor and contentRef via
  setComposerContent + setEditorContentRef, so dictated text actually
  appears in the composer and is serialized on submit.

- Call submitMessageRef.current() synchronously in onSend instead of via
  queueMicrotask, ensuring the editor content is consumed before the
  subsequent setText('') clears it.

- Replace naive append-based transcript merging with segment-aware state
  tracking (TranscriptSegmentState). Delta events accumulate into
  pendingDelta; completed events replace accumulated deltas with the
  finalized text, preventing duplication.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:06 +01:00
klopez4212
bde70242b8 fix(relay): add NIP-98 auth + relay membership to transcribe endpoints
Both /transcribe/status and /transcribe/session now require NIP-98
authentication and relay membership (with NIP-OA fallback), matching
the security posture of /events, /query, and /count.

Promotes verify_bridge_auth, check_nip98_replay, and nip98_expected_url
to pub(crate) so the transcribe module can reuse them without duplication.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:06 +01:00
klopez4212
88b0f2627d fix(relay): add doc comments to transcribe response structs
New public API needs doc comments — clippy runs with -D missing-docs, so
TranscribeStatus and TranscribeSession were failing the Rust Lint gate.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:05 +01:00
klopez4212
19463350e2 style: make dictation button rounded-full to match send button
Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:05 +01:00
klopez4212
f7ee8ff980 feat: add real-time voice dictation to composer
Adds dictation support using OpenAI's Realtime API over WebRTC:

Relay:
- New /transcribe/status and /transcribe/session endpoints
- BUZZ_OPENAI_API_KEY env var gates the feature (hidden when absent)
- Proxies ephemeral client-secret minting from OpenAI

Desktop:
- New features/dictation module with:
  - AudioWorklet for 24kHz PCM capture + buffering
  - WebRTC peer connection to OpenAI Realtime API
  - Real-time transcript merging into composer
  - Auto-submit on trigger phrase ('submit')
  - Mic button in composer toolbar (red pulse when recording)
- Integrated into MessageComposer via useComposerDictation hook

Signed-off-by: klopez4212 <klopez4212@gmail.com>
2026-07-11 16:18:04 +01:00
Will Pfleger
51234bd89f fix(desktop): preserve archived observer history (#1752)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 23:46:42 -04:00
Will Pfleger
09be502159 fix(dev): install Lefthook hooks into shared .git/hooks dir (#1751)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 22:06:32 -04:00
Will Pfleger
ec37625522 fix(desktop): surface codex config-parse failures and -32603 internal errors clearly (#1745)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 21:25:52 -04:00
Will Pfleger
e8df6ba694 fix(desktop): fix workspace rail badge disappearance and persist mark-as-unread (#1747)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 21:15:53 -04:00
Will Pfleger
9895b4d390 chore(desktop): remove container-only npm-preflight E2E harness (#1749)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 21:05:17 -04:00
Will Pfleger
58aee8f913 fix(desktop): preflight npm prefix writability in doctor installs (#1732)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 19:25:58 -04:00
Tom Brow
d80ed3180b chore(release): release Buzz Mobile version 0.3.32 (#1739)
Signed-off-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
mobile-v0.3.32
2026-07-10 15:32:07 -07:00
Will Pfleger
eb0417aa88 fix(release): install AppImage bundling system deps for Linux (#1737)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 18:30:01 -04:00
Will Pfleger
ea1c75b0d2 fix(workspaces): exclude muted channels and unfollowed threads from rail unread badge (#1738)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 18:22:11 -04:00
Will Pfleger
26966aacec feat(desktop): add explicit Edit avatar CTA in agent instance edit dialog (#1736)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 17:58:26 -04:00
Will Pfleger
67a2d047eb fix(observer): order system prompt below current-session divider on restart (#1734)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 17:44:12 -04:00
Tom Brow
215f521880 chore(ios): restrict app to iPhone (#1735)
Signed-off-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
2026-07-10 21:25:32 +00:00
Will Pfleger
bbf80aa73f fix(release): run Linux release job under bash not dash (#1733)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 17:00:25 -04:00
Will Pfleger
0d9be2fde1 chore(release): release Buzz Relay version 0.2.0 (#1728) relay-v0.2.0 2026-07-10 16:43:23 -04:00
Will Pfleger
13dded7195 chore(release): release Buzz Desktop version 0.4.0 (#1730) v0.4.0 2026-07-10 20:20:51 +00:00
Tom Brow
bdb3e69899 chore(release): release Buzz Mobile version 0.3.31 (#1724)
Signed-off-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1shglkdhngx3hrnhf4gf8vhpqdrmeludctechdvpwd3988zzs7ncq2cmtxu <85d1fb36f341a371cee9aa12765c2068f79ff1b85e7176b02e6c4a738850f4f0@sprout-oss.stage.blox.sqprod.co>
mobile-v0.3.31
2026-07-10 16:11:38 -04:00
Will Pfleger
d9e4edbbf5 feat(desktop): default observer archive on for dev-nest builds (#1726)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 16:06:25 -04:00
Will Pfleger
a7eca421a5 fix(release): filter changelogs to lane-specific paths in _release-pr (#1729) 2026-07-10 15:55:01 -04:00
Will Pfleger
2f2ad409a7 feat(desktop): thread baked build env into global agent config UI (#1722)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 15:45:42 -04:00
Will Pfleger
febbb06909 fix(release): truncate release PR body to stay under GitHub's 65536-char limit (#1727) 2026-07-10 15:41:23 -04:00
Bradley Axen
2e529aab75 feat: relay invite links (mint + claim + landing page + deep link) (#1668)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
2026-07-10 12:06:35 -07:00
Will Pfleger
b97777350d fix(desktop): pass GlobalAgentConfig to spawn_config_hash in tests (#1721) 2026-07-10 14:33:51 -04:00
Will Pfleger
77c08365e4 feat(desktop): global agent config defaults with readiness/spawn parity (#1448)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 13:38:33 -04:00
Will Pfleger
651efe8d95 fix(desktop): remove "Remove all stopped" bulk action from agents menu (#1720) 2026-07-10 13:35:34 -04:00
Will Pfleger
f12bd36893 fix(desktop): retire single-member built-in Fizz team (#1718) 2026-07-10 13:35:15 -04:00
Will Pfleger
f0b8f806fd fix(desktop): hide relay mesh option when mesh-llm feature is absent (#1719) 2026-07-10 13:26:49 -04:00
Will Pfleger
1f48860b7b fix(desktop): propagate agent definition edits to instances and remove dead config knobs (#1715) 2026-07-10 13:21:48 -04:00
Noah
9b2f0c8cb5 perf(desktop): thread panel rebuilt on every render — fix memo + add typing-latency benchmark (#1652)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 12:29:00 -04:00
Will Pfleger
e2d104f669 fix(drafts): stop clearing drafts on workspace switch and hide sent section (#1708)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 12:23:45 -04:00
Will Pfleger
177fc30bea fix(inbox): reply at same thread level as inbox item (#1714)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 12:16:49 -04:00
Matt Toohey
5f0d8309d2 fix(desktop): make @mention clicks reliably open the profile panel (#1705)
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:15:33 -07:00
Will Pfleger
7fb215c4fc fix(desktop): walk ancestor chain in orphan sweep exemption (#1711) 2026-07-10 12:11:29 -04:00
Matt Toohey
868c9ad055 fix(desktop): stop showing /dev/null in diff labels, keep type badge visible (#1704)
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-10 08:57:18 -07:00
Noah
129c91a2ba perf(desktop): stop re-rendering the app shell on every keystroke; fix two latent cache races it unmasked (#1692)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:47:18 -04:00
Will Pfleger
715df25375 fix(observer): widen live subscription lookback to capture session/prompt (#1710)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-10 11:24:18 -04:00
Cameron Hotchkies
20c40d1769 test(desktop): stabilize custom emoji e2e (#1685)
Signed-off-by: npub1x4hk035p3p9q39a3fcrd2fe30lpkrhr5dwe0cqzzjphxyyh8m0gsq4vqap <356f67c681884a0897b14e06d527317fc361dc746bb2fc0042906e6212e7dbd1@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1x4hk035p3p9q39a3fcrd2fe30lpkrhr5dwe0cqzzjphxyyh8m0gsq4vqap <356f67c681884a0897b14e06d527317fc361dc746bb2fc0042906e6212e7dbd1@sprout-oss.stage.blox.sqprod.co>
2026-07-10 11:18:25 -04:00
Will Pfleger
95bc640a53 fix(observer): use lifecycle item title as verb instead of hardcoded "Status" (#1709) 2026-07-10 10:52:59 -04:00