Commit Graph
25 Commits
Author SHA1 Message Date
Chris Scott 1278915e78 Merge remote-tracking branch 'origin/main' into refactor/ocm-native-opencode 2026-11-28 20:38:46 -05:00
Chris Scott 12dab07b87 Guard pairing token renewal against concurrent edits and cap pairing names 2026-11-28 20:36:48 -05:00
Chris Scott 3c7bc80988 refactor(ocm): pair linked servers with native OpenCode links and drop legacy CLI stubs 2026-11-28 20:18:05 -05:00
Chris Scott 68f67327fc chore(opencode): move the OpenCode pin and supported floor to 2.4.2 2026-11-28 20:14:02 -05:00
Chris Scott edd083e417 Refresh Goal reads on plugin.updated, with recovery coverage 2026-11-17 14:44:25 -05:00
Chris Scott 23d9d1c945 Move the OpenCode pin and supported floor to 2.3.0 2026-11-17 14:02:14 -05:00
Chris Scott 71bde0378a Remove duplicated and constant-only tests 2026-11-13 15:30:56 -05:00
Chris Scott b625acfc0c chore(lint): replace ESLint with Oxlint and clear anti-slop findings 2026-11-13 01:13:34 -05:00
Chris Scott bf7c6cdbac fix(opencode): address review feedback on the 2.2.5 pin
Document ocm 0.6.x as requiring OpenCode 2.2.5, matching its
@opencode/theme peer, and make the package compatibility test check
bounded peer ranges instead of treating them as one version.

Linked servers on another 2.x release keep the neutral version notice,
while a different major version is shown as unsupported again through
a shared version badge.

The Docker build now fails when the bundled OpenCode is below the
supported minimum, and the entrypoint falls back to the bundled version
as the floor when OPENCODE_MIN_VERSION is unset instead of discarding
every persisted binary.
2026-11-06 09:43:35 -05:00
Chris Scott 807c7cb896 chore(opencode): move the OpenCode pin to 2.2.5 from a workspace catalog
Manager builds against and requires OpenCode 2.2.5. Every @opencode
package, plus effect and the OpenTUI/solid dependencies they share,
resolves from one pnpm workspace catalog instead of separate pins.

The built-against version and the supported floor are now separate
settings, so a future OpenCode release can move the pin before raising
the floor. Docker and the dev setup script read the floor from its own
argument.

ocm-cli moves to 0.6.0 on the same 2.2.5 and OpenTUI 0.8 baseline. A
linked server on a different version is still connectable and now shows
a neutral version notice instead of an unsupported badge.
2026-11-06 09:26:56 -05:00
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 5db74e3fa7 fix(goals): validate the goal RPC output before returning it 2026-10-30 01:03:14 -04:00
Chris Scott cbe92c92ad refactor(goals): replace the Manager session-goal API with OpenCode built-in /goal 2026-10-29 12:38:39 -04:00
Chris Scott 6e398c4d40 fix(device-pairing): clean up push subscriptions on admin reset and share URL helpers
The admin password reset finds the admin case-insensitively and deletes the push subscriptions of the sessions it ends. The app re-sends its push subscription once per signed-in session so revoke reaches re-signed-in devices, and the upsert keeps the stored device name. Plain-HTTP and URL parsing checks are shared helpers.
2026-10-24 19:26:21 -04:00
Chris Scott b9d8d18124 fix(device-pairing): refuse to mint pairing codes from an address that cannot pair
A loopback origin in production or plain HTTP on a public address still
minted a code and showed a browser QR no other device could use.

- one availability rule decides untrusted, loopback and public plain-HTTP
  origins; POST /api/device-pairing/links checks it before minting
- GET /api/device-pairing/availability reports the rule for the page origin
  without minting
- Connect a device disables "Show QR code" and explains the fix when the
  address cannot pair
- private-network plain HTTP keeps the browser QR; the app QR still needs
  the toggle
2026-10-24 19:26:21 -04:00
Chris Scott f8e4cfe136 feat(device-pairing): pair phones and browsers with a QR code
Settings -> Account gets "Connect a device", a paired-devices list, and a
remote access headers editor, so the mobile app and other browsers can sign
in without typing a password and pass a reverse proxy such as Cloudflare
Access.

- one-time pairing codes (3 min TTL) minted by a Better Auth plugin and
  redeemed into a new session that records the device name
- POST /api/device-pairing/links builds the ocm://link app link with the
  stored headers as h= parameters and a browser /pair link; plain-HTTP and
  loopback origins are blocked or warned about
- remote access headers are stored encrypted, returned by name only, and
  validated (8 headers, 512-char values, 1800 encoded characters, reserved
  transport names blocked); a Cloudflare Access service token preset fills
  CF-Access-Client-Id and CF-Access-Client-Secret
- login offers "Sign in with QR code" and /pair redeems a scanned code,
  returning to the login redirect target
- revoking a device deletes its session, closes its live connections and
  removes its push subscriptions; the current session cannot be revoked
2026-10-24 19:26:21 -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 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 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 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 c60a9b35f2 fix(terminal-dev-loop): address branch review findings
Security:
- Reject same-site and cross-site state-changing requests on cookie-authenticated routes unless the origin is trusted
- Drop Manager and ocm_preview Set-Cookie headers from preview responses
- Show and hash the full executable content of .ocm/project.json at trust time
- Restrict action URLs to http(s) and refuse symlinked repo config paths
- Keep the preview start redirect on the gateway origin

Lifecycle:
- Stop terminals in OpenCode workspace siblings when a repo is deleted
- Report preview as unavailable instead of crashing when the gateway port cannot be bound

Performance:
- Skip branch lookups when validating terminal and project-config directories
- Stop the /proc scan once all listening sockets are mapped and pause port polling while a preview is open
- Close slow WebSocket clients with 1013 so they reconnect with replay
- Lazy-load the xterm terminal view and skip unchanged resize requests
- Request uncompressed responses from preview targets

Cleanup:
- Share one repo directory resolver, trusted-origins parser, cookie prefix, WebSocket frame forwarder, header filter, icon map and dialog-param helper
- Remove unused props, options and exports

Docs: update terminal, preview, project actions, sandboxing, internal API and environment pages
2026-10-03 10:00:33 -04:00
Chris Scott beab2646e7 section 2: Phase 2: Terminal service, REST routes and cleanup 2026-10-03 01:05:02 -04:00
Chris Scott dcb50b7e0f fix: reconcile documentation guarantees and enforcement (OM-15) 2026-10-02 13:00:09 +00: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