Skip to content

[Agent|Release] Keep opencode off until a model passes the agent test - #2163

Merged
CREDO23 merged 1 commit into
devfrom
feat/opencode-enabled-switch
Oct 3, 2026
Merged

CREDO23 merged 1 commit into
devfrom
feat/opencode-enabled-switch

Conversation

@CREDO23

@CREDO23 CREDO23 commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • One switch, SURFSENSE_LOCAL_OPENCODE_ENABLED, off by default in scripts/opencode/enabled.mjs. Flipping that default turns opencode on for every build.
  • When off, stage.mjs stages nothing and removes an earlier stage, so release CI, pnpm dist and pnpm dev carry no opencode. Installers lose about 180 MB, and the release tag no longer has to get opencode through signing and notarization for the first time.
  • Electron starts opencode only where it is staged, so the API gets no address and mounts none of the routes opencode calls or that answer it: the model endpoint, the tool endpoint and the permission answer.
  • To work on the agent, set SURFSENSE_LOCAL_OPENCODE_ENABLED=1 before pnpm dev.

Follows #2135

High-level PR Summary

This PR introduces a feature flag system to disable opencode (the agent's engine) by default until a model passes the agent test. The flag SURFSENSE_LOCAL_OPENCODE_ENABLED controls whether opencode is staged in builds, and when disabled, the staging script removes any existing opencode files, API routes related to opencode are not mounted, and installers shrink by approximately 180 MB.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_local/electron/scripts/opencode/enabled.mjs
2 surfsense_local/electron/scripts/opencode/enabled.test.mjs
3 surfsense_local/electron/scripts/opencode/stage.mjs
4 surfsense_local/backend/shared/config.py
5 surfsense_local/backend/api/main.py
6 surfsense_local/backend/tests/integration/agent/conftest.py
7 surfsense_local/backend/tests/integration/agent/test_routes_without_opencode.py
8 docs/architecture/agent.md
9 docs/architecture/overview.md
10 docs/architecture/packaging.md
11 docs/ROADMAP.md
12 surfsense_local/electron/electron-builder.yml
13 .github/workflows/release-local.yml

Need help? Join our Discord

Summary by CodeRabbit

  • Changes
    • OpenCode is now excluded from builds by default. It is staged only when explicitly enabled, and related API routes are unavailable when it is not configured.
    • Documentation now describes OpenCode’s conditional inclusion and notes that no signed installer has included it.

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
surf-sense-frontend Error Error Oct 3, 2026 5:41am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: MODSetter/SurfSense/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4da6cb18-eb73-4241-9110-3e9aee85c94e
📥 Commits

Reviewing files that changed from the base of the PR and between 7199973 and df22622.

📒 Files selected for processing (13)
  • .github/workflows/release-local.yml
  • docs/ROADMAP.md
  • docs/architecture/agent.md
  • docs/architecture/overview.md
  • docs/architecture/packaging.md
  • surfsense_local/backend/api/main.py
  • surfsense_local/backend/shared/config.py
  • surfsense_local/backend/tests/integration/agent/conftest.py
  • surfsense_local/backend/tests/integration/agent/test_routes_without_opencode.py
  • surfsense_local/electron/electron-builder.yml
  • surfsense_local/electron/scripts/opencode/enabled.mjs
  • surfsense_local/electron/scripts/opencode/enabled.test.mjs
  • surfsense_local/electron/scripts/opencode/stage.mjs
 __________________________________________________________________
< Fine-tuning the Enterprise's warp drive to avoid BSOD at warp 9. >
 ------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CREDO23
CREDO23 merged commit a22c81e into dev Oct 3, 2026
21 of 24 checks passed

This branch had an error being deployed

1 failed deployment
Preview — df226229 Deployed Oct 3, 2026 by vercel[bot]
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