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.
14 lines
350 B
Go
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))
|
|
}
|