summaryrefslogtreecommitdiff
path: root/internal/handlers/agent.go
AgeCommit message (Collapse)Author
2026-02-17Add calendar cache layer, incremental sync tests, completion assertionsPeter Stone
- Google Calendar events now cached via CacheFetcher pattern with stale-cache fallback on API errors (new migration 015, store methods, fetchCalendarEvents handler, BuildTimeline reads from store) - Todoist incremental sync path covered by 5 new tests - Task completion tests assert response body, headers, and template data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-03Refactor template rendering with Renderer interface for testabilityPeter Stone
Introduce a Renderer interface to abstract template rendering, enabling tests to use MockRenderer instead of requiring real template files. Changes: - Add renderer.go with Renderer interface, TemplateRenderer, and MockRenderer - Update Handler struct to use Renderer instead of *template.Template - Update HTMLResponse() to accept Renderer interface - Replace all h.templates.ExecuteTemplate() calls with h.renderer.Render() - Update all tests to use MockRenderer, removing template file dependencies This eliminates 15+ tests that previously skipped with "Templates not available" and improves test isolation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28Expand agent context API with completed log and calendar viewPeter Stone
- Add completed_tasks table to log task completions with title, due date, and completion timestamp - Extend agent context date range: 7 days back to 14 days forward - Add completed_log to API response (last 50 completed tasks) - Add day_section field to timeline items (overdue/today/tomorrow/later) - Add calendar-style view for today's schedule (6am-10pm hourly grid) - Add tabbed interface for Timeline vs Completed Log in HTML view Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28Refactor agent handlers for simplicity and clarityPeter Stone
- Reuse BuildTimeline() from timeline_logic.go instead of duplicating fetch logic (~60 lines removed) - Add section headers for code organization - Extract isSessionExpired() and renderAgentTemplate() helpers - Move AgentRequestPayload from websocket.go to agent.go - Use config.Now() and config.Today() for consistent timezone handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>