Skip to content

Show the server's friendly tool label in the chat status line - #351

Open
allenhutchison wants to merge 5 commits into
mainfrom
claude/project-thread-50qlxh-toolnames
Open

allenhutchison wants to merge 5 commits into
mainfrom
claude/project-thread-50qlxh-toolnames

Conversation

@allenhutchison

@allenhutchison allenhutchison commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Human overview

The server now sends a friendly phrase with each tool call ("Searching your email" instead of search_gmail_messages; pepper#6981, behind the friendly-tool-names rollout). This makes the REPL and TUI status line show that phrase when it is present, and keep it while the tool runs. With no label, the status line still reads "Calling …", as it does today.

Human required (optional)

  • Merge only after pepper#6981 has deployed (server first). The field is optional, so merging early is harmless, but it does nothing until then.

AI reviewer

Details for agents: what the diff does, invariants, verification, checklist
  • turn.py: adds tool_call_status(payload), which returns "<label>…" when label is a non-blank string and otherwise "Calling <name or 'a tool'>…". It also adds tool_result_status(payload), the existing name → status line pulled out so both sinks share it.
  • cli.py _ReplTurnSink and tui/app.py _TurnStatus: tool_call uses tool_call_status and records whether a label was shown. tool_result skips the name → status update after a labelled call, so the friendly words stay up until the next frame replaces them. Unlabelled calls behave exactly as before.
  • Contract: label is an additive, optional field on the tool_call SSE frame. The CLI reads it with .get and treats a missing or blank value as absent. No mirrored dataclass changes, so tests/test_api_contract.py is unaffected, and frame payloads are dicts here, so the vendored snapshot needs no refresh. The client does no gating of its own: the server decides per person whether to send a label.
  • The tool-call disclosure and any verbose output still show the raw tool name, because that is the identifier people debug with.
  • Verification, run in this worktree: uv run --frozen ruff format --check . (161 files already formatted), uv run --frozen ruff check . (all checks passed), uv run --frozen ty check src/pepper_cli/ (all checks passed), uv run --frozen pytest -n auto -q (3720 passed, 2 skipped).
  • New tests: test_tool_call_status_prefers_the_servers_label (label, blank label, no label, empty payload), test_a_labelled_tool_call_shows_the_servers_words_and_keeps_them (REPL spinner), test_a_labelled_tool_call_holds_its_words_through_the_result (TUI).

Checklist (repo-specific)

  • uv run ruff format --check and uv run ruff check clean (no new lint ignores)
  • uv run ty check src/pepper_cli/ clean
  • uv run pytest passes; coverage floor in .claude/maintainerd.json not lowered
  • Server-contract changes: /api/v1 usage stays additive-only, # MIRROR: comments updated, unknown fields and frames still tolerated (no mirrored model touched)
  • No token or credential is logged, printed, or put in a fixture
  • README and the bundled SKILL.md updated if commands or output changed: N/A, no command changed and neither documents the status line text
  • Help: help/cli.md updated for a new or changed command, or not user-facing because only the transient status line wording changes

Generated by Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with one non-blocking status-line issue for repeated tool calls.

Fix All in Claude CodeFindings

  1. P2 Completed tools look active ▶
Fix with agent prompt
### Issue 1
src/pepper_cli/tui/app.py:3300-3301
`_labelled` remembers a tool name for the whole turn. If a labelled call finishes and the same tool is called again without a label, the second call shows `Calling <name>…`, but its result is skipped because the name is still in the set. The completed tool then looks active until another status arrives. This also affects the REPL sink.

Track whether the matching call had a label, rather than whether that tool name ever had one.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR shows the server’s friendly tool labels in the REPL and TUI status lines.

  • Chat status lines show friendly labels for server-side tools.

Reviews (2) · Last reviewed commit: "Key the label hold by tool name, and tre..." · Reviewed by Greptile

The tool_call frame may now carry an optional label (pepper#6981). When
present the REPL and TUI show it, and keep it through the tool result;
otherwise they fall back to "Calling <name>…" as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNDeh7wecn3qTjRXGckqBt
@vycari-review

vycari-review Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Vycari Review

Round 5 on 1572045. The verdict is the Vycari Review check run, and each open finding is an inline thread. Reply on every P0 and P1 thread: Fixed in <sha>, or Disputed: with a reason. P2s are the author's call: fix one, or reply Deferred: #<issue> (the PR's one follow-up issue) or Declined: with a reason, and VR stops re-raising it. From round 2 on, VR raises no new P2s: it checks the fixes and looks for P0s and P1s.

Open: P0 0 · P1 0 · P2 0 · disputed 0 · confirmed fixed 0 · withdrawn 0

Hand-off: Covered: no Greptile round needed (Greptile's passing review of bd0cc03 still covers this head).

Greptile follow-through

  • P2 · GR-4661364384 · src/pepper_cli/tui/app.py:3301 · fixed (confirmed), thread answered · fixed-confirmed: Greptile found that the per-turn set of labelled tool names caused a later unlabelled call of the same tool to have its result skipped, so the tool still looked active after it finished. The set is now a per-name counter of labelled calls still waiting on a result. Each such result uses up one coun…

No open findings this round.

P2s, judge's notes and closed findings

Judge's notes

The PR is clean at this head. Greptile's "Completed tools look active" finding is fixed: both the TUI and REPL status lines now count labelled calls per tool instead of remembering every tool name that ever had a label, and no new candidates survived.

Comment thread src/pepper_cli/cli.py Resolved
Comment thread src/pepper_cli/tui/app.py Resolved
@vycari-review

vycari-review Bot commented Nov 23, 2026

Copy link
Copy Markdown

@greptileai review

Comment thread src/pepper_cli/cli.py Resolved
A blank label no longer holds a result back, and a result for a tool whose
call carried no label (a local tool, an unlabelled parallel call) still
shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNDeh7wecn3qTjRXGckqBt
@vycari-review

vycari-review Bot commented Nov 23, 2026

Copy link
Copy Markdown

@greptileai review

Comment thread src/pepper_cli/tui/app.py Outdated
Comment on lines +3300 to +3301
if turns.tool_label(payload) is not None:
self._labelled.add(str(payload.get("name")))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Completed tools look active

_labelled remembers a tool name for the whole turn. If a labelled call finishes and the same tool is called again without a label, the second call shows Calling <name>…, but its result is skipped because the name is still in the set. The completed tool then looks active until another status arrives. This also affects the REPL sink.

Track whether the matching call had a label, rather than whether that tool name ever had one.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/pepper_cli/tui/app.py
Line: 3300-3301

Comment:
**Completed tools look active**

`_labelled` remembers a tool name for the whole turn. If a labelled call finishes and the same tool is called again without a label, the second call shows `Calling <name>…`, but its result is skipped because the name is still in the set. The completed tool then looks active until another status arrives. This also affects the REPL sink.

Track whether the matching call had a label, rather than whether that tool name ever had one.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cb2ccd3. Both sinks now count labelled calls by tool name that are still waiting on their result, and each held-back result uses up one count. Once a labelled call's result has come back, a later unlabelled call of the same tool shows its result, while interleaved parallel calls still never bring a labelled tool's raw name back. test_a_later_unlabelled_call_of_the_same_tool_still_shows_its_result covers it.


Generated by Claude Code

… turn

A later unlabelled call of the same tool now shows its result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNDeh7wecn3qTjRXGckqBt
…-50qlxh-toolnames

# Conflicts:
#	tests/test_chat_spinner.py

This branch has not been deployed

No deployments
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.

2 participants