Skip to content

fix: reuse authenticated OpenCode client transport#175

Merged
tickernelz merged 1 commit into
tickernelz:mainfrom
catan271:fix/use-authenticated-plugin-client
Jul 21, 2026
Merged

fix: reuse authenticated OpenCode client transport#175
tickernelz merged 1 commit into
tickernelz:mainfrom
catan271:fix/use-authenticated-plugin-client

Conversation

@catan271

Copy link
Copy Markdown
Contributor

Summary

  • Reuse the OpenCode host SDK transport, including custom fetch and headers, when creating the v2 client.
  • Prefer the authenticated SDK session methods for structured output when available.
  • Retain the raw HTTP fallback for older SDK builds.
  • Add regression coverage for host headers and response content types.

Validation

  • bun test tests/opencode-provider.test.ts tests/plugin-host-config.test.ts
  • bun run typecheck
  • bunx prettier --check src/index.ts src/services/ai/opencode-host-config.ts src/services/ai/opencode-provider.ts src/services/ai/opencode-sdk-client.ts tests/opencode-provider.test.ts tests/plugin-host-config.test.ts

Closes #174

@tickernelz
tickernelz merged commit 0ce423d into tickernelz:main Jul 21, 2026
1 check passed
@tickernelz

Copy link
Copy Markdown
Owner

Merged into main and included in the v2.20.0 release tag. Verified on the fully integrated batch tree with bun install --frozen-lockfile, bun run typecheck, bun run build, and bun test (226 pass / 0 fail). Thanks for the contribution!

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.

[Bug] opencodeProvider fails with password-protected OpenCode server

2 participants