Commit Graph

36 Commits

Author SHA1 Message Date
Gabriel Brown 15407e7e9c Workspace Terminal tab: xterm front end + short-lived token route
- New Terminal tab in the workspace shell, backed by xterm.js, that connects
  to the worker's PTY WebSocket using a short-lived token minted by
  /api/agent-jobs/:id/terminal-token (owner-auth'd, never exposes the worker
  secret to the browser)
- Site-matched xterm theme (light/dark, live theme switching), Victor Mono,
  binary stdin + JSON resize protocol, reconnect, graceful 'not configured'
  state when NEXT_PUBLIC_SPOON_AGENT_WORKER_WS_URL is unset
- env: NEXT_PUBLIC_SPOON_AGENT_WORKER_WS_URL (client), SPOON_AGENT_TERMINAL_SECRET
2026-06-24 08:23:58 -04:00
Gabriel Brown c1263b2e69 Worker: interactive terminal WebSocket bridge (PTY in workspace container)
- attachTerminalServer() upgrades /jobs/:id/terminal WS connections, verifying a
  short-lived job-scoped HMAC token (verifyTerminalToken) so the browser never
  holds the worker secret
- Bridges the socket to a bash PTY via dockerode exec (Tty) in a persistent
  per-job shell container (spoon-agent-term-<id>) mounting the workspace; binary
  frames = stdin, JSON text frames = resize; idle containers reaped after 30m
- New env: SPOON_AGENT_TERMINAL_IMAGE/SECRET/IDLE_MS (secret falls back to the
  shared worker internal token)
2026-06-24 08:16:39 -04:00
Gabriel Brown 1072cf10cd Editor: site-matched theme, Victor Mono font, no false TS errors
- Add spoon-dark/spoon-light Monaco themes built from the site's design tokens
  (teal --primary accent), switched by next-themes resolvedTheme
- Use Victor Mono (with ligatures + italic comments) for the editor font
- Disable Monaco's in-browser TS *semantic* diagnostics, which were false
  positives (no node_modules / path aliases in the browser) e.g. 'Cannot find
  module ~/server/auth'; keep real syntax-error reporting
2026-06-24 07:45:24 -04:00
Gabriel Brown ae90681d9b Add workspace loading state; auto-refresh diff on agent changes
- Gate the tree/diff/status loads (and 5s poll) on workspaceStatus being
  active/idle, so we no longer hammer the 'workspace is not active' endpoint
  while a worker is still picking up the job
- Show a 'Setting up your workspace…' pending state instead of surfacing
  startup as a console error / stale-workspace recovery box; escalate to a
  softer 'still waiting' hint after 90s if no worker picks it up
- Auto-reload the diff and file tree (debounced) whenever the agent records a
  workspace change or a turn starts/ends, so diffs appear without a manual
  Refresh
- The recovery box now only appears for a genuinely lost workspace (Convex
  reports active but the worker can't reach it)
2026-06-24 07:29:38 -04:00
Gabriel Brown bb471a0917 Improve workspace/chat diff viewer with syntax highlighting & per-file view
Replace the raw single-blob diff dump (Monaco, language=diff) and the plain
<pre> file diffs in chat with @git-diff-view/react:
- Parse the unified git diff into structured per-file entries (status,
  +/- counts, binary detection) via parseDiffFiles()
- Workspace Diff tab: collapsible per-file cards with status badges, line
  counts, syntax highlighting, and a Unified/Split toggle
- Agent chat: render each change's diff highlighted instead of plain text
- Theme follows next-themes resolvedTheme (light/dark)
2026-06-24 07:08:43 -04:00
Gabriel Brown 40a6dd78e4 Fix worker image missing docker CLI; harden spawn-failure handling
Build and Push Spoon Images / quality (push) Successful in 1m47s
Build and Push Spoon Images / build-images (push) Successful in 6m33s
Root cause of the prod empty-response: the spoon-agent-worker image shipped
without a docker CLI binary, so it could never launch the codex job container.
On Debian trixie (the bun base) 'docker.io' + --no-install-recommends installs
the daemon package but omits the client (split into 'docker-cli'), leaving no
'docker' on PATH. execa('docker', ...) hit ENOENT, and with reject:false that
resolves with exitCode undefined -> coerced to 0 -> looked like a successful
empty run -> 'Codex completed without producing an assistant response'.

- agent-worker.Dockerfile: drop docker.io, install the official static docker
  CLI client pinned to 29.5.3 (matches the host daemon) to /usr/local/bin/docker
- runtime/docker.ts: normalizeRunResult() so a spawn failure (exitCode null) is
  always a non-zero exit carrying the real reason, never a silent empty success
- tests: cover the spawn-failure and normal-result paths
2026-06-24 06:31:17 -04:00
gib a2976481d7 Merge pull request 'Fix agent empty-response in prod: workdir mount, image freshness, error surfacing' (#1) from fix/agent-prod-empty-response into main
Build and Push Spoon Images / quality (push) Successful in 1m36s
Build and Push Spoon Images / build-images (push) Successful in 7m56s
Reviewed-on: #1
2026-06-24 04:42:42 -05:00
Gabriel Brown 9643cb197b Fix agent empty-response in prod: workdir mount, image freshness, error surfacing
- Pin codex@0.142.0 + opencode-ai@1.17.9 in the job image (was @latest,
  causing dev/prod drift)
- Worker now s the job image once per process so prod stops
  running a stale Codex
- Surface Codex error/turn.failed events instead of swallowing them, so the
  real failure reason is reported rather than 'no assistant response'
- Harden the Codex JSON parser to also handle the legacy msg-wrapped shape
- Fix the docker-in-docker workdir: bind-mount identical host:container path
  and set SPOON_AGENT_HOST_WORKDIR (named volume can't be mounted by sibling
  job containers)
- Add docs/compose.prod.yml as a documented reference deployment
2026-06-24 05:38:35 -04:00
Gabriel Brown 980a2c07e8 Update stuff
Build and Push Spoon Images / quality (push) Successful in 2m28s
Build and Push Spoon Images / build-images (push) Successful in 9m53s
2026-06-23 22:27:23 -04:00
Gabriel Brown 4fee7bf50d Update worker
Build and Push Spoon Images / quality (push) Successful in 2m18s
Build and Push Spoon Images / build-images (push) Successful in 8m26s
2026-06-23 22:10:25 -04:00
Gabriel Brown 30a17196f5 fix worker forreal
Build and Push Spoon Images / quality (push) Successful in 1m45s
Build and Push Spoon Images / build-images (push) Successful in 7m35s
2026-06-23 21:38:41 -04:00
Gabriel Brown c3d265d428 Fix worker 2026-06-23 20:35:01 -04:00
Gabriel Brown 5567a4be95 allow users to delete threads from spoons details page
Build and Push Spoon Images / quality (push) Successful in 2m36s
Build and Push Spoon Images / build-images (push) Successful in 9m21s
2026-06-23 16:00:34 -04:00
Gabriel Brown a6f7ea7f78 Clean up old stuff & fix ui errors
Build and Push Spoon Images / quality (push) Successful in 2m22s
Build and Push Spoon Images / build-images (push) Successful in 23m10s
2026-06-23 14:57:05 -04:00
Gabriel Brown d207b8b0b8 Add features & update project
Build and Push Spoon Images / quality (push) Successful in 1m41s
Build and Push Spoon Images / build-images (push) Successful in 7m4s
2026-06-23 02:06:58 -04:00
Gabriel Brown fe72fc2957 Add features & update project 2026-06-23 01:46:08 -04:00
Gabriel Brown 930fbf5965 Try to fix workers and workspace
Build and Push Spoon Images / quality (push) Successful in 1m40s
Build and Push Spoon Images / build-images (push) Successful in 7m0s
2026-06-22 23:17:27 -04:00
Gabriel Brown f33f76d874 Trying to build worker images
Build and Push Spoon Images / quality (push) Successful in 1m52s
Build and Push Spoon Images / build-images (push) Successful in 8m19s
2026-06-22 20:29:10 -04:00
Gabriel Brown 7e7bec56d5 Add way for infisical to switch accounts when signed into wrong account
Build and Push Next App / quality (push) Successful in 1m34s
Build and Push Next App / build-next (push) Successful in 4m11s
2026-06-22 13:14:25 -04:00
Gabriel Brown 42f95530de Update expo application
Build and Push Next App / quality (push) Successful in 1m27s
Build and Push Next App / build-next (push) Successful in 3m58s
2026-06-22 12:13:02 -04:00
Gabriel Brown ddce5efb13 Update README.md & fix test
Build and Push Next App / quality (push) Successful in 1m40s
Build and Push Next App / build-next (push) Successful in 4m17s
2026-06-22 10:42:47 -04:00
Gabriel Brown 206b64176b Move to threads based system. 2026-06-22 10:37:26 -04:00
Gabriel Brown 8ae6c4b533 Add bulk add .env variables
Build and Push Next App / quality (push) Successful in 1m23s
Build and Push Next App / build-next (push) Successful in 3m35s
2026-06-22 01:12:13 -05:00
Gabriel Brown 4114d5595c Update stuff
Build and Push Next App / quality (push) Successful in 1m21s
Build and Push Next App / build-next (push) Successful in 3m34s
2026-06-22 00:41:51 -05:00
Gabriel Brown 2e13febfc7 Update stuff
Build and Push Next App / quality (push) Successful in 1m24s
Build and Push Next App / build-next (push) Successful in 3m36s
2026-06-21 23:49:08 -05:00
Gabriel Brown b16cd9e2f7 Update stuff
Build and Push Next App / quality (push) Successful in 1m34s
Build and Push Next App / build-next (push) Successful in 3m22s
2026-06-21 23:22:05 -05:00
Gabriel Brown 112fd55ea7 Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Successful in 1m32s
Build and Push Next App / build-next (push) Successful in 42s
2026-06-21 22:32:02 -05:00
Gabriel Brown 48071d1afe Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Successful in 1m41s
Build and Push Next App / build-next (push) Successful in 3m36s
2026-06-21 22:01:04 -05:00
Gabriel Brown fa83f720a8 Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Successful in 2m3s
Build and Push Next App / build-next (push) Failing after 4s
2026-06-21 21:55:58 -05:00
Gabriel Brown b9c13b944f Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Failing after 43s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 21:52:37 -05:00
Gabriel Brown efb0237145 Update stuff so we can pass build hopefully
Build and Push Next App / build-next (push) Has been cancelled
Build and Push Next App / quality (push) Has been cancelled
2026-06-21 21:51:41 -05:00
Gabriel Brown c33d3cc02d Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Failing after 39s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 21:48:03 -05:00
Gabriel Brown 97d29200d3 Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Failing after 1m0s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 21:33:45 -05:00
Gabriel Brown 750c3e7923 Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Failing after 57s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 21:28:57 -05:00
Gabriel Brown 2dfa97ee4f Add agent workflows & stuff
Build and Push Next App / quality (push) Failing after 48s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 21:15:15 -05:00
Gabriel Brown cf7ff2ee4e Initial commit for project Spoon!
Build and Push Next App / quality (push) Failing after 45s
Build and Push Next App / build-next (push) Has been skipped
2026-06-21 17:52:02 -05:00