fix(tui): 后台 shell 通知在 TUI 聊天区显示优化#100
Merged
Merged
Conversation
背景:后台 shell 命令完成/等待输入的 XML 通知直接注入 agent 对话流, 在 TUI 聊天区显示为原始 XML 标签,用户不可读。同时,前台小命令快速结束 也会注入后台完成通知,打断对话流。 修改内容: - background_shell.rs 新增 shell_notification_display_text() 解析 XML 通知为可读文本 - background_shell.rs 新增 xml_unescape()/truncate_chars()/unwrap_system_reminder()/extract_xml_tag() 辅助函数 - shell_command.rs poll_agent_shells() 区分前台/后台化命令:仅后台化命令注入完成通知 - agent_submit.rs 后台通知消息不污染输入历史,agent_input 包裹为 system-reminder - message_view/mod.rs from_base_message() 后台 shell 通知渲染为 SystemNote 而非原始文本 - mod.rs 导出 shell_notification_display_text 函数 - background_shell_test.rs 新增 3 个测试覆盖通知显示文本解析 - shell_command_test.rs 新增 2 个测试覆盖前台/后台化通知注入逻辑 - message_view_test.rs 新增 1 个测试覆盖后台通知渲染为 SystemNote 特性/影响: - 前台小命令完成不再打断对话流,仅后台化(Ctrl+B)命令注入通知 - XML 通知在聊天区显示为"后台 shell 已完成/失败/等待输入"等可读提示 - 后台通知消息不污染输入历史和 last_submitted_text Co-Authored-By: Claude mimo-v2.5-pro <noreply@anthropic.com>
/review 已注册为内置 passthrough 命令,但测试仍断言其为非已知命令。 将测试中 mock skill 名称从 "review" 改为 "deploy" 避免与内置命令冲突。 Co-Authored-By: Claude mimo-v2.5-pro <noreply@anthropic.com>
peri-middlewares/src/middleware/terminal.rs 的 Stdio import 在非 Windows 平台未使用导致 Clippy -D warnings 失败。加 #[cfg(windows)] 条件编译。 Co-Authored-By: Claude mimo-v2.5-pro <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
background_shell.rsshell_notification_display_text()解析 XML 通知为可读文本 + 辅助函数shell_command.rspoll_agent_shells()区分前台/后台化命令,仅后台化命令注入完成通知agent_submit.rsmessage_view/mod.rsmod.rsshell_notification_display_textTest plan
cargo clippy -p peri-tui -- -D warnings通过