Skip to content

fix: debounce process notification events in TUI#71

Merged
liftaris merged 3 commits into
liftaris:devfrom
flooryyyy:fix/debounce-process-notifs
May 21, 2026
Merged

fix: debounce process notification events in TUI#71
liftaris merged 3 commits into
liftaris:devfrom
flooryyyy:fix/debounce-process-notifs

Conversation

@flooryyyy
Copy link
Copy Markdown
Contributor

status.update/kind=process events fire once per terminal(background=true) completion. when many processes finish in quick succession (builds, parallel tests), each generates a separate {kind:system} dispatch that triggers a full Chat re-render -- causing visible TUI lag.

route process events through a 500ms debounced accumulator in useStream. rapid completions coalesce into one combined system message:
"◆ 3 background processes completed"

events.ts: add onProcessNotification to Side callback type, route status.update/process through callback instead of direct dispatch
useStream.ts: procs ref accumulates notification texts, flushProcs batches and dispatches single system msg

flooryyyy and others added 3 commits May 20, 2026 23:15
- add voice state management hook (useVoice) + key parsing (platform.ts)
- register voice.record_key from config as global keybinding (ctrl+b)
- handle voice.status / voice.transcript gateway events
- show recording indicator (recording/transcribing/ready) in composer bar
- extend /voice command to return record_key, support on/off/tts/status
- auto-send transcribed text on capture (CLI parity with upstream)

new files: src/voice/{types,platform,useVoice,Indicator}.tsx
modified: app.tsx, gatewayEvents.ts, useAppKeys.ts, gateway-types.ts
status.update/kind=process events fire per terminal(background=true)
completion. when many finish in quick succession (builds, parallel
tests), each dispatches a {kind:system} action that triggers a full
Chat re-render -- causing visible TUI lag.

route process events through a 500ms debounced accumulator. rapid
completions coalesce into one combined system message.

events.ts: add onProcessNotification to Side callback type
useStream.ts: procs ref accumulates texts, flushProcs batches + dispatches
@liftaris liftaris force-pushed the fix/debounce-process-notifs branch from 02e83b6 to cdb3e9e Compare May 21, 2026 06:23
@liftaris
Copy link
Copy Markdown
Owner

Rebased on current dev after #74 and pushed a fixup.
Changes:

  • Preserved Composer: show ▶ N indicator while background tasks run #74’s BackgroundProvider and /background task register/unregister wiring.
  • Routed /voice through useVoice.toggle so the TUI voice state stays in sync with the gateway response.
  • Preserved watch-pattern formatting in the debounced process notification path:
    • proc exited N · cmd
    • proc matched "pattern" · cmd
  • Changed multi-notification batch heading to background notifications so mixed completion/watch batches aren’t mislabeled.
  • Fixed the callback-valued React state setter issue in useVoice.setOnTranscript.
  • Added voice to LOCAL_COMMANDS so local slash resolution includes it.
  • Updated gateway event tests around process notification routing/formatting.

@liftaris liftaris merged commit 9ccc200 into liftaris:dev May 21, 2026
1 check passed
@liftaris liftaris mentioned this pull request May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@flooryyyy
Copy link
Copy Markdown
Contributor Author

my agent accidentally added my other fixups to herm into this commit, rather than opening the PR on my own fork, so the STT commit wasn't actually meant to be here and i've not properly tested it, was not even sure if it works 😅

@flooryyyy flooryyyy deleted the fix/debounce-process-notifs branch May 21, 2026 12:38
@liftaris
Copy link
Copy Markdown
Owner

I saw it and left it in because it LGTM. I don't use voice though, if there's an issue with it we can always address it later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants