Files
DeepSeek-Reasonix/internal/runtime/delegation/recovery_attribution_test.go
T
esengine be5c98c744 refactor(agent): remove missing-tool-call-reasoning detection and recovery
The loop no longer classifies a tool-call turn that arrived without
reasoning, retries it, or keeps a file-backed cooldown for it. Removes the
watch and the cooldown state, the deferred stream sink they needed, the
provider policy interfaces and their implementations, the descriptor field on
the extension wire (schema and SDK regenerated), the state-dir path, the
run-metrics counters and the protocol-recovery kinds.

The protocol-recovery audit channel itself stays for now.
2026-11-02 03:26:03 -08:00

37 lines
1.3 KiB
Go

package delegation
import (
"context"
"testing"
"reasonix/internal/contract/event"
)
// A repair inside a delegated run has to be told apart from one in the parent's
// own loop: "the child kept working" and "the host pulled the child back" are
// different answers, and the producers run where neither id is in hand. The
// attribution is asserted through the stack a child actually emits into, since
// that stack is where audits were being dropped entirely.
func TestProtocolRecoveryCarriesTheChildItHappenedIn(t *testing.T) {
parent := &recoverySink{}
tracker := newSubagentProgressTracker(context.Background(), subSinkFor("fleet-2", parent))
defer tracker.finish(nil, nil)
event.RecordProtocolRecovery(tracker.wrap(), event.ProtocolRecoveryAudit{
Kind: event.ProtocolRecoveryKind("test"),
})
event.RecordProtocolRecovery(parent, event.ProtocolRecoveryAudit{
Kind: event.ProtocolRecoveryKind("test"),
})
if len(parent.audits) != 2 {
t.Fatalf("recovery audits = %d, want the child's and the parent's", len(parent.audits))
}
if got := parent.audits[0].ChildID; got != "fleet-2" {
t.Errorf("child recovery ChildID = %q, want the delegated run's id", got)
}
if got := parent.audits[1].ChildID; got != "" {
t.Errorf("parent recovery ChildID = %q, want empty for the parent's own loop", got)
}
}