Skip to content

feat: zod validation, explicit load results, V2 wire modelID fix - #140

Merged
BrainerVirus merged 4 commits into
mainfrom
feat/opencode-v2-dual
Sep 26, 2026
Merged

BrainerVirus merged 4 commits into
mainfrom
feat/opencode-v2-dual

Conversation

@BrainerVirus

Copy link
Copy Markdown
Owner

Summary

Lands the follow-up work on top of the dual V1+V2 plugin (#138):

  • ad5f1e3 feat: zod validation, explicit load results, V2 wire modelID fix — src/schemas.ts is the single source of truth (catalog.ts/manifest.ts types derive via z.infer), explicit LoadResult boundaries plus a hermetic EnvDeps seam, per-entry validation of bundled models.json with degraded reasons carrying the real cause, and the V2 modelID fix (UI/map key stays toConfigKey short; the wire id is the full catalog id).
  • b482ef0 fix: use @ai-sdk/openai-compatible as V1 provider npm default — V1 provider.commandcode defaults now point at the real AI SDK package plus the Provider API baseURL; a custom npm or baseURL is left untouched. Mirrored in sync:global and the README transport section.
  • a87bd6c chore(deps): refresh and hard-pin dependencies — ai 7.0.114, oxlint/oxfmt/typescript pins, lockfile refreshed (path-gated: no release).
  • d572eb2 docs: rewrite README flow and prune docs to specs — how-it-works flow, plugin config table, plans removed, specs updated, new catalog-freshness spec, AGENTS.md docs/validation rules.

Verification

  • bun run check green on the tip: 214 pass / 0 fail, oxlint + oxfmt --check + tsc --noEmit.
  • bun install --frozen-lockfile --dry-run clean on the tip and on the zod-only intermediate commit.
  • Branch diff touches behavior paths and README.md / docs/specs/ in the same branch (AGENTS.md docs rule).

Release

Latest tag is v0.8.0; the feat commit touches product paths, so semantic-release is expected to cut a minor bump → 0.9.0 after auto-merge. No publish commands run here.

- Add src/schemas.ts (ModelEntry/Manifest/availability/plugin config) as the single source of truth; catalog/manifest types derive via z.infer.
- Add explicit LoadResult boundaries (src/load-result.ts) and a hermetic EnvDeps seam (src/env.ts); degraded reasons carry the real cause.
- Parse bundled models.json entry-by-entry, dropping invalid entries with reasons instead of failing the whole catalog.
- V2 modelID is the full catalog wire id; the UI/map key stays the toConfigKey short name.
V1 resolves provider npm through BunProc.install and calls the first create* export, so the plugin package itself can never be the SDK npm field. Default provider.commandcode to @ai-sdk/openai-compatible and add the Provider API baseURL unless a custom npm/baseURL is already configured. Aligns the sync:global helper and README transport section with the same defaults.
Refresh devDependencies (ai 7.0.114, oxlint 1.85.0, oxfmt 0.70.0, typescript 6.0.3) and remove the last caret ranges so the lockfile is fully exact. chore commits are path-gated out of releases.
README now leads with how the pipeline works (extract/filter, cost merge, artifacts, V1+V2 injection, fallbacks) and the shipped plugin config file. Plans and task notes are removed; docs/specs describe what ships, including the new catalog-freshness spec. AGENTS.md gains the docs rule and the validation/runtime-weight boundaries.
@BrainerVirus
BrainerVirus merged commit f974211 into main Sep 26, 2026
5 checks passed
@BrainerVirus
BrainerVirus deleted the feat/opencode-v2-dual branch September 26, 2026 13:31
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant