Update agent_user_cancel_test.go to use new package structure
- Replace imports from sketch.dev/ant to sketch.dev/llm and sketch.dev/llm/conversation
- Replace ant.* types with llm.* types
- Update MockConvo to implement CancelToolUse method
- Update method signatures like OnToolResult
- Change InnerLoop references to processTurn per recent changes
- Fix Agent struct initialization to match new structure
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/loop/mocks.go b/loop/mocks.go
index 811ab2c..014cd46 100644
--- a/loop/mocks.go
+++ b/loop/mocks.go
@@ -218,3 +218,22 @@
}
}
}
+
+// CancelToolUse cancels a tool use
+func (m *MockConvo) CancelToolUse(toolUseID string, cause error) error {
+ m.recordCall("CancelToolUse", toolUseID, cause)
+ exp, ok := m.findMatchingExpectation("CancelToolUse", toolUseID, cause)
+ if !ok {
+ m.t.Errorf("unexpected call to CancelToolUse: %s, %v", toolUseID, cause)
+ return nil
+ }
+
+ var retErr error
+ m.mu.Lock()
+ defer m.mu.Unlock()
+ if err, ok := exp.result[0].(error); ok {
+ retErr = err
+ }
+
+ return retErr
+}