Repository navigation
feat(insights): every Board agent run counts — Coding, Reviewer, Testing, Discovery - #265
Merged
Merged
Conversation
…very Insights showed nothing while Autopilot's agents worked all day: it reads pipeline runs + run_metrics, and only the 5-agent pipeline wrote them. Now every LLM call made inside an LlmCallScope is recorded (ObservedLlmClient, wrapped by the factory only while a scope is open — tokens incl. cache read/write and reasoning, cost, latency, provider, outcome), and each Board agent step is stored as a run with those calls (IPipelineRunRepository.SaveAgentRunAsync; no pipeline artifacts, so its run detail reads as not found). Coding and Testing runs on the Board and New idea (Discovery) record themselves; the Thorough engine keeps its own pipeline run. Calls made on a member's computer cost $0 and show their ≈ API figure, as Insights already labels them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Insights showed no numbers although Autopilot's agents worked all day: it reads
pipeline_runs+run_metrics, and only the 5-agent pipeline wrote them.LlmCallScope(Domain, AsyncLocal) +ObservedLlmClient(Llm): inside an open scope every call is recorded — tokens (fresh / cache read / cache write / output / reasoning), cost, latency, provider, outcome. The factory wraps clients only while a scope is open, so the pipeline and unscoped calls are untouched.IPipelineRunRepository.SaveAgentRunAsync: one run per Board agent step with its calls (no artifacts → detail reads as not found).Test plan
AgentRunMetricsTests: scope nesting, success + failure recorded (failure rethrown), agent run counted by the cost summary (calls, runs, tokens, by agent) and listed in the history.🤖 Generated with Claude Code
https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB