feat(tui): 工具显示卡片 + /model 与 /effort 运行时切换#593
Open
nianyucatfish wants to merge 2 commits into
Open
Conversation
把 agent_loop verbose 的 `🛠️ Tool` 块替换为紧凑卡片: - file_write/file_patch:带行号+上下文的主题化 diff(append/prepend 走整文件 diff) - file_read:读到的内容带行号 gutter,噪音剥离,超长折叠 - code_run:CC/Codex 式 gutter 卡(命令 │ / 输出 └),保尾截断 - 三卡共用 _CardWriter/_card_status_row/_emit_gutter;2 格 margin 不进复制 - capture:tool_before/after 钩子(live) + iter_write_captures(continue) 内容寻址 - 双流渲染对齐(_align_md_renders)支持 margin 映射,复制不含视觉缩进
- /model:在线拉模型列表的 searchable picker;搜索框兼作自定义模型名输入 (无匹配时 Enter 直设)。逻辑在 model_cmd.py(agent 无关、可单测)。 - /effort:reasoning effort 档位切换。各协议差异在 effort_note 单点编码: Claude(output_config.effort) low/med/high 原样、xhigh→max、none/minimal 忽略; OpenAI(reasoning_effort / reasoning.effort) 透传。mixin 经 _BROADCAST_ATTRS 广播到全部子渠道。 - model_cmd:_resolve/fetch_models/set_model/set_effort,mixin 落子 session。
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.
tuiapp_v2 的两项增强,拆成两个 commit。
1. 工具显示卡片(file_write / file_patch / file_read / code_run)
把 agent_loop verbose 的
🛠️ Tool块替换为紧凑卡片:[FILE]/show_linenos 前言/截断提示),超长折叠;行号在不可知处(keyword 窗口 / 挖洞后)留空。│命令 gutter +└输出 gutter,输出 dim、保尾截断(traceback 关键在末尾);代码来自正文块时不重复展示。_CardWriter/_card_status_row/_emit_gutter;2 格左 margin 只进显示流、不进复制源。tool_before/after钩子,/continue走iter_write_captures从历史 tool_result 重建,按hash(get_pretty_json(args))内容寻址。_align_md_renders)支持 margin 映射,鼠标复制不含视觉缩进。2. /model 与 /effort 渠道内运行时切换
effort_note单点编码——Claude(output_config.effort) low/med/high 原样、xhigh→max、none/minimal 忽略;OpenAI(reasoning_effort/reasoning.effort) 透传;mixin 经_BROADCAST_ATTRS广播到全部子渠道。frontends/model_cmd.py(agent 无关、可单测)。测试