Add audit command suggestion to run command output#4445
Conversation
Add friendly suggestion to use 'gh aw audit <run-id>' after workflow is triggered. This makes it easier for AI agents and users to analyze workflow runs. - Added audit suggestion message with run ID - Includes lightbulb emoji for visual friendliness - Shows specific command with run ID (no lookup needed) - Added comprehensive tests for message format and agent-friendliness Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Agentic Changeset Generator completed successfully. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a helpful audit command suggestion after workflow runs are triggered, improving discoverability of the audit feature for both users and AI agents. The implementation is minimal (3 lines) and includes comprehensive test coverage.
Key Changes
- Added audit command suggestion to run command output with run ID
- Created dedicated test file with 3 test functions covering message format and agent-friendliness
- Message displays only when run info is successfully retrieved
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/cli/run_command.go | Adds 3 lines to display audit suggestion with run ID after workflow URL |
| pkg/cli/run_command_test.go | New test file with 128 lines covering message format, exact output, and agent-friendly characteristics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| runLog.Printf("Workflow run URL: %s (ID: %d)", runInfo.URL, runInfo.DatabaseID) | ||
|
|
||
| // Suggest audit command for analysis | ||
| fmt.Printf("\n💡 To analyze this run, use: %s audit %d\n", constants.CLIExtensionPrefix, runInfo.DatabaseID) |
There was a problem hiding this comment.
The codebase uses console.FormatInfoMessage() for informational messages with emojis to maintain consistent styling across the CLI. This pattern is used in other parts of the codebase (e.g., mcp_inspect_mcp.go line 533, 568).
Consider using:
fmt.Printf("\n%s\n", console.FormatInfoMessage(fmt.Sprintf("💡 To analyze this run, use: %s audit %d", constants.CLIExtensionPrefix, runInfo.DatabaseID)))This ensures the message uses the standard info message styling (with ℹ prefix) applied by FormatInfoMessage().
| fmt.Printf("\n💡 To analyze this run, use: %s audit %d\n", constants.CLIExtensionPrefix, runInfo.DatabaseID) | |
| fmt.Printf("\n%s\n", console.FormatInfoMessage(fmt.Sprintf("💡 To analyze this run, use: %s audit %d", constants.CLIExtensionPrefix, runInfo.DatabaseID))) |
Updated documentation based on merged pull requests from the last 24 hours. Features documented: - --progress flag for run command (PR #4450) - Noop message parsing in logs/audit commands (PR #4428) - close-discussion safe output type (PR #4411) - debug-agentic-workflow custom agent (PR #4449) - Audit command suggestion in run output (PR #4445) Changes: - Updated docs/setup/cli.md to document --progress flag and noop parsing - Updated docs/reference/safe-outputs.md to add close-discussion safe output - Updated docs/reference/custom-agents.md to mention debug-agentic-workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
After triggering a workflow, users and AI agents had no immediate guidance on how to analyze the run results.
Changes
Display audit command suggestion with run ID after workflow trigger:
Add test coverage for message format and agent-friendly characteristics
Implementation
Added 3 lines in
pkg/cli/run_command.goafter the workflow URL display:The suggestion appears only when run info is successfully retrieved, providing immediate actionable guidance without requiring users to extract the run ID from the URL.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.