Capture settled assistant text from the session event feed #5
Labels
No labels
NaNs
area/audio
area/build
area/docs
area/dsh
area/engine
area/security
area/ui
needs-operator
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-whale-noises#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
The core hook: when an assistant turn settles, hand its plain text to the speech pipeline — exactly once, never for history, never for thinking/tool content.
Scope
lib/client.js, acapturemodule. Do not borrow a session:const ref = ctx.sessions.retain(sessionId, { source: 'whaleNoises' }); a plainbinding(id)is nullable and only exists while another consumer holds the generation. Release withref.release()on dispose.ref.binding.eventSource.subscribe(handler); inspectgetSnapshot().change— process onlykind === 'append'entries (replace/prependare history replay;settle-assistantmay carry the durable message and must not double-fire).assistant/messagewithsurfaceOp === 'append'→ emit{ messageId, text, interrupted, turn, step }; join onlytextblocks; skipreasoning/tool blocks; honourinterrupted.message.idacross re-renders/settlement.localStorage.dsh-whale-noises.debug=1) logs the emitted text length, not the text (privacy).Acceptance
Notes
docs/research/dsh-plugin-api.md§4 (SessionReference,change.kind,assistant/message,StreamChunkdeltas). See AGENTS.md "Text capture".Code complete in
93d6e4c.src/capture.js:extractSpokenText,assistantMessagesFromChange(append + settle-assistant, text blocks only), dedupingcreateCapture, retain/releasecreateSessionCapture(initial window ignored), boundedcreateMessageIndexfor the per-message speaker (#24). Wired intosrc/client.jsviactx.sessions.list; debug flag logs lengths only.7 unit tests green (fake event sources, history replay, interruption). Real-browser verification happens in #11 (M1 acceptance); the sandbox cannot install into
~/.dsh.