Commit Graph
326 Commits
Author SHA1 Message Date
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 1eba33c6f1 fix(tts): bound synthesis requests and tolerate cache write failures 2026-10-09 23:57:09 -04:00
Chris Scott aed50e6d99 fix(tts): dedupe concurrent synthesis and write the audio cache atomically
- Write cached audio to a temp file and rename it into place so a concurrent read never sees a partial or interleaved file.
- Share one upstream synthesis call per text and cache key, so concurrent requests no longer produce different recordings that race on the same file.
- Return the same upstream error to every waiter.
2026-10-09 22:16:04 -04:00
Chris Scott 9c32ba2038 fix(models): reload the model catalog on reconnect and broadcast its events
Model pickers without a location, such as the goal auditor and walkthrough model settings, could stay stuck on an empty model list. OpenCode's model and provider catalog events were only delivered to clients subscribed to the originating directory, and the provider catalog was not reloaded on a browser stream reconnect or upstream resync, so a list cached empty while OpenCode was loading or restarting never refreshed.

Route model.updated, provider.updated and integration.updated through the resolved-event broadcast like the command, agent and skill catalogs, and reload the provider catalog on reconnect and resync alongside them.
2026-10-09 11:43:48 -04:00
Chris Scott c497df5161 fix(walkthrough): address review of agent-opened walkthrough
- Wait for the model catalog once per walkthrough generation instead of before every model call
- Report open_walkthrough as requested, not opened, and drop its unused metadata
- Share the ocm tool and action names through @opencode-manager/shared
- Remove the unused source-request nonce and duplicate session check
- Scan only new messages when auto-opening the walkthrough
- Assert the request action cannot reach the internal change-walkthroughs route
2026-10-09 11:25:26 -04:00
Chris Scott aa1da8d608 feat(walkthrough): open the change walkthrough from an agent tool call 2026-10-09 11:03:21 -04:00
Chris Scott 04cb3f8291 Merge pull request #408 from chriswritescode-dev/feat/ocm-move-worktree
feat(ocm): move sessions into OpenCode worktrees instead of replacing the Manager checkout
2026-10-09 00:04:34 -04:00
Chris Scott a3af0866b9 fix(ocm): apply working-tree changes when moving into a new worktree
Moving a session into a new worktree uploaded only the git bundle, so
staged, unstaged and untracked changes were dropped, unlike moves into
the main checkout or an existing worktree.

The CLI now sends the working-tree patch with the worktree-create request
behind an X-OCM-Patch-Bytes header, and the backend applies it right after
importing the bundle and before worktree setup runs, so setup sees the
edits. A patch that fails to apply removes the new worktree instead of
leaving it half-created.
2026-10-09 00:04:00 -04:00
Chris Scott 67f70e9635 fix(ocm): make /ocm-move worktree moves safe and round-trippable
- Answer the old /mirror/target routes with a 410 upgrade message and
  serve the lookup at GET /mirror/checkouts; detect older Managers via
  the token probe (MANAGER_FEATURE_MISSING).
- Create the move worktree and import the bundle in one call; worktree
  setup runs after the import and the worktree is removed on failure.
- Never rewind a server branch: suffix the new worktree branch when the
  server branch has commits the local branch lacks, and skip both the
  source and target branch when updating refs.
- Reuse clean <branch>-ocm[-N] worktrees and legacy worktree repo rows
  instead of creating new ones on every move.
- Let ocm push/pull target the worktree on the local branch via a
  directory parameter on the mirror read routes; no tarball fallback
  for worktrees.
- Share one sibling loader (listRepoSiblings), validate branch names,
  compare canonical paths in isDirectoryInUse, and cut redundant git
  work in the checkouts lookup and the CLI destination choice.
2026-10-08 23:23:00 -04:00
Chris Scott bd7c3e3fef feat(ocm): move sessions into OpenCode worktrees instead of replacing the Manager checkout
/ocm-move previously failed when the Manager checkout was dirty, behind, or on
another branch. Choose the destination instead: replace in place only when the
checkout is on the local branch, clean, and has nothing the local branch lacks;
otherwise reuse an existing OpenCode worktree on that branch when it is equally
safe; otherwise create a new OpenCode worktree through the same service the UI
and multi-runs use, so it appears in the repo's worktree lists. The new
worktree's branch is the local branch when free, else <branch>-ocm, -ocm-2 and
so on. Server work is never discarded, the confirmation states the destination
and why the main checkout was skipped, and a detached HEAD is refused.

The mirror push endpoints (bundle upload and patch) accept a worktree
directory, rejected unless it belongs to the repo, and a new endpoint creates
the worktree. The old <repo>-<branch> path that registered a plain git worktree
as a separate Manager repo is removed.
2026-10-08 20:47:02 -04:00
Chris Scott b01d3ab6db Merge branch 'main' into feat/walkthrough-plan-explain
Resolve ChangesWalkthroughSheet conflicts by keeping main's overview/paging model and the branch's source picker, per-stop status, and mechanical hunks.
2026-10-08 17:36:07 -04:00
Chris Scott 4119fec60a fix: apply CodeRabbit auto-fixes 2026-10-08 16:47:24 -04:00
Chris Scott 88b3543dc1 feat(walkthrough): plan-then-explain generation with selectable diff sources 2026-10-08 15:53:49 -04:00
Chris Scott d5f56fc061 section 12: Phase 12 — Per-source storage, service and routes 2026-10-08 15:53:27 -04:00
Chris Scott 11c23da67e section 11: Phase 11 — Diff sources: contract and git reader 2026-10-08 15:53:27 -04:00
Chris Scott 229b16cd86 section 9: Phase 9 — Walkthrough model preference (backend) 2026-10-08 15:53:27 -04:00
Chris Scott 64f8869cca section 7: Phase 7 — Incremental reuse and per-stop retry 2026-10-08 15:53:27 -04:00
Chris Scott 24b7af216b section 6: Phase 6 — Explain stops in parallel with progressive saves 2026-10-08 15:53:27 -04:00
Chris Scott 76fb634b66 section 5: Phase 5 — Outline and plan prompt (pure functions) 2026-10-08 15:53:27 -04:00
Chris Scott daf9a96a92 section 4: Phase 4 — One retry per model call 2026-10-08 15:53:26 -04:00
Chris Scott 583a99ffb8 section 3: Phase 3 — Mechanical changes stop 2026-10-08 15:53:26 -04:00
Chris Scott 7bf6c35f29 section 2: Phase 2 — Content-hashed hunk ids and stop status 2026-10-08 15:53:26 -04:00
Chris Scott 4b5f76f416 section 1: Phase 1 — Stop recomputing the session diff on every poll 2026-10-08 15:53:26 -04:00
Chris Scott b16f1f8944 fix(commands): broadcast location catalog events to all stream clients
Location-scoped command, agent and skill catalog events were only delivered to clients subscribed to the originating directory, so a client attached to another location never saw a catalog change and its slash menu stayed on the builtin commands. Route command.updated, agent.updated and skill.updated through the resolved-event broadcast so every connected client receives them.
2026-10-08 15:49:11 -04:00
Chris Scott 994a8b82e8 feat(shortcuts): rework shortcut bindings, focus restore, and input guards
Resolve effective bindings from stored prefs plus defaults with leader/direct collision handling and default leader Ctrl+X; let direct actions pass through in terminals and suppress abort while an overlay is open. Add half-page scroll disengage, verified overlay focus restore, and consolidate prompt reset.
2026-10-08 12:40:04 -04:00
Chris Scott 09630a7794 feat(walkthrough): dock change walkthrough in the desktop tool panel
Share walkthrough state through a context provider so navigation and regenerate controls render in the panel chrome, generate walkthroughs with the session's selected model, and dedupe a favorite that is also the default model in model sections.
2026-10-08 00:57:29 -04:00
Chris Scott cbdaf164d9 fix(generate-text): resolve default model from global config catalog 2026-10-08 00:39:09 -04:00
Chris Scott 485ab940aa feat(ui): dock repo and session tools in a desktop side panel
Add a docked desktop tool panel with an icon rail, driven by the shared panel URL param, and keep the mobile dialogs and drawers. Extract dialog bodies into reusable content components, rename the walkthrough dialog to a sheet, and make walkthrough generation asynchronous with client polling.
2026-10-07 23:58:56 -04:00
Chris Scott 4b6df6cf5f docs(ocm): refresh env and CLI guides and redact internal settings secrets 2026-10-07 22:17:46 -04:00
Chris Scott e42ce1bd56 Merge pull request #397 from chriswritescode-dev/fix/remote-terminal-proxy
fix(proxy): bridge ticketed PTY WebSockets for remote terminals
2026-10-07 21:48:18 -04:00
Chris Scott 958cf7cd53 fix(proxy): harden remote terminal WebSocket bridging
Restrict the token-free proxy socket to ticketed persistent PTY connects.
OpenCode builds per-directory services before it validates an /api/pty
ticket, so that route must not be reachable without the Manager token.

- Reject untrusted Origins and an uninitialized lifecycle before upgrading
- Open the upstream socket first and answer 403 on rejection instead of
  upgrading and closing
- Handle ticketed sockets before the repo lookup and the password read
- Cap client-to-upstream buffering at 4 MiB and add a 10 s connect deadline
- Share bridge handlers, peer wrapper, proxy prefix and WebSocket URL helpers
- Remove persistent PTYs with their directory in TerminalService.removeAll
2026-10-07 21:22:15 -04:00
Chris Scott 98668f684b fix(proxy): bridge ticketed PTY WebSockets for remote terminals 2026-10-07 20:27:33 -04:00
Chris Scott c41149dc39 fix(tui): address review follow-ups for session goals and multi-runs 2026-10-07 20:26:49 -04:00
Chris Scott 1e852c935a feat(tui): add session goals, multi-runs and server switching to the ocm TUI
Expose session goals and multi-runs on the Manager internal API, add shared goal label formatters, and add the /goal, /multirun and /ocm commands with their dialogs, Manager auth and API helpers, and tests.
2026-10-07 19:01:52 -04:00
Chris Scott e8548b1e07 section 1: Phase 1: Expose session goals and multi-runs on the internal 2026-10-07 18:33:03 -04:00
Chris Scott ec96ac0d55 feat(multi-run): always run fusions in a new worktree 2026-10-07 13:12:25 -04:00
Chris Scott 30783c49ec fix(multi-run): deny defaults on fusion session permissions 2026-10-07 12:07:56 -04:00
Chris Scott 00b38552bf fix(multi-run): log fusion permission-mode failures separately
applyDefaultMode ran inside the launch try/catch, so a permission-mode
failure was swallowed by the launch-failure handler instead of being
logged, and any later post-launch step was skipped. Move it into its own
try/catch that logs with the session id, leaving the fusion started.
2026-10-07 11:53:06 -04:00
Chris Scott f2e06abb62 feat(multi-run): add a runs sheet with inline fusion
Replace the centered Multi-run dialog and the stacked Fusion dialog with one
right-side runs sheet, turn fusion into an inline selection mode, and
pre-approve each selected source workspace for the fusion session.

- Move MultiRunDialog into a SideDrawer with Runs / New run tabs; add
  MultiRunCard, FusionComposer and an optimistic starting fusion.
- Add buildFusionSourcePermissionRuleset (external_directory allow, edit deny)
  and thread permissions through SessionLauncher.launch.
- Apply the default permission mode to fusion sessions after launch.
- Let ModelCombobox and BranchCombobox take a listClassName; make SideDrawer
  ignore an Escape already handled by a nested layer.
2026-10-07 11:36:36 -04:00
Chris Scott 4cc9785948 fix(ocm): pass workspace directories through the repo proxy
Keep any directory inside the Manager workspace (repos, OpenCode and
schedule worktrees) instead of forcing the bound repo, so /projects and
worktree session lists work. Only remap a directory the client sent on the
session list, and stop adding a directory filter to lists that carry none.
2026-10-06 23:02:56 -04:00
Chris Scott f952a99b37 fix(ocm): scope the repo proxy to the requested worktree 2026-10-06 22:47:43 -04:00
Chris Scott 65b72e55ae refactor: unify model selection with the TUI
Align the manager's model selection with the OpenCode TUI: one
model.json-backed preference store, one provider catalog, one ordering
and default-ownership rule, and one set of availability, ref-formatting
and variant helpers shared across chat, schedules, agents and the goal
auditor.

- Add a shared TUI-compatible model-preference module and make the
  backend model.json store match its format.
- Consolidate the frontend provider catalog, availability check, model
  ref formatter and variant persistence into single owners.
- Drive chat, schedule, agent and goal-auditor model lists from a shared
  useModelSections hook and buildModelSections, following TUI ordering.
- Extract a shared ModelCombobox with a taller list, and list models the
  TUI way in ModelQuickSelect.
- Add a shared isRecord util and model-selection comparison helpers.
2026-10-06 20:44:27 -04:00
Chris Scott 3d143568c1 fix: sanitize rendered markdown HTML
Add a shared rehype pipeline (rehype-raw -> rehype-sanitize -> rehype-highlight) to every markdown renderer so scripts, frames and event handlers are stripped from model output and repository files while safe HTML and highlighting survive.

Also delete change walkthroughs when their session is deleted (including in-flight generation), build schedule model options from default/favorite/recent state, and include 127.0.0.1 origins in the default trusted origins.
2026-10-06 19:27:49 -04:00
Chris Scott b36d412ca2 feat: add multi-run fusion and session change walkthroughs
Fuse two to five completed multi-run entries into one synthesized session,
and explain a session's diff as ordered walkthrough stops cached by diff hash.

- Multi-run fusion service, persistence, routes and FuseRunDialog
- Change walkthrough service, persistence, routes and ChangesWalkthroughDialog
- Shared unified-diff parser plus bounded text generation, json-extract,
  text-truncate and service-error helpers
2026-10-06 15:27:14 -04:00
Chris Scott 26ff08d891 feat(schedules): require worktrees and choose commit or discard on removal
Drop the repo workspace mode so every scheduled run executes in a
worktree. Clearing run history or deleting a run now asks whether to
commit pending changes and keep the run branches, or force-remove the
worktrees and delete the branches.

Sibling repo listings carry the schedule name, and the repo detail
workspace view subscribes to schedule worktree sessions only while
expanded. Also unify schedule worktree path/branch helpers, refuse a run
branch already checked out elsewhere, and clean up terminals when a
worktree is removed.
2026-10-06 11:02:29 -04:00
Chris Scott 6ec3f3bd91 feat(schedules): add workspace modes and worktree management 2026-10-06 10:16:34 -04:00
Chris Scott 27996ed12d feat(docker): one-line installer and release Compose file
Add scripts/install.sh, a one-line installer that checks Docker and
Compose v2, installs into ~/opencode-manager (override with OCM_DIR),
prompts for an optional OpenCode config import, a repos folder mount and
LAN sign-in, then pulls and starts the published image.

- Add docker-compose.release.yml, which runs the published image under
  the Compose project name ocm; a checkout's docker-compose.yml keeps
  building from source
- Generate AUTH_SECRET on first container start and persist it to the
  data volume when unset, so Compose installs need no .env
- Refuse to install over a source checkout or beside an existing
  install, so volumes and the auth secret are not silently replaced
- Test the installer, entrypoint secret handling, and the two Compose
  files staying in step
2026-10-05 15:07:23 -04:00
Chris Scott 5138cd6a76 docs(ocm): note cloning status in repo clone response 2026-10-05 15:00:00 -04:00
Chris Scott c9be507f4e feat(ocm): let the assistant clone repos through POST /repos 2026-10-05 17:28:18 +00:00
Chris Scott 9b405325c0 test(backend): allow admin sign-in test time for scrypt under coverage 2026-10-05 17:08:57 +00:00