Skip to content

fix(daily): include agent text in verification-failure error#14

Merged
rebelopsio merged 1 commit into
mainfrom
fix/daily-include-agent-text
May 13, 2026
Merged

fix(daily): include agent text in verification-failure error#14
rebelopsio merged 1 commit into
mainfrom
fix/daily-include-agent-text

Conversation

@rebelopsio
Copy link
Copy Markdown
Owner

Summary

When runDaily fails verification because the agent made zero tool calls, the previous error told us the count but not what the agent actually said. With that hidden, we can't distinguish "agent said it had no write tool" from "agent went off-topic" from "skill didn't load." This PR appends a truncated agent said: <text> line to the verification-failure error.

  • explainToolCalls(calls, agentText, statErr) — new agentText parameter. Only appends the "agent said:" line when text is non-empty.
  • New local truncateText(s, n) helper (1000-char clip with …(N more chars) suffix). The internal/linear truncate is package-private and only one caller needs this here.
  • No changes to skills, prompts, tool permissions, or the agent runtime — RunResult.Text was already populated, just discarded.

Test plan

  • go build ./...
  • go test -race ./... (14 packages green)
  • go vet ./...
  • golangci-lint run (0 issues)
  • Updated: TestRunDaily_FailsLoudlyWhenFileMissing (empty text → no "agent said:" line), TestRunDaily_MissingFileIncludesToolCallNames (non-empty text → line appears)
  • New: TestRunDaily_MissingFileIncludesAgentText, TestRunDaily_AgentTextTruncated
  • Manual: ./archy daily --force failure now shows agent said: <text> revealing what the agent output

When the agent makes zero tool calls but reports success, include
the assistant's output text in the error message so we can see why.
Truncated to 1000 chars to keep the message bounded.
@rebelopsio rebelopsio merged commit 4f1abc3 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