From 945c34590677e161a711ccaff0e1077197b1b178 Mon Sep 17 00:00:00 2001 From: Doot Agent Date: Mon, 6 Jul 2026 00:00:59 +0000 Subject: feat: remove Todoist integration entirely Native tasks (native_tasks table) fully replace Todoist. All Todoist API code, store functions, handlers, routes, templates, and tests have been removed. Migration 021 drops the now-unused tasks cache table. Co-Authored-By: Claude Sonnet 4.6 --- internal/handlers/agent_test.go | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'internal/handlers/agent_test.go') diff --git a/internal/handlers/agent_test.go b/internal/handlers/agent_test.go index eab1609..2893a13 100644 --- a/internal/handlers/agent_test.go +++ b/internal/handlers/agent_test.go @@ -746,13 +746,11 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { defer cleanup() // Mock clients - mockTodoist := &mockTodoistClient{} mockTrello := &mockTrelloClient{} h := &Handler{ - store: db, - todoistClient: mockTodoist, - trelloClient: mockTrello, - config: &config.Config{}, + store: db, + trelloClient: mockTrello, + config: &config.Config{}, } // Create an approved session @@ -766,11 +764,11 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { db.CreateAgentSession(session) db.ApproveAgentSession("write-request-token", sessionToken, time.Now().Add(1*time.Hour)) - // Pre-populate store with a task to get details during completion - db.SaveTasks([]models.Task{{ID: "task123", Content: "Test Task"}}) + // Pre-populate store with a native task + _ = db.CreateNativeTask(models.Task{ID: "task123", Content: "Test Task"}) t.Run("complete task", func(t *testing.T) { - req := httptest.NewRequest(http.MethodPost, "/agent/tasks/task123/complete?source=todoist", nil) + req := httptest.NewRequest(http.MethodPost, "/agent/tasks/task123/complete?source=doot", nil) w := httptest.NewRecorder() // Manually inject session into context as middleware would @@ -804,7 +802,7 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { t.Run("update due date", func(t *testing.T) { due := time.Now().Add(24 * time.Hour) body, _ := json.Marshal(map[string]*time.Time{"due": &due}) - req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123/due?source=todoist", bytes.NewReader(body)) + req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123/due?source=doot", bytes.NewReader(body)) w := httptest.NewRecorder() rctx := chi.NewRouteContext() @@ -820,7 +818,7 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { t.Run("update task details", func(t *testing.T) { body, _ := json.Marshal(map[string]string{"title": "Updated Title", "description": "New Desc"}) - req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123?source=todoist", bytes.NewReader(body)) + req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123?source=doot", bytes.NewReader(body)) w := httptest.NewRecorder() rctx := chi.NewRouteContext() @@ -839,17 +837,15 @@ func TestHandleAgentCreateOperations(t *testing.T) { db, cleanup := setupTestDB(t) defer cleanup() - mockTodoist := &mockTodoistClient{} h := &Handler{ - store: db, - todoistClient: mockTodoist, - config: &config.Config{}, + store: db, + config: &config.Config{}, } t.Run("create task", func(t *testing.T) { body, _ := json.Marshal(map[string]string{ "title": "New Agent Task", - "source": "todoist", + "source": "doot", }) req := httptest.NewRequest(http.MethodPost, "/agent/tasks", bytes.NewReader(body)) w := httptest.NewRecorder() -- cgit v1.2.3