open-code-review/internal/scan
kite 63b0f02d27
feat: add tool_calls field to JSON output (#216)
* feat: add tool_calls field to JSON output for tool usage statistics

Track per-tool invocation counts in llmloop.Runner and expose them
through the ResultProvider interface so both review and scan modes
report tool call statistics in --format json output.

* fix: correct tool_calls counting and ensure stable JSON schema

Move recordToolCall after lookupTool nil check so only actually-executed
tool calls are counted. Always emit tool_calls field in JSON output for
a consistent schema, initializing by_tool to empty map when nil.

* fix: remove omitempty from tool_calls to ensure stable JSON schema

Drop omitempty from the tool_calls struct tag and initialize ToolCalls
in outputJSONNoFiles so the field is always present in JSON output
regardless of execution path.
2026-06-25 13:53:06 +08:00
..
agent.go feat: add tool_calls field to JSON output (#216) 2026-06-25 13:53:06 +08:00
agent_test.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
batch.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
batch_test.go feat: add tool_calls field to JSON output (#216) 2026-06-25 13:53:06 +08:00
budget_test.go feat: add tool_calls field to JSON output (#216) 2026-06-25 13:53:06 +08:00
dedup_test.go feat: add tool_calls field to JSON output (#216) 2026-06-25 13:53:06 +08:00
estimate.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
estimate_test.go feat: add tool_calls field to JSON output (#216) 2026-06-25 13:53:06 +08:00
preview.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
provider.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
provider_test.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00