MCPcopy Create free account
hub / github.com/github/gh-aw / renderToolCallsDiffMarkdownSection

Function renderToolCallsDiffMarkdownSection

pkg/cli/audit_diff_render.go:734–758  ·  view source on GitHub ↗

renderToolCallsDiffMarkdownSection renders the engine-level tool calls diff as markdown. It includes a full tool type table and a bash commands breakdown.

(run1ID, run2ID int64, diff *ToolCallsDiff)

Source from the content-addressed store, hash-verified

732// renderToolCallsDiffMarkdownSection renders the engine-level tool calls diff as markdown.
733// It includes a full tool type table and a bash commands breakdown.
734func renderToolCallsDiffMarkdownSection(run1ID, run2ID int64, diff *ToolCallsDiff) {
735 if diff == nil {
736 return
737 }
738
739 fmt.Fprintln(os.Stdout, "#### Tool Call Breakdown")
740 fmt.Fprintln(os.Stdout)
741
742 if len(diff.AllTools) > 0 {
743 fmt.Fprintf(os.Stdout, "| Tool | Run #%d | Run #%d | Change |\n", run1ID, run2ID)
744 fmt.Fprintln(os.Stdout, "|------|---------|---------|--------|")
745 for _, entry := range diff.AllTools {
746 change := entry.CallCountChange
747 if change == "" {
748 change = "—"
749 }
750 fmt.Fprintf(os.Stdout, "| `%s` | %d | %d | %s |\n", entry.Name, entry.Run1CallCount, entry.Run2CallCount, change)
751 }
752 fmt.Fprintln(os.Stdout)
753 }
754
755 if diff.BashDiff != nil {
756 renderBashCommandsDiffMarkdownSection(run1ID, run2ID, diff.BashDiff)
757 }
758}
759
760// renderBashCommandsDiffMarkdownSection renders the bash commands diff sub-section as markdown.
761func renderBashCommandsDiffMarkdownSection(run1ID, run2ID int64, diff *BashCommandsDiff) {

Callers 1

Tested by

no test coverage detected