Files
archie/internal/domain/workflow/agent_budget_test.go
T

28 lines
822 B
Go

package workflow
import (
"strings"
"testing"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// A stage that stops short keeps what it found: the notes it appended reach
// the error that parks the run, not only the task notes.
func TestDeliverResultNonPassedCarriesFindings(t *testing.T) {
res := agentrun.Result{
Status: "parked", StopReason: "budget_exhausted",
Detail: "stopped after 60/60 steps, 900 tokens",
AppendedNotes: []string{"auth lives in internal/auth", "migration needs a backfill"},
}
err := AgentStage{Name: "feasibility"}.deliverResult(&TaskContext{}, res)
if err == nil {
t.Fatal("want error for parked run")
}
for _, want := range res.AppendedNotes {
if !strings.Contains(err.Error(), want) {
t.Errorf("error %q lacks finding %q", err, want)
}
}
}