mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 02:36:01 -10:00
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.
37 lines
1.3 KiB
Go
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)
|
|
}
|
|
}
|