refactor: promote trace metrics to top-level EvaluationResult fields#398
Open
refactor: promote trace metrics to top-level EvaluationResult fields#398
Conversation
…esult Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ionContext Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all core test files to use the new flat metric fields (tokenUsage, costUsd, durationMs) at context/result level instead of nested inside TraceSummary. Fix computeTraceSummary usage to destructure TraceComputeResult. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move token_usage, cost_usd, duration_ms from trace object to top-level in test fixtures and update assertions accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update code judge scripts to read tokenUsage, costUsd, durationMs from top-level input fields instead of trace object. Update jq example in trace-analysis README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move token_usage, cost_usd, duration_ms, start_time, end_time from trace structure to top-level input fields in code judge docs. Update jq examples in trace CLI docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…race!) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace non-null assertions with proper narrowing in execution-metrics evaluator - Fix biome formatting across multiple files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix jq paths in trace-analyst skill (trace.cost_usd -> cost_usd, etc.) - Update evaluator JSDoc to reflect promoted metrics access pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
f5f9663
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1eec0017.agentv.pages.dev |
| Branch Preview URL: | https://refactor-promote-trace-metri.agentv.pages.dev |
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
tokenUsage,costUsd,durationMs,startTime,endTime) from nestedTraceSummaryto top-level fields onEvaluationResult,EvaluationContext, and JSONL outputTraceComputeResulttype to separate trace-specific data (tool calls, errors) from execution metricsBreaking change: JSONL output now has
cost_usd,duration_ms,token_usage,start_time,end_timeat the result root instead of nested undertrace. External jq scripts or parsers that readtrace.cost_usdetc. need updating.Test plan
--traceand verify promoted fields appear at JSONL rootagentv trace showandagentv trace statsdisplay metrics correctly🤖 Generated with Claude Code