Skip to content

Deactivate streaming copyright pass + smooth reference reveal#27

Merged
lfnothias merged 1 commit into
mainfrom
fix-stream-freeze-smooth-refs
Jun 22, 2026
Merged

Deactivate streaming copyright pass + smooth reference reveal#27
lfnothias merged 1 commit into
mainfrom
fix-stream-freeze-smooth-refs

Conversation

@lfnothias

Copy link
Copy Markdown
Collaborator

Summary

Fixes the streaming glitch where the GUI answer froze for ~0.6 s at the body→references boundary (right after the FBMN section) and then dumped the references all at once.

Freeze — deactivate the streaming copyright pass (basic.py)

After the body finished streaming, _apply_copyright_filter ran a synchronous verbatim-detection pass before references were appended — a ~605–668 ms stall. On the streaming (GUI) path this had no user-facing effect: the body had already streamed, and the client ignores the revision event. So the pass is skipped on execute_stream (the non-streaming execute() still runs it for compliance). Also drops the now-unused full_response accumulation.

Dump — smooth the reference reveal (ChatPanel.tsx)

useTypewriter flipped from 12 chars/frame to instant (99999) the moment done arrived, so the one-chunk references block snapped in. It now finishes the buffered tail at a finite 48 chars/frame, easing the references in (~100 ms). Historical loads stay instant — the typewriter starts already caught-up, so no animation runs.

Verification

  • Re-ran the FBMN query through the route handler: largest inter-token gap 131 ms (normal jitter), versus the old ~605–668 ms; 0 copyright-detection events on the stream.
  • 91 targeted unit tests pass (copyright / basic / stream / reference); frontend compiles clean.

Note: the test CI job fails on the pre-existing test_web_app_routes.py sandbox issue already present on main (passes locally 30/30); unrelated to this change.

🤖 Generated with Claude Code

The GUI streamed answer froze for ~0.6s at the body→references boundary, then
dumped the references all at once.

- basic.py execute_stream: skip the synchronous copyright-detection pass on the
  streaming (GUI) path. The body has already streamed and the client ignores
  the "revision" event, so the pass only added a visible mid-stream stall
  before the references with no user-facing effect. The non-streaming execute()
  path still runs it for compliance. Also drops the now-unused full_response
  accumulation.
- ChatPanel: finish the post-stream buffered tail (the one-chunk references
  block) at a finite 48 chars/frame instead of snapping to instant on `done`,
  so it eases in smoothly. Historical loads stay instant (the typewriter starts
  caught up, so no animation runs).

Verified: max inter-token gap 131ms (was ~605-668ms); no copyright pass on the
stream; 91 targeted unit tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lfnothias lfnothias merged commit a4d162d into main Jun 22, 2026
1 of 2 checks passed
@lfnothias lfnothias deleted the fix-stream-freeze-smooth-refs branch June 22, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant