7 Commits

Author SHA1 Message Date
Julia McGhee
d0925f6555 Add MarkdownView, task retry endpoint, and chat/model store improvements
Some checks failed
CI / lint-and-test (push) Successful in 39s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
Adds MarkdownView component to design system, task retry API route,
markdown rendering in dashboard and chat, and model store enhancements.
Includes DB migration for schema updates.
2026-03-22 13:04:41 +00:00
Julia McGhee
f338da0da3 Add credential usage field: chat, agent, or any
Some checks failed
CI / lint-and-test (push) Successful in 40s
Deploy Production / deploy (push) Successful in 1m23s
CI / build (push) Has been cancelled
Credentials now have a usage field ("any", "chat", "agent") so the
same provider can have separate credentials for different use cases.
The Claude OAuth token is tagged "agent" (for Claude Code CLI), while
API keys can be tagged "chat" (for streaming/model listing).

- Add usage column to harness_credentials table
- Add getCredentialsForUsage() that prefers exact match, falls back to "any"
- Chat route and model-providers use chat credentials
- Agent env builder uses agent credentials
- Credentials API accepts usage field on create/update
2026-03-22 12:44:02 +00:00
Julia McGhee
71e3215f89 Remove curated models table, use live provider APIs with filtering
Some checks failed
CI / lint-and-test (push) Successful in 34s
Deploy Production / deploy (push) Successful in 1m30s
CI / build (push) Has been cancelled
- Remove harness_curated_models table from schema
- Remove /api/models/curated route and all curated model functions
- Move KNOWN_MODELS pricing table to model-providers.ts and enrich
  live API results with pricing/context window data
- Filter out old models: dated IDs (claude-3-opus-20240229), legacy
  families (claude-3-*, gpt-3.5-*, gpt-4-*, text-*, etc.)
- Update model_list chat tool to use fetchAllModels() instead of DB
- Update ModelsTab to fetch from /api/models, remove toggle/delete
- Update getUsageSummary to use KNOWN_MODELS for cost lookup
- Simplify boot.ts: remove model syncing, keep agent auto-discovery
2026-03-22 11:58:02 +00:00
Julia McGhee
51a4425351 Persist chat conversations to database
All checks were successful
CI / lint-and-test (push) Successful in 37s
Deploy Production / deploy (push) Successful in 1m34s
CI / build (push) Successful in 4m40s
- Add harness_chat_conversations table with messages stored as JSONB
- Add chat-store.ts with CRUD operations
- Add /api/conversations routes (GET list, POST create, PATCH update,
  DELETE remove)
- Update chat-tab.tsx to load conversations on mount, persist metadata
  changes immediately, and save messages after streaming completes
- Add loading state while conversations are being fetched
2026-03-22 11:50:19 +00:00
Julia McGhee
3288d69f9b Persist harness projects to database
Some checks failed
CI / lint-and-test (push) Successful in 35s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
Projects were stored purely in useState — lost on every page refresh.
- Add harness_projects table (id, name, workspaces jsonb)
- Add /api/projects CRUD route (GET/POST/PUT/DELETE)
- Load projects from DB on dashboard mount
- All project mutations (create, delete, add/remove repo) now
  persist via API calls
2026-03-22 11:28:24 +00:00
Julia McGhee
eeb87018d7 Add event-driven tasks via Gitea webhooks
Some checks failed
Deploy Production / deploy (push) Failing after 35s
CI / lint-and-test (push) Successful in 33s
CI / build (push) Has been cancelled
Webhook endpoint at /api/webhooks/gitea receives Gitea status events,
matches them against configurable event triggers with conditions
(event type, repo glob, state, context), renders task templates with
{{variable}} substitution, and creates harness tasks automatically.

Includes circuit breaker: after N consecutive task failures from the
same trigger (default 3), the trigger auto-disables. Re-enable
manually via PATCH /api/event-triggers/:id.

New tables: harness_event_triggers (rules + circuit breaker state),
harness_event_log (audit trail + dedup via X-Gitea-Delivery).
2026-03-21 21:15:15 +00:00
Julia McGhee
3fe75a8e04 Migrate harness from in-memory stores to CloudNativePG
Some checks failed
CI / lint-and-test (push) Successful in 22s
Deploy Production / deploy (push) Failing after 21s
CI / build (push) Failing after 1m51s
Replace all in-memory Map-backed stores (credentials, models, agents,
tasks, iterations, usage) with Drizzle ORM queries against the
homelab-pg PostgreSQL cluster. All store functions are now async.

- Add 6 harness_* tables to @homelab/db schema
- Generate and apply initial Drizzle migration
- Add lazy DB connection proxy to avoid build-time errors
- Wire DATABASE_URL from sealed secret into harness deployment
- Update all API routes, orchestrator, executor, and boot to await
  async store operations
2026-03-21 20:17:08 +00:00