Skip to content

fix(daily): surface turns, duration, cost in verification-failure error#15

Merged
rebelopsio merged 1 commit into
mainfrom
fix/daily-explain-turns
May 13, 2026
Merged

fix(daily): surface turns, duration, cost in verification-failure error#15
rebelopsio merged 1 commit into
mainfrom
fix/daily-explain-turns

Conversation

@rebelopsio
Copy link
Copy Markdown
Owner

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 on RunResult so 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 nothing
  • turns>=1 cost_usd>0 agent said: <text> → model produced text but no tool calls

Changes:

  • Rename explainToolCallsexplainAgentOutcome. Signature now takes *agent.RunResult and statErr.
  • Always emit a turns=N duration=... cost_usd=... line.
  • Always emit an agent said: line — <empty> literally when Text == "". Empty text is a meaningful signal, not noise.

No agent-side or skill-side changes. RunResult.Turns/Duration/CostUSD were already populated.

Test plan

  • go build ./...
  • go test -race ./... (14 packages green)
  • go vet ./...
  • golangci-lint run (0 issues)
  • Updated: TestRunDaily_FailsLoudlyWhenFileMissing (now asserts turns=0 and agent said: <empty>)
  • New: TestRunDaily_MissingFileIncludesTurnsAndDuration (turns=3, duration=2.5s, cost_usd=0.004200)
  • Manual: ./archy daily --force failure shows the new fields; use them to triage why the model wasn't consulted

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.
@rebelopsio rebelopsio merged commit ec7ceaa into main May 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant