openqa icon indicating copy to clipboard operation
openqa copied to clipboard

Add OpenCode provider support alongside Claude Code

Open gurvinder-dhillon opened this issue 7 months ago • 0 comments

Summary

OpenQA currently supports Claude Code as the only agent provider. We should add support for OpenCode as an additional provider so users can choose either Claude Code or OpenCode for browser-driven test execution.

Problem

src/agent/providers/ is currently Claude-focused. Users who prefer OpenCode (or already use its model/provider ecosystem) cannot run OpenQA with that agent backend.

Proposed outcome

Add first-class provider support for OpenCode while preserving existing Claude behavior.

Scope

  1. Add an OpenCode provider implementation under src/agent/providers/.
  2. Wire provider selection through runAgent() and openqa init flow so projects can choose OpenCode.
  3. Define OpenCode command construction and output parsing (tool calls, errors, result text, sessions/continuation behavior as applicable).
  4. Ensure parity with current OpenQA expectations:
    • at least one browser tool call per instruction
    • assertion error handling
    • session lifecycle management
  5. Update docs/examples to show OpenCode usage and required setup.

Implementation notes

  • Reuse the existing provider contract shape (buildPrintCommand, parseStreamLine, parseSessionUsage) and keep compatibility with orchestrator behavior.
  • Keep Claude provider as default unless explicitly changed.
  • Add clear error messaging for missing OpenCode auth/config.

Acceptance criteria

  • [ ] OpenQA can run an agent step using OpenCode provider in the same runtime path currently used for Claude.
  • [ ] openqa init supports selecting OpenCode.
  • [ ] At least one example/template demonstrates OpenCode configuration.
  • [ ] README/docs explain setup and env/config requirements for OpenCode.
  • [ ] Existing Claude-based flows remain unaffected.

References to read (OpenCode docs)

  • https://opencode.ai/docs/
  • https://opencode.ai/docs/config/
  • https://opencode.ai/docs/cli/
  • https://opencode.ai/docs/models/
  • https://opencode.ai/docs/mcp-servers/
  • https://opencode.ai/docs/custom-tools/
  • https://opencode.ai/docs/plugins/
  • https://opencode.ai/docs/plugins/#create-a-plugin
  • https://opencode.ai/docs/plugins/#events
  • https://opencode.ai/docs/plugins/#examples

gurvinder-dhillon avatar May 04 '26 01:05 gurvinder-dhillon