Skip to content

feat: add OpenCode CLI provider#169

Merged
steipete merged 3 commits intosteipete:mainfrom
maciej:feat/opencode-cli-support
Apr 7, 2026
Merged

feat: add OpenCode CLI provider#169
steipete merged 3 commits intosteipete:mainfrom
maciej:feat/opencode-cli-support

Conversation

@maciej
Copy link
Copy Markdown
Contributor

@maciej maciej commented Mar 20, 2026

Summary

  • add OpenCode as a first-class CLI provider across config, auto-fallback, model parsing, daemon discovery, and help/docs
  • run opencode run --format json with stdin prompts, parse JSONL text/usage/cost output, and support cli/opencode plus configured default models
  • wire OpenCode into attachment handling, chat/model metadata, Chrome settings hints, and regression tests

Testing

  • npx pnpm -s test tests/llm.cli.test.ts tests/llm.cli.more-branches-2.test.ts tests/llm.provider-capabilities.test.ts tests/model-spec.test.ts tests/daemon.models.test.ts tests/asset.summary-attempts.test.ts tests/chrome.daemon-payload.test.ts tests/run.env.test.ts tests/run.models.test.ts tests/daemon.chat.test.ts
  • npx pnpm -s typecheck
  • npx pnpm -s format:check
  • npx pnpm -s summarize --cli opencode --plain --length short --timeout 4m <smoke-test-url>

@maciej
Copy link
Copy Markdown
Contributor Author

maciej commented Mar 20, 2026

Follow-up fix is pushed in de7a7d37.

What changed:

  • stabilized the sidepanel restore path by ignoring non-content active tabs like about:blank when resolving panel state
  • added targeted OpenCode coverage around model selection, auto fallback, CLI cwd handling, provider capability parsing, and CLI availability

Local verification:

  • pnpm -C apps/chrome-extension test:chrome --grep "sidepanel starts pending slides after returning to a tab with seeded placeholders" --repeat-each 10
  • pnpm exec vitest run --coverage --exclude tests/options.skills-controller.test.ts -> branch coverage 75.01%
  • OpenCode smoke checks passed for both stdin and a real URL via --model cli/opencode

maciej and others added 3 commits April 7, 2026 12:04
Route summaries through the OpenCode runtime so fetched pages can use the same local CLI workflow as the other supported coding assistants.
@steipete steipete force-pushed the feat/opencode-cli-support branch from de7a7d3 to 04320c7 Compare April 7, 2026 11:08
@steipete
Copy link
Copy Markdown
Owner

steipete commented Apr 7, 2026

Reviewed + landed.

Fixes on top before merge:

  • restored OpenClaw branches/defaults during the stale-provider rebase so OpenCode landing does not regress existing CLI flows
  • added missing OpenCode JSONL parser wiring in src/llm/cli-provider-output.ts
  • fixed OpenCode arg ordering in src/llm/cli.ts so subcommand args stay under run
  • updated changelog + README/auth notes

Verification:

  • pnpm -s vitest run tests/llm.cli.test.ts tests/llm.cli.more-branches-2.test.ts tests/llm.provider-capabilities.test.ts tests/run.env.test.ts tests/run.models.test.ts tests/chrome.daemon-payload.test.ts tests/chrome.settings.test.ts tests/daemon.chat.test.ts tests/daemon.models.test.ts tests/model-spec.test.ts tests/model-auto.test.ts
  • pnpm -s docs:list
  • pnpm -s check

Branch pushed with follow-up commit: 04320c7b.
Rebased commits now: 675b2c0e, 2848bf9d, 04320c7b.

Thanks @maciej.

@steipete steipete merged commit ab2de40 into steipete:main Apr 7, 2026
4 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.

2 participants