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.
- 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.
/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.
Resolve ChangesWalkthroughSheet conflicts by keeping main's overview/paging model and the branch's source picker, per-stop status, and mechanical hunks.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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
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.
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
Remove the in-repo MkDocs site, its deploy workflow, and the tests that
asserted its content. Repoint README, CONTRIBUTING, and .env.example links
to opencodemanager.app/docs, and update logos, favicon, PWA icons, manifest,
and image alt text to the OpenCode Manager branding.
feat: integrated terminal, project actions and dev server preview (OM-17, OM-18, OM-19)
Integration with #380 and #379:
- Adopt the git-config identity model: drop the branch's identity stubs
(getShellEnv, getAssignedGitIdentityEnv, repo identity ids, duplicate
createGitService and getMainCheckoutPath); terminals receive only the
GitHub token env and take their commit identity from git config.
- Add RepoWorkspaceService as the single owner of OpenCode workspace
side effects: worktree setup commands on create and terminal cleanup on
remove, used by the workspace routes, the session launcher (ocm tool and
multi-run) and multi-run discard, with one worktree-sibling matcher.
- Run repo-delete terminal cleanup inside the worktree branch deletion
flow.
- Combine the CreateWorktreeDialog tests and update docs for the identity
model and setup command coverage.
- Delete a remote branch only when the upstream (read from
branch.<name>.remote and branch.<name>.merge) has the same name;
otherwise refuse with REMOTE_BRANCH_MISMATCH before deleting anything.
- Without force, require the branch to be merged into HEAD before
deleting its remote branch, so pushed unmerged commits are not lost.
- Cherry-pick integration selects only commits not yet applied to the
target and skips merge commits.
- Create worktrees from a remote-only base as origin/<branch>.
- Show the upstream name in the branch delete dialog and update the
worktree delete option text and git docs.
feat(sessions): add permission modes, session goals, ocm session tool and multi-run
Resolve the duplicate parseJsonBody added by both #380 and #379 into one
helper: #379's result shape and allowEmpty option, with the first
validation message as the error and the issues as details. Update the
repo-git callers, affected route tests and the internal API docs.
- Create a worktree from a new or existing branch
- Integrate a worktree branch into a target branch by merge commit or cherry-pick, with continue/abort on conflicts
- Delete a worktree with keep, delete-local, or delete-local-and-remote branch options, using safe branch deletion for unmerged branches
- Add a stash tab (list, push, apply, pop, drop) shared across a repository and its worktrees
- Rename and delete branches, optionally deleting the remote branch and updating scheduled base branches
- Detect in-progress merge, rebase, cherry-pick and revert operations and hand conflicts to an agent session
- Generate commit messages from staged changes with the default model
- Add a default git identity and saved per-repository identities written to git config
- Unify git error mapping behind a typed error and one route helper; consolidate git mutations and cache invalidation
- Update repository docs
Per-session permission modes: each root session runs in ask or auto.
Auto answers each permission request once from the backend, child
sessions inherit their root's mode, forks copy the source's mode, and
scheduled runs and agent-created sessions stay on ask. A lock reason
reports why a session's mode cannot change.
Session goals: arm a goal in the composer and a backend audit loop keeps
the session working until an auditor model returns done or blocked. The
loop is bounded by continuation and token limits, survives restarts, and
pushes an outcome notification. Goals cannot start on scheduled-run or
child sessions.
ocm session tool: allow-listed internal routes to list, create, follow up
on, read replies from, and fork sessions. Created and forked sessions are
pinned to ask, listing covers a repo's workspaces, and replies wait for
the session to settle with a capped response.
Multi-run: launch one prompt on up to five models, optionally each in its
own OpenCode workspace, with per-entry status and discard.
Also add the shared owners this group needed (session launcher, session
reply, workspace create/remove, multi-run storage) and update the feature
docs.