Skip to content

Commit dd29844

Browse files
josephweckerClaude-624482a1
andcommitted
fix: Reduce dynamic area to status before moving response to static
When streaming completes, we need to: 1. Reduce dynamic area to just the status line (not response + status) 2. Then write_static the response (which clears dynamic, writes, redraws) 3. Reset renderer so prompt can operate naturally This prevents the response from being written twice (once as static, once as redrawn dynamic content). Also changed clear_dynamic to reset after completion - the status bar remains visible until the next streaming starts, rather than leaving blank lines where the cleared content was. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude-624482a1 <claude@v2.io>
1 parent d40157a commit dd29844

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

lib/autopax/commands/chat/interactive.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,12 @@ def send_message_simple_streaming(system_content)
469469
end
470470
end
471471

472-
# Move completed response to static region
472+
# Move completed response to static region.
473+
# First, reduce dynamic area to just status (so write_static doesn't redraw the response).
474+
@renderer.write_dynamic(status_line)
473475
@renderer.write_static("[assistant] #{collected}\n")
474-
@renderer.clear_dynamic
476+
# Reset so the prompt can operate naturally (status remains visible until next streaming)
477+
@renderer.reset
475478
collected
476479
end
477480

@@ -534,8 +537,11 @@ def tool_turn_streaming(messages)
534537

535538
# Move completed response to static region (if any text content)
536539
unless collected.empty?
540+
# First, reduce dynamic area to just status (so write_static doesn't redraw the response)
541+
@renderer.write_dynamic(status_line)
537542
@renderer.write_static("[assistant] #{collected}\n")
538-
@renderer.clear_dynamic
543+
# Reset so the prompt can operate naturally (status remains visible until next streaming)
544+
@renderer.reset
539545
end
540546

541547
[collected, done_event]

0 commit comments

Comments
 (0)