Skip to content

docs: document opencode web-search opt-in for review reasoners#22

Merged
AbirAbbas merged 1 commit into
mainfrom
docs/web-search-via-opencode-exa
May 6, 2026
Merged

docs: document opencode web-search opt-in for review reasoners#22
AbirAbbas merged 1 commit into
mainfrom
docs/web-search-via-opencode-exa

Conversation

@AbirAbbas
Copy link
Copy Markdown
Contributor

Summary

Documents the two-env-var knob that enables opencode's built-in websearch / webfetch tools for PR-AF's review reasoners:

OPENCODE_ENABLE_EXA=1
EXA_API_KEY=...

When both vars are set on the deployment, the model gains the ability to verify external API contracts, check CVE/deprecation status, and confirm library version behavior during a review — and decides per-task whether the lookup is worth doing.

Why no code changes

opencode reads these env vars natively. They reach the opencode subprocess through agentfield's run_cli parent-env propagation (regression-guarded in Agent-Field/agentfield#544). The model is told about the available tools via the standard tool-definition layer — verified end-to-end against the agentfield SDK, where the model autonomously invoked websearch for a task that needed current information.

So the wiring already works; this PR just makes the knob discoverable.

What's changed

  • .env.example — adds the two env vars with a brief explanation
  • README.md — adds an "Optional: web search" subsection under Quick Start

Why no prompt-level guardrails

Review reasoners are short / single-shot / analytic — no long iterative loops where an unrestrained model could rabbit-hole on searches. The model's own judgment plus opencode's tool advertisement is sufficient. (SWE-AF's run_coder is the exception and gets a restraint snippet in its own PR.)

🤖 Generated with Claude Code

Adds the two-env-var knob (OPENCODE_ENABLE_EXA=1 + EXA_API_KEY) to
.env.example and a brief subsection in the Quick Start of README.

When both vars are set, opencode's built-in websearch / webfetch tools
become available to every review reasoner running through the open
runtime — model decides per-task whether the lookup is worth doing
(verify API contracts, check CVE/deprecation status, confirm library
version behavior). No PR-AF wiring is required beyond setting the vars
on the deployment; opencode inherits parent env from agentfield's
run_cli, and tool awareness is communicated to the model via the
standard tool-definition layer (verified: model invokes websearch
autonomously when the task warrants it).

No prompt-level guardrails added. Review reasoners are short / single-
shot / analytic — no loop-risk where unrestrained search could
rabbit-hole. SWE-AF's run_coder is the exception (long iterative
coding loops); that gets a restraint snippet in its own PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AbirAbbas AbirAbbas merged commit abe6790 into main May 6, 2026
2 checks passed
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