Commit Graph
12 Commits
Author SHA1 Message Date
Chris Scott 6578e11eeb section 8: Phase 8: Managed effective config read through api.config.ge 2026-11-02 10:36:56 -05:00
Chris Scott 48ca38c4e3 section 6: Phase 6: Config.Info validation owner and v2 config types in 2026-11-02 10:23:14 -05: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 e8548b1e07 section 1: Phase 1: Expose session goals and multi-runs on the internal 2026-10-07 18:33:03 -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 b13707b5b3 Merge forge/terminal-dev-loop into beta
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.
2026-10-03 23:50:10 -04:00
Chris Scott 96e02e9646 feat(sessions): add permission modes, session goals, ocm session tool and multi-run
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.
2026-10-03 21:16:05 -04:00
Chris Scott 24e2037b73 fix(opencode-config): reject redacted placeholder in raw-text config writes 2026-09-29 16:46:10 -04:00
Chris Scott a1b7f58aae feat(opencode-config): redact secrets and add MCP listing to the internal config API (#366) 2026-09-28 23:52:41 -04:00
Chris Scott dacde879d6 feat(opencode): migrate OpenCode Manager to OpenCode 2 (#359)
* feat(opencode): migrate OpenCode Manager to OpenCode 2

Port the backend lifecycle, generated plugins, event aggregation,
schedules, worktrees, provider credentials, MCP, config handling, the
frontend chat model, and the ocm CLI to OpenCode 2.

Adopt @opencode/client 2.0.15 as the single typed V2 API contract,
require OpenCode 2.0.0 or newer (pinned 2.0.15), and delete every
V1-only code path.

* refactor(opencode): reload config in place and drop v1 compatibility shims

Route config/skill/AGENTS.md changes through the OpenCode location reload
API instead of a full server restart, stop auto-resuming interrupted
sessions, remove the restart coordinator and v1 MCP/version shims, and pin
support to OpenCode >=2.0.15 <3.0.0. Adds integration-ready retries,
service-mode launch, ocm-cli repo proxy, and new frontend form/MCP helpers.

* refactor(opencode): consolidate v2 migration helpers and harden install, proxy, and session flows

- extract shared semver and model-ref utilities, reuse across version checks
- share the OpenCode release download script across Docker, entrypoint, dev setup
- unify install/upgrade failure recovery and guard externally managed OPENCODE_BIN
- scope the repo proxy location rewrite and surface ocm proxy errors
- rework frontend session projection, permission lookup, and cache invalidation

* fix(schedules): reject unavailable agents before creating a session

* feat(opencode): add ocm install, schedule agent fallback, and session move guards
2026-09-26 13:16:45 -04:00
Chris Scott b5dd900efb feat(config): support layered OpenCode config sources with revision-guarded saves (#358)
* feat(config): support layered OpenCode config sources with revision-guarded saves

* refactor(config): harden multi-source OpenCode config handling

- extract shared config-source helpers and default source name
- reject shadowed removals with 409 and require sources/revision
- restart the server on reload with session resume
- mirror multiple host config files on import and warn on removals
- skip restart for mcp-only saves
- drop removedFields and CONFIG_PATCH_TIMEOUT_MS

* fix(config): return null when archiving broken OpenCode config fails
2026-09-20 15:51:40 -04:00
Chris Scott 295d24ced7 refactor(config): make on-disk opencode.json the single source of truth (#354)
* refactor(config): make on-disk opencode.json the single source of truth

Make <workspace>/.config/opencode/opencode.json the only store for the active OpenCode configuration. One owner (opencode-config-file.ts) reads, validates, writes, archives, and seeds the file; one owner (opencode-config-apply.ts) decides how an edit is applied: restart pending, or a live patch with recovery. Settings routes, the internal assistant API, the health-watch supervisor, boot, and host import all go through them, so an edit that lands on the file without going through the database is visible immediately instead of at the next Manager boot.

Remove the named-config profiles. Migration 019 archives every opencode_configs row to .config/opencode-configs-archive/<name>.json, restores the default row to opencode.json when no file exists, then drops the table, its indexes, and repos.opencode_config_name. The /opencode-configs* and config/switch routes and the CreateConfigDialog/SwitchConfigDialog dialogs are gone, and the ocm tool gains GET/PUT /opencode-config backed by the same apply owner.

Harden the write path: serialize and atomically write config updates while preserving the file mode, keep withFileLock usable after a rejection, route reloadConfig's cleaned-config write through the file owner, stop boot from rewriting an existing valid config when importing state, prune the health-watch directory to its newest 20 entries, resolve archive paths with realpath, and share one frontend config query across dialogs.

* fix(mirror): canonicalize worktree paths before branch ownership check

* refactor(config): unify opencode config apply and rollback paths

- share one config route factory between public and internal mounts
- capture last-known-good before every config write and restore via one helper
- stop auto-restarting on save; flag restart-required fields and live-patch the rest
- add CONFIG_PATCH_TIMEOUT_MS for config patch requests
- extract canonicalPath helpers, health-watch artifact writer, and useProvidersWithModels hook

* refactor(model-state): use OpenCode state file as model state source of truth
2026-09-19 00:28:34 -04:00