Skip to content

fix: restore compatibility with OpenCode ≥1.15 and update models#97

Merged
tickernelz merged 4 commits into
tickernelz:masterfrom
ursuscamp:master
May 27, 2026
Merged

fix: restore compatibility with OpenCode ≥1.15 and update models#97
tickernelz merged 4 commits into
tickernelz:masterfrom
ursuscamp:master

Conversation

@ursuscamp

Copy link
Copy Markdown
Contributor
  • Provider ID mismatch — plugin registered as kiro-auth but config uses kiro; OpenCode silently skipped the auth loader entirely
  • undefined/chat/completions URL error — OpenCode ≥1.15 reads model.api.url before options.baseURL; field was empty for custom providers, fixed by setting provider.api in the config hook
  • Auth loader never called — OpenCode skips the loader if no auth.json entry exists; added auto-bootstrap to write a placeholder on first run
  • Streaming returning no output — stream transformers were emitting Anthropic-protocol events with empty choices arrays; @ai-sdk/openai-compatible treated the stream as empty, fixed by filtering unmappable events
  • Model list out of date — added glm-5 and claude-opus-4-7, corrected Sonnet 4.6 and Opus 4.6 context limits from 200K to 1M

Bump to version 1.11.0 and fix #76

@ursuscamp

ursuscamp commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

This was added primarily to fix #76 and update the included models to match latest from the kiro docs: https://kiro.dev/docs/models/

Tested on OpenCode v1.15.5, plugin version 1.10.1.

I bumped the version without really thinking about it. My apologies if that was out of pocket.

@tickernelz tickernelz merged commit 5b46256 into tickernelz:master May 27, 2026
1 check passed
@tickernelz

Copy link
Copy Markdown
Owner

Merge notes

Merged this PR after applying maintainer adjustments on top of the original branch.

Adjustments included:

  • Aligned the package default export provider id from kiro-auth to kiro, matching the plugin/provider config used by OpenCode.
  • Moved auth bootstrap into src/plugin/auth-bootstrap.ts and hardened it:
    • malformed auth.json is now a no-write path, so other provider credentials are not clobbered
    • existing restrictive auth.json permissions are preserved on rewrite
    • newly created auth files use a restrictive mode
  • Bumped @opencode-ai/plugin to ^1.15.11 and refreshed lockfiles.
  • Fixed Zod enum compatibility by using RegionSchema.options instead of RegionSchema.Values.
  • Updated README guidance for automatic auth bootstrap and corrected 1M context examples for Sonnet/Opus 4.6.
  • Added regression tests for auth bootstrap, provider id, Zod enum compatibility, and OpenAI-compatible stream chunks that should not emit empty choices.

Local verification before merge:

  • bun run typecheck passed
  • bun test passed: 15 tests, 0 failures, 53 assertions
  • bun run build passed
  • prettier --check passed
  • git diff --check passed
  • npm pack --dry-run passed

Remote PR check before merge:

  • GitGuardian Security Checks passed

RvVeen pushed a commit to Servoy/opencode-kiro-auth that referenced this pull request Jun 1, 2026
…ckernelz#97)

Merge PR tickernelz#97 with maintainer adjustments:\n\n- Align default plugin provider id with the new kiro provider id.\n- Harden OpenCode auth bootstrap so malformed auth.json files are not overwritten and restrictive file permissions are preserved.\n- Add regression tests for auth bootstrap, provider id, Zod enum compatibility, and empty OpenAI-compatible stream chunks.\n- Bump @opencode-ai/plugin to 1.15.11 and align docs/model context examples.
RvVeen added a commit to Servoy/opencode-kiro-auth that referenced this pull request Jun 1, 2026
…a cherry-pick)

PR tickernelz#97's changes are already in this branch (cherry-picked into 5703be6 with
conflict resolution). This -s ours merge records upstream/master as an ancestor
so the fork is purely ahead of upstream — making the PR diff clean and
auto-mergeable — without changing our tree.
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.

In Opencode v1.3.13 Web Mode: "undefined/chat/completions"

3 participants