Skip to content

feat: restore experimental flag for websearch/codesearch tools#5132

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
ben-vargas:feat-revert-experimental-websearch-tool
Dec 6, 2025
Merged

feat: restore experimental flag for websearch/codesearch tools#5132
rekram1-node merged 2 commits into
anomalyco:devfrom
ben-vargas:feat-revert-experimental-websearch-tool

Conversation

@ben-vargas

Copy link
Copy Markdown
Contributor

Re-enables the OPENCODE_EXPERIMENTAL_EXA flag to allow non-zen users to opt-in to websearch and codesearch tools.

Context

Commit d95f724 enabled these tools for everyone, then 9c237f0 restricted them to zen users only while figuring out enterprise opt-out.

This PR provides an interim solution: zen users get the tools by default, while other users can opt-in via OPENCODE_EXPERIMENTAL_EXA=true (or the general OPENCODE_EXPERIMENTAL=true flag).

Changes

  • Restore OPENCODE_EXPERIMENTAL_EXA flag in flag.ts
  • Update registry.ts filter to allow tools when providerID === "opencode" || Flag.OPENCODE_EXPERIMENTAL_EXA

This matches the original experimental implementation pattern while preserving the zen-first behavior.

Enable exa-powered websearch and codesearch tools for:
- Zen users (providerID === "opencode") - always enabled
- All other users - opt-in via OPENCODE_EXPERIMENTAL_EXA=true

This allows non-zen users to access these tools again through the
experimental flag, while maintaining the default behavior for zen
subscribers.
@rekram1-node

Copy link
Copy Markdown
Collaborator

/oc rename the env var to be OPENCODE_ENABLE_EXA, BUT make the truthyness of it also respect the value of OPENCODE_EXPERIMENTAL_EXA for backwards compat.

@rekram1-node

Copy link
Copy Markdown
Collaborator

good pr thanks!

@opencode-agent

opencode-agent Bot commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

Done! I've renamed the env var to OPENCODE_ENABLE_EXA with backwards compatibility:

Changes made:

  1. flag.ts: Created OPENCODE_ENABLE_EXA flag that respects:

    • OPENCODE_ENABLE_EXA=true (new primary flag)
    • OPENCODE_EXPERIMENTAL=true (general experimental flag)
    • OPENCODE_EXPERIMENTAL_EXA=true (legacy flag for backwards compat)
  2. registry.ts: Updated the websearch/codesearch filter to use Flag.OPENCODE_ENABLE_EXA instead of Flag.OPENCODE_EXPERIMENTAL_EXA

The truthiness check evaluates left-to-right: if any of the three env vars are set to true or 1, the flag will be enabled.

New%20session%20-%202025-12-06T20%3A27%3A03.791Z
opencode session  |  github run

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
@rekram1-node
rekram1-node merged commit 419983c into anomalyco:dev Dec 6, 2025
3 of 4 checks passed
@ben-vargas
ben-vargas deleted the feat-revert-experimental-websearch-tool branch December 7, 2025 19:50
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request Jun 14, 2026
…lyco#5132)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
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.

2 participants