130 Commits

Author SHA1 Message Date
Julia McGhee
96cd8dfed9 Fix deploy build failure and opencode chat execvp error
Some checks are pending
CI / build (push) Blocked by required conditions
Deploy Production / deploy (push) Waiting to run
CI / lint-and-test (push) Successful in 38s
Add "gitea" to local RepoResult provider type (was missing from UI
interface despite being returned by repo-search). Copy opencode binary
instead of symlinking — symlink through /root/ is inaccessible to the
nextjs user due to directory permissions.
2026-03-21 22:21:28 +00:00
Julia McGhee
ce58800b36 Fix Gitea repo search: correct service name and add UI support
Some checks failed
CI / lint-and-test (push) Successful in 39s
Deploy Production / deploy (push) Failing after 51s
CI / build (push) Failing after 46s
- GITEA_URL was pointing to gitea.platform.svc but the Helm chart
  names the HTTP service gitea-helm-http.platform.svc
- Add Gitea badge (GT, green) to repo search results UI
- Update placeholder and credential hint to mention Gitea
- Rewrite internal service URLs to external gitea.coreworlds.io in
  search results so agents can clone from outside the cluster
- Add error logging to diagnose search failures
2026-03-21 22:15:18 +00:00
gitea-actions[bot]
4192a29962 deploy: update production images to bf67446480 2026-03-21 22:12:16 +00:00
Julia McGhee
bf67446480 Fix opencode not found: symlink installer binary to /usr/local/bin
All checks were successful
CI / lint-and-test (push) Successful in 34s
Deploy Production / deploy (push) Successful in 1m30s
CI / build (push) Successful in 1m51s
The opencode curl installer puts the binary in /root/.local/bin which
isn't on PATH for the nextjs user. Add a symlink to /usr/local/bin
after install. Also ensure /usr/local/bin is always in the PATH
passed to spawned agent processes.
2026-03-21 22:10:13 +00:00
gitea-actions[bot]
0906efe60e deploy: update production images to b981cc0926 2026-03-21 22:01:37 +00:00
Julia McGhee
b981cc0926 Fix harness forbidden error: use internal token instead of host check
All checks were successful
CI / lint-and-test (push) Successful in 32s
Deploy Production / deploy (push) Successful in 1m20s
CI / build (push) Successful in 1m55s
The localhost check using host header and x-forwarded-for was unreliable
in the standalone Next.js server which may inject forwarded headers
internally. Replace with a per-process random token shared between the
PTY server and the API route via env var.
2026-03-21 21:59:45 +00:00
gitea-actions[bot]
88496cb908 deploy: update production images to 58c12a8d77 2026-03-21 21:53:14 +00:00
Julia McGhee
58c12a8d77 Fix harness PTY: bind to 0.0.0.0 instead of HOSTNAME
All checks were successful
CI / lint-and-test (push) Successful in 36s
Deploy Production / deploy (push) Successful in 1m19s
CI / build (push) Successful in 1m51s
In K8s, HOSTNAME is set to the pod name, so the server only listened
on that interface. The PTY server's loopback fetch to 127.0.0.1 was
connection-refused. Always bind to 0.0.0.0 so loopback works.
2026-03-21 21:51:18 +00:00
gitea-actions[bot]
9fe5b395ca deploy: update production images to 548b0fde98 2026-03-21 21:46:19 +00:00
Julia McGhee
548b0fde98 Fix harness crash: load standalone config to skip webpack in production
All checks were successful
CI / lint-and-test (push) Successful in 38s
Deploy Production / deploy (push) Successful in 1m26s
CI / build (push) Successful in 1m52s
The standalone next package is trimmed and doesn't include webpack.
The custom server.js was using next() which triggers config loading
that requires webpack. Fix by extracting the standalone config at
build time and setting __NEXT_PRIVATE_STANDALONE_CONFIG before
requiring next, matching what the generated standalone server does.
2026-03-21 21:44:15 +00:00
gitea-actions[bot]
c135a15306 deploy: update production images to 4b517958aa 2026-03-21 21:36:00 +00:00
Julia McGhee
4b517958aa Fix harness crash: move server.js into standalone app dir
All checks were successful
CI / lint-and-test (push) Successful in 29s
Deploy Production / deploy (push) Successful in 1m29s
CI / build (push) Successful in 1m49s
server.js requires 'next', which the standalone output places at
apps/harness/node_modules/next. Running server.js from the repo root
meant Node couldn't resolve it. Move server.js and pty-server.js into
apps/harness/ so module resolution finds the standalone node_modules.
2026-03-21 21:33:59 +00:00
gitea-actions[bot]
53b9cd826a deploy: update production images to 58cd9e21db 2026-03-21 21:31:20 +00:00
Julia McGhee
58cd9e21db Fix deploy: use if/then instead of && to avoid pipefail exit
All checks were successful
CI / lint-and-test (push) Successful in 30s
Deploy Production / deploy (push) Successful in 34s
CI / build (push) Successful in 33s
The Dockerfile check in the while-read loop used `[ -f ... ] && echo`,
which exits non-zero for packages without Dockerfiles. With bash's
pipefail, this killed the entire step. Also remove unused GitHub
workflow copies since CI runs on Gitea only.
2026-03-21 21:26:23 +00:00
Julia McGhee
34e629d955 Fix deploy: filter out non-app packages from build matrix
Some checks failed
CI / lint-and-test (push) Successful in 37s
CI / build (push) Successful in 27s
Deploy Production / deploy (push) Failing after 27s
Turbo's change detection includes shared packages like @homelab/db,
which don't have Dockerfiles. Filter to only apps with a Dockerfile
to prevent 'path not found' errors during docker build.
2026-03-21 21:19:15 +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
ccebbc4015 Remove git MCP server: package doesn't exist on npm, git CLI suffices
Some checks failed
CI / lint-and-test (push) Successful in 34s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
@modelcontextprotocol/server-git is not published to npm (it's a
Python package). Agents already have git installed and can use it
directly, so the MCP wrapper is unnecessary.
2026-03-21 21:13:37 +00:00
Julia McGhee
ed3331b575 Fix kubernetes-mcp-server package name: remove incorrect @manusa/ scope
Some checks failed
CI / lint-and-test (push) Successful in 41s
Deploy Production / deploy (push) Failing after 42s
CI / build (push) Failing after 1m8s
The npm package is published as `kubernetes-mcp-server` (unscoped),
not `@manusa/kubernetes-mcp-server` which returns 404.
2026-03-21 21:09:30 +00:00
Julia McGhee
27991e7309 Fix gitea-mcp COPY path: use explicit GOBIN instead of guessing GOPATH default
Some checks failed
Deploy Production / deploy (push) Failing after 1m5s
CI / build (push) Failing after 1m11s
CI / lint-and-test (push) Successful in 34s
golang:1.26-alpine uses GOPATH=/go (not /root/go), so the binary was
installed to /go/bin/gitea-mcp but the COPY looked at /root/go/bin/.
Set GOBIN=/usr/local/bin for a deterministic install location.

Also adds harness MCP server bundle to the image.
2026-03-21 21:06:11 +00:00
Julia McGhee
33e2d8505a Fix gitea-mcp builder: bump to Go 1.26 (current stable)
Some checks failed
CI / build (push) Failing after 53s
CI / lint-and-test (push) Successful in 34s
Deploy Production / deploy (push) Failing after 54s
gitea-mcp@v1.0.1 requires go >= 1.26.0. Go 1.26 was released Feb 2026.
2026-03-21 20:59:32 +00:00
Julia McGhee
b2fae6d296 Bump gitea-mcp builder to Go 1.24 to satisfy toolchain requirement
Some checks failed
CI / lint-and-test (push) Successful in 37s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
gitea-mcp@v1.0.1 requires go >= 1.26 toolchain directive which Go 1.22
cannot handle. Go 1.24 supports automatic toolchain resolution.
2026-03-21 20:58:42 +00:00
Julia McGhee
620fbc6b83 Add MCP servers (Gitea, K8s, Postgres, filesystem, git) to harness agents
Some checks failed
CI / lint-and-test (push) Successful in 36s
Deploy Production / deploy (push) Failing after 40s
CI / build (push) Failing after 59s
Wire 5 MCP servers into Claude Code agents spawned by the harness:
- Gitea MCP for repo/issue/PR management on self-hosted Gitea
- Kubernetes MCP with read-only RBAC for cluster inspection
- Postgres MCP with read-only user for database queries
- Filesystem and Git MCP scoped to task worktrees

Generates .claude/settings.json in each worktree before agent spawn.
Gracefully skips for Codex/OpenCode runtimes (no MCP support).

Also fixes node-pty build failure by using local Node.js headers
instead of downloading from unofficial-builds.nodejs.org (ECONNRESET).
2026-03-21 20:55:19 +00:00
Julia McGhee
a5ef56b052 Fix input focus loss in NewTaskTab form fields
Some checks failed
CI / lint-and-test (push) Successful in 32s
Deploy Production / deploy (push) Failing after 2m49s
CI / build (push) Failing after 3m32s
Move Field component out of NewTaskTab to prevent React from
remounting input wrappers on every keystroke. Same root cause as
the ProjectsTab DetailView fix.
2026-03-21 20:46:06 +00:00
Julia McGhee
af090b1de2 Fix input focus loss when creating a project
Some checks failed
CI / lint-and-test (push) Successful in 36s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
DetailView was defined as a component inside ProjectsTab's render,
causing React to unmount/remount it on every keystroke. Replace with
inline JSX so the input element identity stays stable across renders.
2026-03-21 20:45:12 +00:00
Julia McGhee
7bb091d4b3 Add interactive PTY Chat tab with xterm.js terminal emulator
Some checks failed
CI / lint-and-test (push) Successful in 33s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
Browser-based interactive terminal sessions with agent CLIs via
WebSocket + node-pty. Supports full TUI rendering (colors, cursor,
ctrl-c) through xterm.js in the browser.

Architecture: xterm.js ←WebSocket→ pty-server.js ←PTY→ agent CLI

- Extract shared buildAgentEnv() from executor into agent-env.ts
- Add internal /api/agents/[id]/env endpoint for PTY server
- Add pty-server.js (WebSocket + node-pty, max 3 sessions, 2hr cleanup)
- Add custom server.js wrapping Next.js with WebSocket upgrade
- Add ChatTab component with agent selector and terminal
- Wire CHAT tab into dashboard nav and render
- Configure serverExternalPackages for node-pty
- Update Dockerfile with build tools and custom server
- Bump k8s memory limit 1Gi → 2Gi for PTY sessions
2026-03-21 20:43:07 +00:00
gitea-actions[bot]
f45fa64855 deploy: update production images to ff0573703f 2026-03-21 20:36:48 +00:00
Julia McGhee
ff0573703f Fix harness Dockerfile standalone paths for monorepo workspace build
All checks were successful
CI / lint-and-test (push) Successful in 29s
Deploy Production / deploy (push) Successful in 1m9s
CI / build (push) Successful in 1m42s
Next.js standalone output nests server.js under apps/harness/ when
built from a pnpm workspace. Preserve the directory structure and
update CMD to point to the correct server.js path.
2026-03-21 20:35:09 +00:00
Julia McGhee
a687652bcd Add Gitea as a git provider for harness workspace repositories
Some checks failed
CI / lint-and-test (push) Successful in 30s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
Support Gitea alongside GitHub/GitLab for repo search, authenticated
cloning, and pull request creation via Gitea API. Tasks can specify
gitProvider and gitBaseUrl in their spec (defaults to github for
backwards compat). Auto-discovers GITEA_TOKEN from env on boot.
2026-03-21 20:33:35 +00:00
gitea-actions[bot]
11192da432 deploy: update production images to e2b339aac8 2026-03-21 20:28:54 +00:00
Julia McGhee
e2b339aac8 Auto-discover OpenCode Zen and Go models, add catalog search and pagination
All checks were successful
CI / lint-and-test (push) Successful in 29s
Deploy Production / deploy (push) Successful in 3m40s
CI / build (push) Successful in 1m34s
Add model fetchers for OpenCode Zen (https://opencode.ai/zen/v1/models) and
Go (https://opencode.ai/zen/go/v1/models) APIs. Register opencode-go as a new
provider, load shared credentials from auth.json, add known models with pricing,
and create default agents for both tiers on first boot.

Replace the manual "Add Model" form with a search bar that filters by model
name/ID and paginate the catalog at 25 models per page.
2026-03-21 20:24:38 +00:00
Julia McGhee
f0d9482bc8 Fix Docker build for harness workspace dependency on @homelab/db
Some checks failed
CI / lint-and-test (push) Successful in 29s
CI / build (push) Has been cancelled
Deploy Production / deploy (push) Has been cancelled
Switch harness Dockerfile to pnpm with repo root build context so
workspace:^ dependency on @homelab/db resolves. Use .dockercontext
marker file to opt individual apps into root context builds while
keeping web/api on their local app context.
2026-03-21 20:24:02 +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
gitea-actions[bot]
df351439d6 deploy: update production images to a60754d5a2 2026-03-21 20:00:58 +00:00
Julia McGhee
a60754d5a2 Fix boot state sharing across Next.js module boundaries
All checks were successful
CI / lint-and-test (push) Successful in 29s
Deploy Production / deploy (push) Successful in 47s
CI / build (push) Successful in 1m16s
Use globalThis for all in-memory stores (credentials, models, agents,
tasks) so the instrumentation hook and API route handlers share the
same data. Next.js bundles these as separate chunks with independent
module instances, causing boot-populated state to be invisible to
API routes.
2026-03-21 19:59:41 +00:00
gitea-actions[bot]
a079225367 deploy: update production images to 25b4769ff8 2026-03-21 19:54:48 +00:00
Julia McGhee
25b4769ff8 Auto-discover credentials, models, and agents on harness startup
All checks were successful
CI / lint-and-test (push) Successful in 20s
Deploy Production / deploy (push) Successful in 59s
CI / build (push) Successful in 1m13s
Read mounted secret files (Claude OAuth, OpenCode auth.json) and env
vars on boot, register them as credentials, fetch available models
from provider APIs, and create default agent configs for each viable
runtime+provider+model combination.
2026-03-21 19:53:29 +00:00
gitea-actions[bot]
e97614d568 deploy: update production images to df1111da15 2026-03-21 19:44:21 +00:00
Julia McGhee
df1111da15 Remove mock data from harness and add agent credential healthchecks
All checks were successful
CI / lint-and-test (push) Successful in 25s
Deploy Production / deploy (push) Successful in 59s
CI / build (push) Successful in 1m11s
Strip all seed/mock data (fake tasks, models, usage entries, agent configs)
so the dashboard starts clean and populates from real API state. Add
/api/agents/health endpoint that validates each agent's provider credentials
and CLI availability.
2026-03-21 19:42:53 +00:00
Julia McGhee
9a40240bd2 Enable ServerSideApply for app-of-apps to fix CRD annotation size limit
All checks were successful
CI / lint-and-test (push) Successful in 23s
Deploy Production / deploy (push) Successful in 25s
CI / build (push) Successful in 24s
ArgoCD v3.3 ApplicationSet CRD exceeds the 262144-byte client-side apply
annotation limit. ServerSideApply=true avoids this.
2026-03-21 19:33:24 +00:00
Julia McGhee
cfa9699926 Upgrade ArgoCD v2.13.3 → v3.3.4
Some checks failed
CI / lint-and-test (push) Successful in 28s
Deploy Production / deploy (push) Successful in 24s
CI / build (push) Has been cancelled
Stepped through v2.14.12 → v3.0.7 → v3.1.6 → v3.2.5 → v3.3.4.
Use server-side apply with force-conflicts for CRD size limits in v3.3+.
2026-03-21 19:32:09 +00:00
gitea-actions[bot]
28ec38bc59 deploy: update production images to fccf749598 2026-03-21 19:16:47 +00:00
Julia McGhee
fccf749598 Set Gitea deployment strategy to Recreate to avoid LevelDB lock conflicts
All checks were successful
CI / lint-and-test (push) Successful in 23s
Deploy Production / deploy (push) Successful in 15s
CI / build (push) Successful in 17s
2026-03-21 19:14:32 +00:00
Julia McGhee
0d7fa44577 Fix Gitea admin: use existing lazorgurl account and matching email
All checks were successful
CI / lint-and-test (push) Successful in 26s
CI / build (push) Successful in 22s
2026-03-21 19:06:41 +00:00
Julia McGhee
8eefb12c97 Fix Gitea admin init: set email explicitly to avoid default conflict
All checks were successful
CI / lint-and-test (push) Successful in 19s
CI / build (push) Successful in 16s
2026-03-21 19:05:32 +00:00
Julia McGhee
76cda86791 Fix Gitea upgrade: disable bundled valkey (renamed from redis in chart v12)
All checks were successful
CI / lint-and-test (push) Successful in 21s
CI / build (push) Successful in 23s
2026-03-21 19:03:20 +00:00
Julia McGhee
f7ffc91a4c Upgrade Gitea Helm chart 10.6.0 → 12.5.0 for workflow_dispatch UI
All checks were successful
CI / lint-and-test (push) Successful in 22s
CI / build (push) Successful in 21s
2026-03-21 19:00:58 +00:00
Julia McGhee
82225fa8c9 chore: trigger harness rebuild
All checks were successful
CI / lint-and-test (push) Successful in 23s
CI / build (push) Successful in 1m14s
2026-03-21 18:27:12 +00:00
Julia McGhee
3153f0eda5 chore: trigger web rebuild
All checks were successful
CI / lint-and-test (push) Successful in 19s
CI / build (push) Successful in 1m14s
2026-03-21 18:23:40 +00:00
Julia McGhee
3a15f6ed07 chore: trigger api rebuild
All checks were successful
CI / lint-and-test (push) Successful in 25s
CI / build (push) Successful in 29s
2026-03-21 18:21:11 +00:00
Julia McGhee
a525fc8aec chore: trigger full rebuild (7)
All checks were successful
CI / lint-and-test (push) Successful in 18s
CI / build (push) Successful in 2m11s
2026-03-21 18:13:19 +00:00