Annotate skill doc reads with skill names (#16813)

Addresses #16303

Problem: Skill doc reads render as plain `Read SKILL.md`, so the TUI
hides which skill was opened.

Solution: Best-effort annotate exact `SKILL.md` reads with the matching
loaded skill name from `skills_all` before rendering exec cells.

Before:
```
• Explored
  └ Read SKILL.md
```

After:
```
• Explored
  └ Read SKILL.md (pr-babysitter skill)
```
This commit is contained in:
Eric Traut authored and GitHub committed 2026-04-06 08:51:34 -07:00
1 parent 4294031a93
commit f44eb29181
2 files changed
+31 -3

No files matched your search

+5 -3
View File
@@ -4206,6 +4206,7 @@ impl ChatWidget {
Some(rc) => (rc.command, rc.parsed_cmd, rc.source),
None => (ev.command.clone(), ev.parsed_cmd.clone(), ev.source),
};
let parsed = self.annotate_skill_reads_in_parsed_cmd(parsed);
let is_unified_exec_interaction =
matches!(source, ExecCommandSource::UnifiedExecInteraction);
let end_target = match self.active_cell.as_ref() {
@@ -4425,11 +4426,12 @@ impl ChatWidget {
pub(crate) fn handle_exec_begin_now(&mut self, ev: ExecCommandBeginEvent) {
// Ensure the status indicator is visible while the command runs.
self.bottom_pane.ensure_status_indicator();
let parsed_cmd = self.annotate_skill_reads_in_parsed_cmd(ev.parsed_cmd.clone());
self.running_commands.insert(
ev.call_id.clone(),
RunningCommand {
command: ev.command.clone(),
parsed_cmd: ev.parsed_cmd.clone(),
parsed_cmd: parsed_cmd.clone(),
source: ev.source,
},
);
@@ -4462,7 +4464,7 @@ impl ChatWidget {
&& let Some(new_exec) = cell.with_added_call(
ev.call_id.clone(),
ev.command.clone(),
ev.parsed_cmd.clone(),
parsed_cmd.clone(),
ev.source,
interaction_input.clone(),
)
@@ -4475,7 +4477,7 @@ impl ChatWidget {
self.active_cell = Some(Box::new(new_active_exec_command(
ev.call_id.clone(),
ev.command.clone(),
ev.parsed_cmd,
parsed_cmd,
ev.source,
interaction_input,
self.config.animations,