Skip to content

fix(tui): 修正 Bash Ctrl+B 提示计时#112

Merged
cc-claws merged 1 commit into
mainfrom
fix/ctrl-b-hint-timer-start-point
Jul 2, 2026
Merged

fix(tui): 修正 Bash Ctrl+B 提示计时#112
cc-claws merged 1 commit into
mainfrom
fix/ctrl-b-hint-timer-start-point

Conversation

@cc-claws

@cc-claws cc-claws commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Fixes #111

Summary

  • record the real streaming shell spawn time in ShellExecution
  • keep Bash ToolBlock timer unset at ToolStart and fill it when the agent shell registration arrives
  • add regression tests for pending Bash timer behavior

Validation

  • cargo test -p peri-tui --lib test_bash_tool_start_uses_spawn_started_at
  • cargo test -p peri-tui --lib test_set_pending_bash_tool_started_at_in_view
  • git diff --check
  • workflow_dispatch CI run 28572326249 passed on ubuntu, macOS, and Windows

Note: local cargo check -p peri-tui could not complete because D: had only 0.14GB free and rustc failed with os error 112.

Bash ToolStart 事件早于真实 shell spawn,导致 TUI 中 Ctrl+B 后台化提示的已运行时间偏长。本次将计时起点改为 streaming shell 子进程成功 spawn 后的时间,并在 agent shell 注册时回填到 pending Bash ToolBlock。

修改内容:

- ShellExecution 增加 started_instant,记录子进程真实 spawn 后的启动时间

- AgentShellExecutor 使用 ShellExecution.started_instant 生成 AgentShellRegistration

- MessagePipeline 为 pending Bash ToolBlock 保留可回填的 started_at

- ShellCommand 在 agent shell 注册时同步更新 pipeline 和当前 view 中的 Bash ToolBlock

- MessageViewModel 让 pending Bash ToolBlock 默认不提前计时,并让 started_at 是否存在参与 hash

- message_pipeline_test 和 shell_command_test 增加 Ctrl+B 计时起点回归测试

特性/影响:

- Ctrl+B 提示的 2 秒阈值从 Bash 实际执行开始计算,不再从 ToolStart 到达 TUI 时提前计算

- 本地验证中两个新增回归测试通过;cargo check 因 D 盘磁盘空间不足 os error 112 未完成

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@cc-claws cc-claws merged commit d0aef1b into main Jul 2, 2026
6 checks passed
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.

fix: Bash Ctrl+B hint timer starts before spawn

1 participant