Skip to content

Overlapping streaming LLM refreshes show and save stale answers #282

Open

Description

@codebanditssss

Bug

Overlapping stream --llm refreshes can publish out of order. An older request
finishing last replaces the newer answer in the live panel, NDJSON output,
and saved Markdown note.

_maybe_summarize() claims turns under the session lock, then correctly runs
the LLM request outside that lock. But it publishes every response
unconditionally. If the request for one turn completes after the request for
two turns, emitted answer.turns goes 2 → 1 and _last_answer becomes stale.
The closing flush does not repair this because the newer turns are already
marked as summarized.

Supported paths include the documented meeting-notes setup:

assembly stream --system-audio --llm "summary, decisions, action items" --save-dir ~/meeting-notes

System audio and microphone callbacks run on separate threads. A refresh can
also overlap when its request takes longer than --llm-interval.
Stopping while a refresh is in flight exposes the same claimed/published
confusion: the closing flush skips its turns and the note can be missing.

Expected: published answers never regress to fewer turns; closing flush
covers turns without a published answer.

Reproduction

At upstream a4a7760, Event-controlled callback threads complete requests
in order 2 → 1. Four of five regressions fail, including the real
run_parallel → closing flush → saved-note path. With a published-turn
high-water mark, all five pass and the note covers the latest transcript.

The LLM and streaming network boundaries are faked. No provider calls,
physical microphone or macOS system-audio capture were used.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions