Commit Graph
374 Commits
Author SHA1 Message Date
Chris Scott ac9e584448 fix(terminal): limit output capture to action terminals and release them by handshake
- only action and setup terminals get a hub; shells use the shared bridge
  and keep OpenCode's full replay
- upstream close 1000 or 4404 ends the stream with that code; any other
  close fails the hub with 1011 so viewers reconnect through the bridge
- each connect attempt times out, and pre-open input overflow closes with
  1013 instead of dropping keystrokes
- deferred commands wait for a release line instead of sleeping; the hub
  sends it once on open, and the bridge fallback sends it if the hub failed
2026-10-23 15:45:36 -04:00
Chris Scott 20017d2f7d chore(opencode): move the typed OpenCode SDK to the 2.1.2 pin
The runtime pin moved to 2.1.2 while @opencode/client stayed at 2.0.15, so
the shared typed contract no longer matched the server.

- @opencode/client and @opencode/plugin move to 2.1.2
- session projection follows the 2.1 event shape (native replaces
  providerState and state, compaction drops recent)
- worktree error stubs carry the _tag discriminator
- the contract test fails when the SDK version drifts from the pin
2026-10-23 15:45:36 -04:00
Chris Scott 0c4c024dcc fix(settings): validate git identity emails only on the request path
A stored identity email that failed the stricter rule made every settings
read fall back to defaults, and the next save persisted that reset.

- the stored preferences schema accepts any email string again
- PATCH /api/settings rejects an invalid gitIdentity or gitIdentities email
  with a field path, and saves the trimmed address
- the rule accepts local hosts such as root@localhost
2026-10-23 15:45:36 -04:00
Chris Scott 19b52ecd58 chore(opencode): move the pinned OpenCode version to 2.1.2
The supported floor is derived from the pin, so this raises the accepted
range to >=2.1.2 <3.0.0 for the bundled image, managed installs, and the
version check that gates startup.

- Dockerfile ARG OPENCODE_VERSION and the shared pin move together
- CI e2e installs 2.1.2 instead of 2.0.24
- contract, installer, manager, registry and settings fixtures follow the new
  floor, keeping their below-floor and wrong-major rejection cases
2026-10-23 14:41:48 -04:00
Chris Scott 10190940bd fix(stt): accept speech endpoints configured with a trailing /v1
An endpoint saved as http://host/v1 was turned into /v1/v1/audio/transcriptions
and every transcription returned 404. Strip a trailing /v1 when deriving the
server base URL, which also covers TTS and model discovery.
2026-10-23 14:08:33 -04:00
ioplex dabe750920 fix: key auth rate limiting on the socket address only and clear sent drafts after unmount
- auth: drop the AUTH_TRUSTED_PROXY_HEADERS opt-in. Configured headers were
  trusted from any peer, so direct access to the published port could still
  rotate them. Better Auth now reads only the Manager-set socket address
  header; the env, compose forwarding, docs and tests are removed.
- composer: a send that completes after the composer unmounted (session
  switched mid-send) left the submitted text in the per-session draft store.
  Sends now complete through mutateAsync and clear the stored draft only if
  it still matches what was submitted, so newer edits are kept.
2026-10-23 12:49:53 -04:00
ioplex 4ec62cd4e7 fix: address findings from the full Docker evaluation of main
Critical and high:
- repos: unlinking a local repo removes only the Manager reference and alias,
  never the repository files; confirm button reads "Unlink"
- auth: rate-limit by the socket address; trust proxy headers only when
  AUTH_TRUSTED_PROXY_HEADERS is set (documented and forwarded in compose)
- composer: per-session in-memory drafts (text, bash mode, attachments);
  Escape no longer clears the prompt
- url params: compose same-tick updates so schedule dialogs stay closed after
  create/delete; delete dialog names the job

Medium:
- tool rows show failures (non-zero shell exit, failed exploration members)
- voice conversation shows the specific error and a starting state
- settings: Escape in dropdowns and the shortcut recorder no longer closes
  the dialog; mobile deep links open the requested section; one content tree
  per platform
- closing pushed sheets, settings, tool panels and schedule dialogs goes back
  in history
- login returns to the requested page; signed-out pages make no
  authenticated requests
- action terminals keep their output (Manager-side output capture and replay)
- unpushed-commit detection, commit message kept on failure
- binary files with unknown extensions are detected and not editable
- tool panel resizes when docked and floats as a dismissible sheet when the
  page is too narrow
- Docker image runs tini as PID 1

Low: not-found states, add-repo and branch validation errors (4xx),
search-aware empty states, mobile repo sort/filter/select cues, sidebar
resize affordance and collapse shortcut, mobile unread badge, preview port
filtering, terminal close handling, walkthrough empty state and helper
session filtering, placeholder contrast, permission labels and focus,
TTS task-list sanitizing, git identity email validation, quieter git
logging, hermetic worktree tests, and accessible names for icon-only
controls.
2026-10-23 11:42:37 -04:00
Chris Scott 993a635ce0 fix(auth): make session revocation immediate
Deleting session rows did not end a session while the 5 minute cookie
cache served the signed cookie without reading the database, so an admin
password reset left the old session usable. Drop the cache so session
state is always authoritative, and cover revocation with a test.
2026-10-21 15:18:50 +00:00
Chris Scott eb3937ef7e fix(auth): update auth stack and remove token logging
Upgrade better-auth and @better-auth/passkey to 1.7.12 and hono to
4.13.13, which clears every auth-related advisory in pnpm audit. The
lockfile also picks up patched kysely, @simplewebauthn/server and defu.

Drop the Set-Cookie and cookie-name logging that exposed session tokens,
match ADMIN_EMAIL case-insensitively, revoke admin sessions when
ADMIN_PASSWORD_RESET rotates the password, and require user verification
for passkeys.
2026-10-21 11:00:15 -04:00
Chris Scott 382b26806e fix(events): clear stale pending questions from remote servers
- Drop pending forms and permissions when a session is deleted or its page returns 404
- Reconcile remembered remote directories on browser reconnect, not only local repos
- Purge pending items from remote servers that are disabled or removed
- Prefer the viewed session's pending item over a pinned item from another session
- Time out remote proxy GET/HEAD requests that never send headers (504)
2026-10-20 21:01:16 +00:00
Chris Scott 24745597f2 Merge remote-tracking branch 'origin/feat/linked-opencode-servers' into feat/remote-server-automation
# Conflicts:
#	frontend/src/lib/navigation.test.ts
2026-10-19 11:37:57 -04:00
Chris Scott 1659664d53 fix(servers): test edited server URLs with the stored password
Test always checks the draft URL. When the password is left blank, the stored password is reused only if the draft URL has the same origin as the saved server.
2026-10-19 11:37:40 -04:00
Chris Scott cb9b7645e6 fix(opencode-import): skip caches and worktrees when importing host state
First-run state import copied the entire host OpenCode data directory, including snapshots, repos, binaries, logs and worktrees, which could reach tens of gigabytes, block startup, and recurse into the manager's own checkout. Skip those top-level entries and any entry containing the destination.
2026-10-19 10:16:32 -04:00
Chris Scott e4a4afbad4 fix(schedules): recover runs across reconnects and cancel on unavailable servers
Re-check monitored schedule sessions when their server's event stream reconnects, finalize cancellation without contacting a disabled or removed linked server, and tighten the disabled-server goal recovery test.
2026-10-18 21:59:15 -04:00
Chris Scott 5586120ba2 fix(servers): guard stored credentials and reconcile remote session status
Reject a server address change to a new origin unless a password or
pairing is supplied, so the stored password is never sent to another
host. Test connection now checks the edited values and warns when an
origin change needs credentials. Replay and reconcile remote session
statuses on stream reconnect and browser resync so linked-server
sessions no longer stay busy. Treat malformed server session URLs as
not found instead of throwing.
2026-10-18 21:53:19 -04:00
Chris Scott 7874afdab9 feat(servers): bring linked-server sessions to parity with local
Add a read-only Source Control panel for linked servers backed by the OpenCode VCS API, broadcast remote events to every client, include recent linked-server sessions in Activity with per-server sidebar indicators, and enable the session picker, tool shortcuts, mobile activity, remote Skills panel and remote permission prompt titles.
2026-10-18 21:46:14 -04:00
Chris Scott 9ec2ed5903 fix(servers): address CodeRabbit review on linked-server automation
Scope session permission modes and schedule locks by server, keep remote schedule cleanup working when a server is disabled or removed, harden the session server-scope migration and rollback, reject local server multi-run targets, widen schedule query invalidation, and update CLI fixtures for server-scoped schemas.
2026-10-18 21:01:53 -04:00
Chris Scott 780d31087b Merge remote-tracking branch 'origin/feat/linked-opencode-servers' into feat/remote-server-automation
# Conflicts:
#	backend/src/services/remote-server-events.ts
#	frontend/src/components/navigation/MoreDrawer.test.tsx
#	frontend/src/components/navigation/moreDrawerItems.test.ts
#	frontend/src/lib/opencode-event-stream/openCodeEventStream.ts
#	frontend/src/pages/SessionDetail.tsx
#	frontend/src/pages/__tests__/SessionDetail.remote.test.tsx
2026-10-18 20:53:23 -04:00
Chris Scott f566556fd6 feat(servers): harden pairing and run linked-server sessions in the UI
Replace the plaintext pairing exchange with a nonce and HMAC proof plus
AES-256-GCM encrypted credentials, bumping links to v2. Track session
ownership per linked server so activity, session picker, transcript, MCP
and skills views work against remote servers. Share encrypted secret
access, event routing and URL helpers across backend, shared and CLI.
2026-10-18 20:27:34 -04:00
Chris Scott a9bdb8358f feat(servers): run Manager automation on linked servers 2026-10-19 00:06:34 +00:00
Chris Scott c591c15743 feat(servers): link remote OpenCode servers with QR pairing 2026-10-18 22:35:39 +00:00
Chris Scott a0bdecd9fc fix(walkthrough): wait for the walkthrough to be ready before completing open_walkthrough 2026-10-16 20:09:20 +00:00
Chris Scott 33d9523666 Merge pull request #436 from chriswritescode-dev/feat/activity-switcher
feat(activity): surface active work across the session picker, tool rail and mobile
2026-10-16 12:48:52 -04:00
Chris Scott 84cdffa261 fix(activity): roll subagent activity up to its root and accept only selectable windows
- List child sessions in the activity query and credit each child's latest update
  to its root, so Recent includes roots whose subagents were active inside the
  window; children never become rows, and only roots of in-window children are
  fetched
- Show and sort activity rows by that rolled-up time
- Restrict activityWindowMinutes to the selectable options on write, and coerce a
  stored unknown value to the default on read so it cannot reset every preference
2026-10-16 11:57:52 -04:00
Chris Scott 0b637cadf4 feat(walkthrough): build the change walkthrough in a spawned agent session
Replace the fixed, stop-based walkthrough with an agent-built one. Every
request (Generate, Update, Regenerate, /walkthrough, the multi-run button
and the agent's open_walkthrough) now spawns a separate walkthrough
session. That session reads the diff through a new walkthrough_changes
action, writes one self-contained HTML file into a Manager-owned
directory, and calls publish_walkthrough; the panel renders the file in a
sandboxed frame shared with the inline artifact card and the file browser
HTML preview.

Publication marks the walkthrough ready while execution is tracked
separately, so Stop, the 15-minute limit, polling, refine gating and
interruption when the target session is deleted follow the agent instead
of the first publish. One diff copy is reused per run. Regenerate
interrupts the previous session and removes its output directory.

Walkthrough sessions are kept and listed, with their completion and error
push notifications muted. The stop pipeline, its wire schemas and the
concurrency limiter it used are removed.
2026-10-16 03:58:31 +00:00
Chris Scott e0a1c093c7 fix(sandbox): reject core.worktree and symlinked .git redirects when deriving VM mounts 2026-10-15 16:53:49 -04:00
Chris Scott 2d2921a6c6 fix(sandbox): verify worktree back-links, fail fast on root lookup, and tidy settings saves 2026-10-15 16:53:49 -04:00
Chris Scott 1d001bc43e feat(sandbox): remove session VMs when the sandbox is turned off or idle
Turning a session's sandbox off now removes its microVM and Docker data volume in the background. The idle sweep removes idle session VMs instead of stopping them, covering stopped VMs and VMs left from before a Manager restart, and starts when the Manager boots. Removal is serialized against boots so a command planned during a removal gets a fresh VM.
2026-10-15 16:53:49 -04:00
Chris Scott 27c673d830 fix(sandbox): recreate orphaned microVMs with --replace
A session VM create that fails partway leaves an orphaned msb sandbox that msb ls omits but every later create rejects as already existing, so the session could never get a VM again. Retry the create once with --replace when msb reports the name already exists.
2026-10-15 16:53:49 -04:00
Chris Scott 052218d5d6 fix(sse): notify listeners of events that cannot be routed to a directory
session.deleted carries only a session id, so after a Manager restart the aggregator could not resolve a directory for sessions created earlier and dropped the event before any listener ran. Deleting such a session leaked its sandbox microVM and volume, its sandbox and permission mode rows, goals, and walkthroughs. Listeners now receive unroutable events with a null directory.
2026-10-15 16:53:49 -04:00
Chris Scott b21fdf5b94 feat(sandbox): per-session sandbox VMs with resource settings and provider arbitration
- Sandbox new root sessions by default with a per-session composer toggle;
  child sessions inherit their root session's mode (OM-82)
- Run each sandboxed root session in its own microVM that mounts only the
  session's repository, with per-session CPU/memory overrides, Settings
  defaults, idle stop, and a cap on running VMs (OM-89)
- Arbitrate shell sandboxing with other plugins (opencode-forge) through the
  shared opencode.sandbox-arbiter.v1 registry so exactly one provider
  sandboxes each call regardless of load order; fail closed on claim errors
- Throw when another plugin rewrites a pinned sandbox shell setting
- Tag sandboxed tool results with the owning provider and show it in the badge
- Hint the agent to start Docker inside the VM only when OCM owns the session
2026-10-15 16:53:49 -04:00
Chris Scott ccdf75d803 Merge pull request #429 from chriswritescode-dev/feature/mobile-friendly-replies
feat(chat): tailor replies for mobile and text-to-speech
2026-10-15 16:45:28 -04:00
Chris Scott 6ee719cf1b fix: apply CodeRabbit auto-fixes 2026-10-15 15:58:21 -04:00
Chris Scott d102cd59a9 test(backend): isolate sandbox env and bound OpenCode stop in binary-backed tests 2026-10-15 17:54:38 +00:00
coderabbitai[bot] f80aa1c0e5 docs: document mobile session hooks, plugin test helpers, and viewport detection 2026-10-15 14:06:19 +00:00
Chris Scott b974618dee feat(chat): tailor replies for mobile and text-to-speech 2026-10-14 20:38:54 +00:00
Chris Scott e6b1fb8138 fix(permissions): prioritize the viewed session and add request context to the permission dialog 2026-10-14 01:04:40 -04:00
Chris Scott 59ffe6c586 Merge pull request #420 from chriswritescode-dev/feat/sandboxed-html-artifacts
feat(artifacts): render agent HTML files inline in the session chat
2026-10-13 09:30:59 -04:00
Chris Scott be93975d90 feat(markdown): render inline images in messages and markdown files
Route markdown image nodes through a shared MarkdownImage component that
loads local paths through the raw file API, and allow data:image/* sources
through the sanitizer and URL transform so inline images survive rendering.

Render image attachments as thumbnails in the message thread, and accept
image/webp uploads.
2026-10-13 00:29:00 +00:00
Chris Scott 5e2452172c fix(artifacts): render artifacts from the checked path and serve raw files once
- show_artifact returns the validated path as tool metadata; the chat card
  renders from it and maps repo paths with getWorkspaceFilePath, so local
  repos and moved sessions load the right file
- serve .htm as text/html
- raw file route stats and reads once and adds ETag/Last-Modified with 304
- reuse isPathWithinRoot from utils/fs-safe
- move readShowArtifactCall to frontend/src/lib/artifactTool
2026-10-12 16:43:04 -04:00
Chris Scott f7b2ffb865 feat(artifacts): render agent HTML files inline in the session chat 2026-10-12 16:43:04 -04:00
Chris Scott 51e92d8cf2 Merge pull request #416 from chriswritescode-dev/fix/tts-overlap-and-cache-race
fix(tts): prevent overlapping playback and corrupted audio cache
2026-10-11 00:19:15 -04:00
Chris Scott 0b76b6d3c7 test(fs-safe): cover writeFileAtomic failure cleanup and default mode 2026-10-11 00:18:47 -04:00
Chris Scott bda123b6e1 refactor(tts): reuse the shared atomic write helper for the audio cache 2026-10-11 00:14:14 -04:00
Chris Scott d7022b5059 feat(walkthrough): use the selected session model for generation 2026-10-10 23:09:36 -04:00
Chris Scott adaf175ccf fix: apply CodeRabbit auto-fixes 2026-10-10 22:25:33 -04:00
Chris Scott d4a5f46ac6 fix(walkthrough): cancel generation cleanly before the first model call
Guard every newly generated persistence point and each await before it so a
cancelled generation cannot write a walkthrough after DELETE is accepted,
including the mechanical-only path. Treat an aborted model-catalog resolution
as cancellation rather than a model-resolution failure, and let startGeneration
return the stopped state for cancellation while preserving genuine errors.
2026-10-10 15:29:20 -04:00
Chris Scott 169ee25a8a fix(tts): key the audio cache by provider and add a settings clear action
- Hash text, voice, model, speed, normalized endpoint and API key into one SHA-256 key shared by the disk cache and in-flight synthesis, so different providers cannot reuse each other's audio and old keys are not read as fallback.
- Add DELETE /api/tts/cache to remove completed cached audio files, keep temporary files, tolerate missing files and report real failures.
- Add a Clear audio cache action to TTS settings, available even when TTS is disabled or the builtin provider is selected, with pending, success and retryable error states.
2026-10-10 14:54:53 -04:00
Chris Scott 0752ebf360 feat(walkthrough): stop an in-flight change walkthrough generation
Add DELETE /api/change-walkthroughs/:sessionId to cancel the generation for a session and source. The service removes the in-flight entry, persists the partial walkthrough, and aborts a per-generation signal threaded through model resolution and every model call. Cancellation is not recorded as a failure and leaves the remaining stops pending. A Stop button in the walkthrough chrome calls the new endpoint.
2026-10-10 17:48:14 +00:00
Chris Scott 1eba33c6f1 fix(tts): bound synthesis requests and tolerate cache write failures 2026-10-09 23:57:09 -04:00