BitFun icon indicating copy to clipboard operation
BitFun copied to clipboard

[Bug]: Turn completes but the desktop view stays locked in streaming state (no answer, composer disabled, no stop control)

Open QZQ-go opened this issue 2 weeks ago • 1 comments

Summary

After a long single-turn run finishes, the desktop conversation view can stay stuck in a "streaming" appearance: the last rendered block is the model's reasoning text, the final assistant answer never appears, the composer does not accept input, and there is no visible stop/pause control. On disk the session is already completed with hasFinalResponse=true. The only recovery is reloading the window/app.

Expected: when the turn finishes, the view renders the final response and re-enables the composer; and if view and runtime ever disagree, there is an explicit recovery path (auto-resync or a "stop/unlock" action) instead of a silently dead input box.

Area

Desktop app

Reproduction or evidence

Observed once, so far without a reliable repro, but the on-disk evidence is unambiguous.

  • Session 0755ac8f-c6e7-4348-8f2c-6b3f29053ba9 (workspace /Users/qzq/Project/z-pet-hub), model fast, reasoning preset max, single user turn, auto-approve.
  • turns/turn-0000.json: status=completed, finishReason=complete, hasFinalResponse=true, durationMs=205869, 32 model rounds, 52 tool calls (input 2,665,242 / output 19,939 / cached 2,604,672 tokens). The final textItems[0].content contains the complete answer.
  • Same session metadata.json: lastTurn.status=completed; state.json: runtime_state=Idle.
  • On screen, however: the transcript ended at the reasoning stream ("Actually let me reconsider scope…"), no answer bubble followed, the composer stayed non-interactive, and there was no stop/pause control. Clicking gave no feedback at all.

At the same time, a second session (c1f03d86-…, workspace /Users/qzq/Project/z-pet) had one ExecCommand tool call in flight from 14:23 to ~14:33 (yield 600000 ms), and:

  • ~/.openbitfun/runtime-events/c1f03d86-….jsonl reached 97,715,880 bytes / 33,227 lines during that window. The volume is dominated by ToolEvent → ParamsPartial records: one JSON line per streamed fragment of the tool argument ("params":"600", "params":"000", "params":"}", …). The file was truncated to ~132 KB at 14:31 and removed ~14:42 when the run ended.
  • In the same window the app process sat at 1.4–1.9 GB RSS (peak footprint 7.3 GB) and 29–49% CPU. sample showed the AppKit main thread idle in mach_msg, so this is background stream/log work, not a blocked UI event loop.

Two separate things look worth fixing:

  1. Turn completion → view sync. A finished turn can leave the composer locked, with no stop control and no user-visible way out.
  2. Per-fragment persistence of tool-argument deltas. One ~10 minute tool call produced ~98 MB of ParamsPartial records. This is the same class of problem as #2161 (coalesce streamed text chunks before emitting), but on the tool-parameter path and on the persistence side.

Filed on behalf of the reporter from the app's own diagnostic data; the UI state above is what they saw on screen, not a programmatic capture.

Environment, if relevant

OpenBitFun version: 1.0.10 (com.openbitfun.desktop) OS: macOS 27.2.1 (26B131), Apple Silicon arm64 Model/provider: fast (deepseek-flash), reasoning preset max Mode: local workspace execution, auto-approve

QZQ-go avatar Nov 12 '26 06:11 QZQ-go

The stuck streaming state and locked composer were fixed in https://github.com/openBitFun/OpenBitFun/pull/3893 and shipped in v1.0.11. The fix preserves turn completion events under an event flood and lets the view reconcile with the persisted final answer.

The separately reproduced ParamsPartial journal growth is tracked in https://github.com/openBitFun/OpenBitFun/issues/4005, with the reproduction steps and measured journal sizes.

kev1n77 avatar Nov 19 '26 11:11 kev1n77