Skip to content

Commit 3f50717

Browse files
committed
test: fix three broken tests for post-merge code changes
- update SetTodoList schema snapshot to include the new `merge` compatibility field (excluded from serialization but present in JSON schema) - rename and flip test_helper_leaves_bare_fence_line_untouched: bare ` ``` ` openers are now suppressed with fallback lang "code", matching the paired-fence tracking introduced alongside the CodeRabbit fix - patch DiffLive (not the removed Rich Live) in test_live_view_processes_external_approval_messages; drop the Rich-specific _live_render attribute and add refresh() no-op - add CHANGELOG unreleased entry for the smooth-streaming coalescing work
1 parent d61b6e2 commit 3f50717

4 files changed

Lines changed: 24 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ GitHub Releases page; `0.8.0` is the new starting line.
1515

1616
## Unreleased
1717

18+
- **TUI: smoother agent-working streaming.** Buffered text now reveals at an even,
19+
bounded rate instead of backlog-proportional lurches, and incremental scrollback
20+
commits are coalesced so the prompt no longer pops/flickers on every paragraph
21+
boundary during a stream.
22+
1823
- **TUI tool-card diffs use syntax highlighting.** Edit/Write inline diffs now share the
1924
approval/pager ``PythinkerSyntax`` pipeline (``tui.code_theme``, file-extension lexer) while
2025
keeping the compact boxless card layout.

tests/tools/test_tool_schemas.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ def test_set_todo_list_params_schema(set_todo_list_tool: SetTodoList):
161161
],
162162
"default": None,
163163
"description": "The updated todo list. If not provided, returns the current todo list without making changes.",
164-
}
164+
},
165+
"merge": {
166+
"anyOf": [{"type": "boolean"}, {"type": "null"}],
167+
"default": None,
168+
"description": "Accepted for compatibility with some LLM providers; silently ignored.",
169+
},
165170
},
166171
"type": "object",
167172
}

tests/ui_and_conv/test_streaming_content_block.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -991,17 +991,17 @@ def test_helper_supports_tilde_fence(self):
991991
closed_out = blocks_module._suppress_unclosed_code_fence_preview(_TILDE_CLOSED_FENCE_STREAM)
992992
assert closed_out == _TILDE_CLOSED_FENCE_STREAM
993993

994-
def test_helper_leaves_bare_fence_line_untouched(self):
995-
"""A bare triple-backtick line is structurally a closer in this
996-
codebase (``_FENCE_CLOSE_RE``), so an opener without a language tag
997-
cannot be told apart from a closer. The helper intentionally
998-
suppresses only fences that carry a language tag; otherwise it would
999-
risk eating real closers. Confirms the conservative contract.
994+
def test_helper_suppresses_bare_fence_opener(self):
995+
"""A bare triple-backtick opener (no language tag) is now suppressed
996+
using "code" as the fallback language, so its raw body is hidden until
997+
the closer arrives — same as a tagged fence.
1000998
"""
1001999
from pythinker_code.ui.shell.visualize import _blocks as blocks_module
10021000

10031001
out = blocks_module._suppress_unclosed_code_fence_preview(_NO_LANG_OPEN_FENCE_STREAM)
1004-
assert out == _NO_LANG_OPEN_FENCE_STREAM
1002+
assert "plain text inside fence" not in out
1003+
assert "streaming code block" in out
1004+
assert "(code)" in out
10051005

10061006
def test_helper_does_not_touch_report_fence(self):
10071007
from pythinker_code.ui.shell.visualize import _blocks as blocks_module

tests/ui_and_conv/test_visualize_running_prompt.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ def invalidate(self) -> None:
365365
pass
366366

367367
monkeypatch.setattr(_interactive_mod, "run_in_terminal", _run_in_terminal)
368-
monkeypatch.setattr(
369-
_live_view_mod, "emit_scrollback_block", lambda _console, renderable: None
370-
)
368+
monkeypatch.setattr(_live_view_mod, "emit_scrollback_block", lambda _console, renderable: None)
371369
monkeypatch.setattr(_interactive_mod.time, "monotonic", lambda: 1000.0)
372370

373371
view = _PromptLiveView(
@@ -401,9 +399,7 @@ def invalidate(self) -> None:
401399
pass
402400

403401
monkeypatch.setattr(_interactive_mod, "run_in_terminal", _run_in_terminal)
404-
monkeypatch.setattr(
405-
_live_view_mod, "emit_scrollback_block", lambda _console, renderable: None
406-
)
402+
monkeypatch.setattr(_live_view_mod, "emit_scrollback_block", lambda _console, renderable: None)
407403
monkeypatch.setattr(_interactive_mod.time, "monotonic", lambda: 1000.0)
408404

409405
view = _PromptLiveView(
@@ -1020,6 +1016,9 @@ def __exit__(self, exc_type, exc, tb) -> bool:
10201016
def update(self, renderable, refresh: bool = True) -> None:
10211017
updates.append(renderable)
10221018

1019+
def refresh(self) -> None:
1020+
return None
1021+
10231022
def stop(self) -> None:
10241023
return None
10251024

@@ -1034,7 +1033,7 @@ async def receive(self):
10341033
async def _no_keyboard_listener(*args, **kwargs):
10351034
yield
10361035

1037-
monkeypatch.setattr(_live_view_mod, "Live", _FakeLive)
1036+
monkeypatch.setattr(_live_view_mod, "DiffLive", _FakeLive)
10381037
monkeypatch.setattr(_live_view_mod, "_keyboard_listener", _no_keyboard_listener)
10391038

10401039
view = _LiveView(StatusUpdate())

0 commit comments

Comments
 (0)