summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/elaborate_test.go8
-rw-r--r--internal/api/validate_test.go8
2 files changed, 9 insertions, 7 deletions
diff --git a/internal/api/elaborate_test.go b/internal/api/elaborate_test.go
index 52f7fdf..4939701 100644
--- a/internal/api/elaborate_test.go
+++ b/internal/api/elaborate_test.go
@@ -53,7 +53,8 @@ func TestElaborateTask_Success(t *testing.T) {
task := elaboratedTask{
Name: "Run Go tests with race detector",
Description: "Runs the Go test suite with -race flag and checks coverage.",
- Claude: elaboratedClaude{
+ Agent: elaboratedAgent{
+ Type: "claude",
Model: "sonnet",
Instructions: "Run go test -race ./... and report results.",
WorkingDir: "",
@@ -94,7 +95,7 @@ func TestElaborateTask_Success(t *testing.T) {
if result.Name == "" {
t.Error("expected non-empty name")
}
- if result.Claude.Instructions == "" {
+ if result.Agent.Instructions == "" {
t.Error("expected non-empty instructions")
}
}
@@ -127,7 +128,8 @@ func TestElaborateTask_MarkdownFencedJSON(t *testing.T) {
task := elaboratedTask{
Name: "Test task",
Description: "Does something.",
- Claude: elaboratedClaude{
+ Agent: elaboratedAgent{
+ Type: "claude",
Model: "sonnet",
Instructions: "Do the thing.",
MaxBudgetUSD: 0.5,
diff --git a/internal/api/validate_test.go b/internal/api/validate_test.go
index 5a1246b..c3d7b1f 100644
--- a/internal/api/validate_test.go
+++ b/internal/api/validate_test.go
@@ -23,7 +23,7 @@ func TestValidateTask_Success(t *testing.T) {
wrapperJSON, _ := json.Marshal(wrapper)
srv.validateCmdPath = createFakeClaude(t, string(wrapperJSON), 0)
- body := `{"name":"Test Task","claude":{"instructions":"Run go test ./... and report results."}}`
+ body := `{"name":"Test Task","agent":{"instructions":"Run go test ./... and report results."}}`
req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body))
req.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()
@@ -46,7 +46,7 @@ func TestValidateTask_Success(t *testing.T) {
func TestValidateTask_MissingInstructions(t *testing.T) {
srv, _ := testServer(t)
- body := `{"name":"Test Task","claude":{"instructions":""}}`
+ body := `{"name":"Test Task","agent":{"instructions":""}}`
req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body))
req.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()
@@ -61,7 +61,7 @@ func TestValidateTask_MissingInstructions(t *testing.T) {
func TestValidateTask_MissingName(t *testing.T) {
srv, _ := testServer(t)
- body := `{"name":"","claude":{"instructions":"Do something useful."}}`
+ body := `{"name":"","agent":{"instructions":"Do something useful."}}`
req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body))
req.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()
@@ -77,7 +77,7 @@ func TestValidateTask_BadJSONFromClaude(t *testing.T) {
srv, _ := testServer(t)
srv.validateCmdPath = createFakeClaude(t, "not valid json at all", 0)
- body := `{"name":"Test Task","claude":{"instructions":"Do something useful."}}`
+ body := `{"name":"Test Task","agent":{"instructions":"Do something useful."}}`
req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body))
req.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()