Collect costs for dispatched model attempts

This commit is contained in:
2026-11-22 18:27:01 +00:00
parent cd0e1f5d39
commit 81a2a7591d
9 changed files with 129 additions and 6 deletions

View File

@@ -19,10 +19,15 @@ func TestExecutionBoundaryPreservesCallerContext(t *testing.T) {
recorder := newRecorder("outer", time.Now, nil)
sink := recorder
parent = WithClaimSink(WithRecorder(parent, recorder), &sink)
var cost CostAccumulator
parent = WithCostAccumulator(parent, &cost)
child := WithoutExecutionState(parent)
if FromContext(child) != nil || FromContext(parent) != recorder {
t.Fatal("execution boundary did not isolate recorder state")
}
if CostFromContext(child) != nil || CostFromContext(parent) != &cost {
t.Fatal("execution boundary did not isolate cost state")
}
RegisterClaim(child, nil)
if sink != recorder {
t.Fatal("execution boundary retained the parent claim sink")