fix(daily): surface turns, duration, cost in verification-failure error#15
Merged
Conversation
When the agent makes zero tool calls AND produces empty text, we need to know whether the model was ever consulted. Surface Turns, Duration, and CostUSD from the agent run, and explicitly show "<empty>" when Text is empty. Renames explainToolCalls → explainAgentOutcome to reflect broader scope.
5 tasks
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
Follow-up to PR #14. We just hit a verification-failure with zero tool calls AND empty agent text — the previous diagnostic told us neither was happening, but couldn't tell us whether the model was ever consulted. This PR surfaces the SDK signals (
Turns,Duration,CostUSD) that already live onRunResultso we can distinguish:turns=0 cost_usd=0→ model never consulted (early-exit silently treated as success)turns>=1 cost_usd>0 agent said: <empty>→ model consulted, produced nothingturns>=1 cost_usd>0 agent said: <text>→ model produced text but no tool callsChanges:
explainToolCalls→explainAgentOutcome. Signature now takes*agent.RunResultandstatErr.turns=N duration=... cost_usd=...line.agent said:line —<empty>literally whenText == "". Empty text is a meaningful signal, not noise.No agent-side or skill-side changes.
RunResult.Turns/Duration/CostUSDwere already populated.Test plan
go build ./...go test -race ./...(14 packages green)go vet ./...golangci-lint run(0 issues)TestRunDaily_FailsLoudlyWhenFileMissing(now assertsturns=0andagent said: <empty>)TestRunDaily_MissingFileIncludesTurnsAndDuration(turns=3,duration=2.5s,cost_usd=0.004200)./archy daily --forcefailure shows the new fields; use them to triage why the model wasn't consulted