Skip to content

Add audit cards for Telegram plan tool#40

Open
chinkan wants to merge 1 commit into
mainfrom
feature/telegram-plan-tool-visuals
Open

Add audit cards for Telegram plan tool#40
chinkan wants to merge 1 commit into
mainfrom
feature/telegram-plan-tool-visuals

Conversation

@chinkan
Copy link
Copy Markdown
Owner

@chinkan chinkan commented May 29, 2026

This pull request implements a new design for Telegram verbose-mode progress and audit messages, significantly improving the agent's planning and tool execution feedback. The main change is to ensure that tool progress and audit information is shown only in a persistent, structured audit card managed by the ToolCallNotifier, and never mixed into the final assistant answer stream. This eliminates duplicate tool-status messages, improves clarity, and sets the stage for richer, more user-friendly progress reporting. The implementation includes code changes, a detailed design spec, and new tests to enforce the intended message flow.

Design and behavior changes:

  • Added a comprehensive design document (2026-05-28-telegram-plan-tool-visuals-design.md) specifying the new persistent audit card UI for Telegram verbose mode, including message lifecycle, plan and tool rendering, and privacy/security guidelines.

Agent and notifier logic refactoring:

  • Removed the logic in src/agent.rs that previously streamed tool-status lines into the assistant answer stream, ensuring tool progress is only handled by the notifier. [1] [2]
  • Updated the notifier handling in src/platform/telegram.rs to robustly manage the lifecycle of the persistent audit card, sending a terminal Finished event and ensuring the notifier finishes properly even if the channel closes unexpectedly. [1] [2] [3]

Testing and enforcement:

  • Added a unit test in src/agent.rs to ensure that tool-status lines are never formatted or sent to the assistant answer stream, preventing regressions.

Copilot AI review requested due to automatic review settings May 29, 2026 08:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Telegram verbose-mode progress reporting into a single persistent "audit card" managed by ToolCallNotifier, and removes the duplicate path that previously streamed tool-status lines into the assistant answer. It also adds a privacy-aware argument preview formatter and a structured plan/tool display model.

Changes:

  • Adds a ToolDisplayState with plan checklist + tool activity rendering, parses plan_create/plan_update arguments, and tightens format_args_preview to an allowlist/denylist model.
  • Introduces ToolEvent::Finished and reworks ToolCallNotifier::finish to edit the live message into a persistent completed/failed card (or delete it when no activity occurred).
  • Removes the agent-side stream_status_tx path so tool status lines no longer enter the answer stream, and adds a source-inspection regression test.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/platform/tool_notifier.rs Adds display state, planning parsers, privacy-aware preview, persistent finish card, edit retry, and new tests.
src/platform/telegram.rs Forwards a terminal Finished event to the notifier and finalizes the notifier even if the channel closes unexpectedly.
src/agent.rs Removes duplicate tool-status streaming; sends raw arguments_json to the notifier; adds source-inspection regression test.
docs/superpowers/specs/2026-05-28-telegram-plan-tool-visuals-design.md New design spec for verbose-mode audit card.
docs/superpowers/plans/2026-05-28-telegram-plan-tool-visuals.md New implementation plan with step-by-step tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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