Files
gnoma/internal/tool/agent/format.go
vikingowl 9b1d6ca100 test: M7 audit — quality feedback, coordinator, agent tool coverage
Quality feedback integration: TestQualityTracker_InfluencesArmSelection
verifies that 5 successes vs 5 failures tips Router.Select() to the
high-quality arm once EMA has enough observations. Companion test
confirms heuristic fallback below minObservations.

Coordinator tests expanded from 2 → 5: added guidance content check
(parallel/serial/synthesize present), false-positive table extended with
7 cases including the reordered keywords from the previous fix.

Agent tool suite: tool interface contracts for all four tools (Name,
Description, Parameters validity, IsReadOnly). Extracted duplicated
2000-char truncation into truncateOutput() helper (format.go), removing
the inline copies in agent.go and batch.go. Four boundary tests cover
empty, short, exact-max, and over-max cases.
2026-04-06 00:59:12 +02:00

14 lines
350 B
Go

package agent
import "fmt"
const maxOutputChars = 2000
// truncateOutput truncates output to max characters, appending a note with the original length.
func truncateOutput(output string, max int) string {
if len(output) <= max {
return output
}
return output[:max] + fmt.Sprintf("\n\n[truncated — full output was %d chars]", len(output))
}