Skip to content

feat: Support external OpenCode servers#1179

Open
thisisryanswift wants to merge 1 commit into
getpaseo:mainfrom
thisisryanswift:ryan/opencode-external-server
Open

feat: Support external OpenCode servers#1179
thisisryanswift wants to merge 1 commit into
getpaseo:mainfrom
thisisryanswift:ryan/opencode-external-server

Conversation

@thisisryanswift
Copy link
Copy Markdown
Contributor

Linked issue

Closes #1178

Type of change

  • Bug fix
  • New feature (with prior issue + design alignment)
  • Refactor / code improvement
  • Docs

What does this PR do

Adds explicit support for attaching Paseo's OpenCode provider to an already-running opencode serve instance.

A new agents.providers.opencode.serverUrl config field can point Paseo at an external OpenCode HTTP server:

{
  "agents": {
    "providers": {
      "opencode": {
        "serverUrl": "http://127.0.0.1:4096"
      }
    }
  }
}

When serverUrl is configured, Paseo uses that URL for OpenCode SDK requests and does not initialize its managed OpenCodeServerManager, so it will not spawn, rotate, or shut down opencode serve.

The existing managed-server behavior remains unchanged when serverUrl is not set.

This also:

  • restricts serverUrl to http / https
  • probes /global/health for external-server availability
  • carries serverUrl through provider overrides/runtime settings
  • documents the config and external workspace-path assumption

How did you verify it

Ran focused tests:

npx vitest run packages/server/src/server/agent/providers/opencode-server-manager.test.ts --bail=1
npx vitest run packages/server/src/server/agent/providers/provider-availability.test.ts --bail=1
npx vitest run packages/server/src/server/agent/provider-launch-config.test.ts --bail=1
npx vitest run packages/server/src/server/agent/providers/opencode-agent.test.ts --bail=1

Ran lint:

npm run lint

Ran server typecheck:

npm run typecheck --workspace=@getpaseo/server

Also smoke-tested local Paseo 0.1.81 dev startup using a direct daemon/app setup:

  • daemon on 127.0.0.1:6777
  • app on localhost:4421
  • app connected over ws://localhost:6777/ws after enabling dev CORS

Full workspace npm run typecheck is currently blocked by unrelated app/CLI type errors in this checkout, including @testing-library/react test export errors in packages/app and stale CLI/server declaration errors. The touched server code passes targeted tests, lint, and server typecheck.

Checklist

  • One focused change. Unrelated cleanups split out.
  • npm run typecheck passes
  • npm run lint passes
  • npm run format ran (Biome)
  • UI changes include screenshots or video for every affected platform
  • Tests added or updated where it made sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: allow OpenCode provider to attach to an existing server

1 participant