Skip to content

fix(tui_v2): render markdown while streaming#512

Open
MuziIsabel wants to merge 1 commit into
lsdefine:mainfrom
MuziIsabel:fix/tui-v2-live-markdown-stream-pr
Open

fix(tui_v2): render markdown while streaming#512
MuziIsabel wants to merge 1 commit into
lsdefine:mainfrom
MuziIsabel:fix/tui-v2-live-markdown-stream-pr

Conversation

@MuziIsabel
Copy link
Copy Markdown
Contributor

Summary

  • Render assistant Markdown during streaming with stable-prefix caching and bounded tail parsing.
  • Temporarily close open fenced code blocks so live code output is styled before completion.
  • Keep completed responses on the existing full Markdown render path.

Test plan

  • python -m py_compile e:\Work\Python\GenericAgent-live-md-pr\frontends\tuiapp_v2.py
  • Helper smoke test for heading split, open fence provisional closure, and table tail split.

nianyucatfish added a commit to nianyucatfish/GenericAgent that referenced this pull request May 28, 2026
- /export clip 现在通过 _copy_to_clipboard 直接写系统剪贴板:
  Win32 ctypes(CF_UNICODETEXT,避开控制台 codepage)/ macOS pbcopy /
  Wayland wl-copy / X11 xclip 或 xsel,失败再退回手动复制。
- InputArea 在 Windows 上对 Enter 事件用 GetAsyncKeyState(VK_SHIFT) 兜底,
  终端把 Shift+Enter 报成普通 Enter 时也能正确插入换行而非提交。
- watch_theme 漏清 _seg_render_cache 导致主题切换后 Markdown 的
  h1/列表 bullet/code 块/link 等仍是上一主题的色 —— 缓存 key 不含
  theme,且 ANSI 颜色被烤进了 _MdRender。补上 clear()。

Refs:
- Shift+Enter 物理检测思路 from upstream PR lsdefine#519 by @jlu005807
  lsdefine#519
- Markdown 渲染路径上下文 from upstream PR lsdefine#512 by @MuziIsabel
  lsdefine#512
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