Skip to content

feat(opencode): add optional runtime overlay#3761

Open
Danigm-dev wants to merge 26 commits intosimstudioai:stagingfrom
Danigm-dev:feat/opencode-optional-runtime
Open

feat(opencode): add optional runtime overlay#3761
Danigm-dev wants to merge 26 commits intosimstudioai:stagingfrom
Danigm-dev:feat/opencode-optional-runtime

Conversation

@Danigm-dev
Copy link
Contributor

@Danigm-dev Danigm-dev commented Mar 25, 2026

Summary

Adds OpenCode as an optional Sim capability without changing the default Sim deployment path or base UX.

This PR introduces:

  • the OpenCode workflow block, tools, API routes, and lib/opencode client/service wiring
  • async dropdown/combobox support needed by the OpenCode block selectors
  • an optional OpenCode runtime with local/prod Docker Compose overlays
  • minimal docs and env examples for opt-in setup
  • a configurable OPENCODE_REPOSITORY_ROOT contract so Sim can also target compatible external OpenCode deployments

The default Sim experience remains unchanged:

  • docker-compose.local.yml is unchanged
  • docker-compose.prod.yml is unchanged
  • the OpenCode block stays hidden unless NEXT_PUBLIC_OPENCODE_ENABLED=true

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • timeout 90s bunx vitest run blocks/blocks.test.ts from apps/sim
  • bunx vitest run lib/opencode/service.test.ts app/api/opencode/repos/route.test.ts app/api/tools/opencode/prompt/route.test.ts from apps/sim
  • docker compose -f docker-compose.local.yml -f docker-compose.opencode.local.yml config
  • env OPENCODE_SERVER_PASSWORD=change-me docker compose -f docker-compose.prod.yml -f docker-compose.opencode.yml config
  • Manual validation:
    • Sim only: base UX unchanged and OpenCode hidden by default
    • Sim + OpenCode local overlay: OpenCode service starts, healthcheck passes, repo catalog loads, and prompts execute from the OpenCode block

Reviewer focus:

  • Confirm the default Sim path is unchanged when OpenCode is not enabled
  • Review the OpenCode runtime contract and OPENCODE_REPOSITORY_ROOT handling for external deployments
  • Review shared dropdown/combobox async-loading changes for regressions

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not included. The OpenCode block is hidden by default and only appears when NEXT_PUBLIC_OPENCODE_ENABLED=true. Manual validation covered both states and a successful prompt execution flow.

Loading
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.

1 participant