Commit Graph

33 Commits

Author SHA1 Message Date
diegosouzapw
643ccc0a8d fix(providers): pin the bare master auto router outside the OpenCode v2 per-owner cap (#19016) 2026-11-10 12:27:29 -03:00
Dizzle
862d3921f6 feat(plugin): rework picker names to Provider - Model format (#18230)
⚠️ base-red inherited: #17219

## Summary

Behavior change: the serving provider is now always part of an entry's name, and the editor/upstream moves to a trailing parenthesis. Before, the name builder prefixed every entry with the model's editor/upstream, hiding the route and letting three incompatible `free` conventions and volatile `auto/*` names coexist. Now an entry reads `Provider - Model`, with a leading `🆓 ` when free, combos read `combo - slug`, a route suffix appears only on same-provider name collisions, and `providerTag` becomes the switch for the editor parenthesis: `true` by default, `false` drops it.

## Related Issues

- No linked issue — the symptom was reproduced on the release base

## Target Branch

Thanks @maxmad64bis.
2026-11-08 20:05:56 -03:00
Diego Rodrigues de Sa e Souza
b2195f790e fix(ci): retire vulnerable dependency chains on main (#18174)
The current main lockfile reports 26 root advisories, including three critical findings. This backport removes the vulnerable dependency chains from all five audited lockfiles while keeping the main source tree and plugin APIs as the compatibility baseline.

Upgrade Next.js and its ESLint configuration to 16.4.2, DOMPurify to 3.4.17, promptfoo to 0.125.1, and the affected transitive packages. Scope the Azure MSAL, FTP and OpenCode v1 Zod overrides to their owning chains. Upgrade the OpenCode v2 development SDK and the Electron development binary. The guard-evaluation configuration serializes JSON errors while requiring HTTP 400 and SECURITY_001, with positive and negative HTTP fixtures; remove the retired extract-zip risk record.

Validation on Node 24.22.1 / npm 11.15.0:

- Clean root npm ci and SQLite/esbuild native smoke: PASS.
- Five lockfile audits (root, Electron, OpenCode v1, OpenCode v2, provider): zero reported findings at measurement time. Used the five-scope audit runner from the separate recovery candidate; this PR does not backport that gate implementation.
- 13 dependency/Promptfoo compatibility cases: PASS, including controlled Azure token and FTP transports and rejected wrong status/error-code responses.
- OpenCode v1 clean install/build/tests: 388 PASS; v2: 398 PASS.
- Core typecheck, lockfile policy, focused ESLint, check:docs-all and commit hooks: PASS.

⚠️ base-red inherited: #17267. These scoped results are not release admission. Full main Node/Vitest/UI,
2026-11-07 11:56:46 -03:00
Dizzle
533521b3da fix(plugin): refresh the served catalog on the configured TTL instead of publishing once at install (#18235)
Merged as part of the v3.8.53 fix sweep (author @maxmad64bis).

Co-authored-by: Dizzle <112548150+maxmad64bis@users.noreply.github.com>
Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
2026-11-04 04:25:16 -03:00
Dizzle
ac449e439e feat(opencode-plugin-v2): publish one catalog branch with prefix wildcard and hide every combo (#18135) 2026-10-29 07:21:27 -03:00
Fabio Junior Gruchovski
0cb625183d fix(opencode): map custom-provider catalog identities to public prefixes (#17369) 2026-10-29 07:11:15 -03:00
Diego Rodrigues de Sa e Souza
c8a89f8eeb deps(security): bump fast-uri to 3.1.9 and zod/undici in both opencode plugins (#18171)
Bump fast-uri to 3.1.9 and zod/undici in both opencode plugin workspaces for upstream security fixes.

Evidence: focused tests pass (no test files in diff; check-deps OK); combined board of 6 PRs on origin/release/v3.8.53: 117/117 focused tests, ESLint, typecheck:core, check:open-sse-typecheck and check-deps clean; file-size OK; changelog integrity OK against origin/release/v3.8.53.

⚠️ base-red inherited: #17219
2026-10-26 12:44:59 -03:00
Diego Rodrigues de Sa e Souza
55ac97e6b7 chore: repoint workspace package metadata, READMEs, OpenAPI examples and AGENTS.md at cheaper-inference/OmniRoute (round 2) (#18086) 2026-10-26 12:07:18 -03:00
Dizzle
34076b4dc6 feat(plugin): opt-in inferred free signals for freeOnly (#16800) 2026-10-25 17:54:35 -03:00
Dizzle
db53964c10 fix(plugin): stop requesting the retired combos route in the v2 plugin (#16167)
Merged via /merge-batch (2026-10-18, uplift round). Thanks @maxmad64bis for the idea and the original implementation!

Maintainer rework on top of the contributor's commits (owner-approved uplift; default runtime behavior unchanged unless noted, every behavior change behind its own default-off feature flag):
- feat(plugin): opt-in combosSource=models for the v2 plugin
- fix(plugin): restore the /api/combos source as the v2 plugin default

Evidence: validated on a combined board of the 34 reworked PRs over release/v3.8.52 (typecheck core/open-sse/API, complexity + cognitive-complexity within baseline, boundary 774/774, dead-code, i18n new-key coverage, changelog-integrity, docs-sync, docs-counts, 894 focused node tests + 41 UI + 104 autoCombo green), then re-validated on the current tip: and boundary/changelog/complexity/file-size/skills gates green. Remaining CI reds are the inherited base-red #15306.
2026-10-18 11:37:37 -03:00
Praveen K Palaniswamy
9bfce3da90 fix(opencode-plugin): stop bare-id enrichment fallback attributing models to unrelated providers (#15465)
Merged via /merge-batch (2026-10-17, round 4). Validated as submitted on a combined board of 33 PRs over the current release/v3.8.52 tip: typecheck:core, open-sse and API-route typechecks, eslint on changed files, file-size, complexity, cognitive-complexity, dead-code, boundary 774/774, changelog-integrity, env-doc-sync, docs-sync, agent-skills-sync (Generated 0), provider-consistency and i18n new-key coverage all green; focused tests 401/406 node:test + 11/11 vitest (the only reds were the #16988 fixture, fixed separately). Remaining CI reds are the inherited base-red #15306. Thanks @yourspraveen for the contribution!
2026-10-17 23:57:45 -03:00
Dizzle
7effca08a2 fix(plugin): publish preset-passing entries and member-passing combos (#16779)
⚠️ base-red inherited: #15306

The preset now filters the pool before the default view ranks it, and a combo publishes only when every resolved member passes. Installations without a preset keep the same catalog.

Rebased onto the tip after #16775. The raw-pool predicate uses the same `isFreeOnlyFreeType` set as the mapped preset, so single-use and retired entries stay out of free-only. Catalog, README, and the preset tests merged cleanly with #16785.

Local proof after that resolution: file-size gate passed. Focused plugin tests: 56 pass, 0 fail (catalog, preset pool, refresh summary, free-budget labels).

Thank you @maxmad64bis.
2026-10-16 00:47:44 -03:00
Dizzle
3c171a98a1 fix(plugin): route warnings to host log with refresh summary (#16785)
⚠️ base-red inherited: #15306

Squash of the submitted head. Plugin warnings also reach the host log, each successful refresh writes one summary line, and a partial free-only overlay warns with its match count.

Local proof on the combined plugin board: file-size and changelog gates passed. Focused plugin tests: 91 pass, 0 fail, including the refresh summary and the host-sink cases.

Thank you @maxmad64bis.
2026-10-16 00:44:02 -03:00
Dizzle
48192af232 fix(plugin): freeOnly admits served free-tier models with uncapped label (#16775)
⚠️ base-red inherited: #15306

Squash of the submitted head. The free-only preset now admits only recurring and keyless free types, stamps every namespaced key a provider serves, and labels uncapped budgets as `(uncapped)`.

Local proof on the combined plugin board (tip plus this PR, #16779, and #16785): file-size and changelog gates passed. Focused plugin tests: 91 pass, 0 fail, including the free-tier fan-out, the preset matrix, and the uncapped label.

Thank you @maxmad64bis.
2026-10-16 00:43:21 -03:00
Dizzle
c4798e5b4d test(plugin-v2): lock relay of catalog filter defaults and name star sentinel (#16163)
Thanks @maxmad64bis. Wave 27 boarded this pull request cleanly on release/v3.8.52 at f8d11c9326. The focused unit tests for the files it touches passed on that combined tree (116 passed in the second run, plus the auto-combo weight tests and the skills characterization tests). Changelog integrity passed. The only file-size finding is executeTargetAttempt.ts, already over its frozen ceiling on the release tip and unchanged by this diff.
⚠️ base-red inherited: #15306
2026-10-11 00:39:27 -03:00
Eliot B
136b67a58a fix(opencode-plugin-v2): use advertised combo name as model id (#15755)
Validated in a combined board with the other PRs of this wave on release/v3.8.52: the PR's own tests pass; typecheck:core, open-sse typecheck, api-typecheck, complexity, changelog-integrity, env-doc-sync, test-discovery, vitest-exclusions, error-helper, test-masking, lockfile, deps, gate-manifest, cli-i18n and i18n coverage green. Any file-size ceiling or stryker registration this wave needs lands in the wave's follow-up PR. Thank you for the contribution!
2026-10-08 03:03:36 -03:00
Diego Rodrigues de Sa e Souza
5be5bc71d8 fix(opencode-plugin-v2): publish the full catalog by default (toolsOnly off) (#15811) 2026-10-07 23:05:34 -03:00
Diego Rodrigues de Sa e Souza
1d2c1d491f fix(deps): bump transitive deps to patched releases (Dependabot batch) (#15662)
* fix(deps): bump transitive sharp, smol-toml, katex, simple-git, proxy-addr, shell-quote and others to patched releases

Lockfile/override-only; closes the open Dependabot alerts that have a patched release (root, electron, opencode-plugin-v2).

* fix(deps): http-cache-semantics 4.3.0 in the root lockfile

* chore(deps): allowlist the transitive overrides added for the Dependabot batch

* fix(docker): overlay a patched postcss-selector-parser in npm's bundled tree

Trivy reported npm's own postcss-selector-parser 7.1.4 (fixed in 7.1.6) under
/usr/local/lib/node_modules/npm; 7.1.6 stays inside @npmcli/query's ^7.0.0 range.

* test(plugin): give the retired-field snapshot fixture the tool-calling capability

#14554 made toolsOnly the default and updated the fixtures it knew about; the
retired-field case from #15392 landed in parallel and still used a bare
{ id } model, so the default preset filtered it out. The release tip hid this
because the plugin's npm ci was failing there.
2026-10-07 14:48:35 -03:00
Diego Rodrigues de Sa e Souza
f376a12b8a fix(opencode-plugin-v2): restore the redis optional-peer entries dropped from the lockfile (#15727)
The Dependabot bump in #15648 regenerated the package lock and removed the
redis / @redis/* entries that the dependency tree still resolves, so npm ci
failed with 'Missing: redis@6.3.0 from lock file' and the Test v2 jobs went
red. Regenerated with npm install --package-lock-only: 97 additions, no
removals, package.json untouched; npm ci --dry-run is clean on npm 10, 11.15.0
and 12.
2026-10-07 14:46:41 -03:00
Dizzle
27777133f8 feat(plugin): filter published catalog by capability presets (#14554)
Onda 8. Este squash entra com o crédito de @maxmad64bis (feat(plugin): filter published catalog by capability presets).

O catálogo que a release já publicou ficou, e o filtro por capability preset entra por cima. O #15484 continua de fora. O teto de file-size fica para o follow-up da onda.

⚠️ base-red inherited: #15306

Obrigado, @maxmad64bis.
2026-10-06 20:48:23 -03:00
dependabot[bot]
9dcfa58f55 chore(deps-dev): bump http-cache-semantics (#15648)
Onda 7. Bumps do Dependabot que não encostam no lock da raiz: workflows (Trunk uploader 2.1.5, CodeQL 4.38.2) e locks de folha (plugin v2 e electron 44.5.1, depois o http-cache-semantics do electron).

O board em `.claude/worktrees/batch-w7` sobre `f715c86f` mergeou os sete sem conflito e sem `package-lock.json` da raiz. #15577 entra antes de #15649.

⚠️ base-red inherited: #15306 (timeouts de suíte no tip, não neste diff).

Obrigado, @dependabot.
2026-10-06 18:50:59 -03:00
Dizzle
2eee95e107 feat(plugin): publish useful catalog entries by default, full list on request (#15484)
Brought the tip into the branch and revalidated: focused tests, typecheck:core, open-sse typecheck, file-size, changelog-integrity, complexity and mutation-test-coverage green. Thank you for the contribution.
2026-10-06 16:59:48 -03:00
Dizzle
d1bf460ba7 fix(plugin): stop requesting the retired virtual-entries route (#15392)
Brought the tip into the branch (the stacked parent commit had landed as a squash) and revalidated: focused tests, typecheck:core, open-sse typecheck, file-size, changelog-integrity, complexity and mutation-test-coverage green. Thank you for the contribution.
2026-10-06 12:55:35 -03:00
Dizzle
fb07b051dd feat(plugin): filter published catalog by provider with empty-result guard (#15239)
Validated in a combined board on the current release tip: focused node:test + vitest suites, typecheck:core, open-sse typecheck, gate-manifest, mutation-test-coverage, file-size, changelog-integrity, complexity, env-doc-sync, test-discovery, vitest-exclusions, error-helper, cli-i18n and the i18n new-keys/ui-coverage gates green. Thank you for the contribution.
2026-10-06 12:21:18 -03:00
Dizzle
652c4f3636 feat(plugins): register host sdk telemetry hook behind opt-in flag (#14235)
Merged. Thank you, @maxmad64bis.

The design is what made this easy to carry: gated on a new `telemetry` option that is `z.boolean().default(false)`, inert on a host that has no `aisdk` domain, marking matching inference calls in their options only (filtered by provider and SDK package), no fetch wrapping, no client assignment, and any registration failure degraded to a warning. Five tests, one per property.

One thing happened on our side and you should know exactly what: #14370 landed first and rewrote `src/index.ts` against the stable `@opencode/plugin` 2.0.12 contract, which collapses the per-event `aisdk` domains into a single named entry point `ctx.aisdk.hook(name, cb)`. Your registration block was written against the beta callable `ctx.aisdk.sdk(cb)`, so it was re-applied onto the new shape rather than merged as-is — mirroring how #14370 wired the sibling Gemini `"language"` hook. The `"sdk"` event on the stable contract carries exactly the three fields your callback already read (`model` / `package` / `options`), so nothing was lost: **the callback body is unchanged**.

In the test file, every `it(...)` body and every assertion is byte-identical to yours. Only the host fake moved, and only because it had to: `ctx.catalog` → `ctx.provider` + `ctx.model` (the tip's `assertContext` now requires those transforms and no longer knows `catalog`), and the two callable domains → one `hook(name, cb)` router — the same fake the tip's own `gemini-language.test.ts` uses. The header comment was updated where it cited the old contract version.

Validation before merge: `telemetry-sdk-hook.test.ts` 5 pass / 0 fail; the full `@omniroute/opencode-plugin-v2` suite 244 pass / 0 fail across 65 suites (= #14370's 239 plus your 5); `npm run build` and `tsc --noEmit` over src + tests under `strict: true` both exit 0; `typecheck:core`, `check:file-size` and `check:changelog-integrity` green. The net change to `index.ts` is purely additive — the few removed lines are prettier reflow of #14370's own lines.
2026-09-22 11:25:09 -03:00
Dizzle
30f7088c74 fix(opencode-plugin-v2): port catalog publishing to stable provider contract (#14370)
Merged. Thank you, @maxmad64bis.

The reasoning holds: the stable 2.0 host no longer provides the beta `@opencode-ai/plugin` contract the plugin was written against, so the plugin simply failed to load there — moving catalog publishing to `Plugin.define` with `ctx.provider.transform` against the stable `@opencode/plugin` peer range is the fix rather than a preference. The diff is large, but it is contained entirely inside the `@omniroute/opencode-plugin-v2` workspace package and carries its own suite.

Validation before merge: boarded onto the current release tip together with four sibling PRs of yours — merged clean, no conflict against the tip or the siblings. `check:file-size`, `check:changelog-integrity` and `typecheck:core` green on the combined tree, and the boarded unit suites 36 pass / 0 fail.

Note for the follow-up: #14235 (the sdk telemetry hook) conflicts with this one on `src/index.ts` and will be re-applied on top of the new shape rather than merged as-is — nothing for you to do, I'll handle the reconciliation.
2026-09-22 10:40:29 -03:00
Dizzle
5395618aac fix(opencode-plugin-v2): write catalog snapshot atomically via temp file and rename (#13607)
The plugin v2 on-disk catalog snapshot is written to a temp file and renamed into place, snapshots from a newer format version are refused instead of parsed, and size-cap or I/O give-ups now warn instead of failing silently. Nine cases, four of which fail on the old code.

Validated first on the combined board of all 38 PRs of this batch (10 merged as-is, 28 after the maintainer rework) on top of release/v3.8.51 c0f92ec: typecheck:core, check:open-sse-typecheck and check:dashboard-typecheck clean; ESLint clean on every changed file; file-size (rebaselined for the combined growth), complexity, cognitive-complexity, changelog-integrity, docs-counts, docs-sync, migration-numbering and i18n new-key gates green; 735 focused node:test cases with the only batch-caused failure (a flag-count assertion) fixed. Then re-validated alone on the fresh release tip right before this merge: ESLint on the changed files, typecheck:core, check:open-sse-typecheck, the file-size/complexity/changelog gates and this PR's own tests.

Thanks @maxmad64bis!
2026-09-15 11:15:24 -03:00
Dizzle
ca9254ea65 fix(opencode): read management token from environment with startup fallback warning (#13613)
The opencode plugin v2 reads its management token from `OMNIROUTE_MANAGEMENT_API_KEY` (the plugin option still wins) and warns once at startup when it has to fall back to the inference key. Eight cases through the real plugin setup, env isolated, asserting the Bearer header on `/api/*`.

Validated first on the combined board of all 38 PRs of this batch (10 merged as-is, 28 after the maintainer rework) on top of release/v3.8.51 c0f92ec: typecheck:core, check:open-sse-typecheck and check:dashboard-typecheck clean; ESLint clean on every changed file; file-size (rebaselined for the combined growth), complexity, cognitive-complexity, changelog-integrity, docs-counts, docs-sync, migration-numbering and i18n new-key gates green; 735 focused node:test cases with the only batch-caused failure (a flag-count assertion) fixed. Then re-validated alone on the fresh release tip right before this merge: ESLint on the changed files, typecheck:core, check:open-sse-typecheck, the file-size/complexity/changelog gates and this PR's own tests.

Thanks @maxmad64bis!
2026-09-15 11:12:03 -03:00
Diego Rodrigues de Sa e Souza
fb8f7d7fa2 chore(deps): patch toml and esbuild in the opencode plugin lockfiles (#12965)
Merged as part of the owner batch of 2026-09-11.

This PR had a live worktree in another session, so it sat outside the main 39. Merged on your explicit call, validated first rather than taken on trust: boarded with the other 10 worktree-held PRs into a consolidated worktree off `release/v3.8.51`.

- ESLint over every changed file: no errors
- `typecheck:core` clean; `check:dashboard-typecheck` OK; `check:changelog-integrity` OK
- complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437
- 203 of 208 assertions green. The 5 remaining (`guide-settings-route` ×4, `hard-session-lease-bypass-inventory` ×1) reproduce on the pure tip with nothing from this batch applied.
- `imageGeneration.ts` rebaselined 3259 → 3293 for #12945's image-only-model guard, landed separately in #13392 so nothing was pushed onto a live branch.

⚠️ base-red inherited: #12732 — provider count 356 vs 358 and `open-sse/utils/stream.ts` 3115 > frozen 3098, both reproducing on the pure tip.
2026-09-11 22:28:58 -03:00
Diego Rodrigues de Sa e Souza
95ebed770b test(plugin): wait for the v2 lazy-refresh tier instead of sleeping past it (#12984)
Merged as part of the owner batch of 2026-09-11.

This PR had a live worktree in another session, so it sat outside the main 39. Merged on your explicit call, validated first rather than taken on trust: boarded with the other 10 worktree-held PRs into a consolidated worktree off `release/v3.8.51`.

- ESLint over every changed file: no errors
- `typecheck:core` clean; `check:dashboard-typecheck` OK; `check:changelog-integrity` OK
- complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437
- 203 of 208 assertions green. The 5 remaining (`guide-settings-route` ×4, `hard-session-lease-bypass-inventory` ×1) reproduce on the pure tip with nothing from this batch applied.
- `imageGeneration.ts` rebaselined 3259 → 3293 for #12945's image-only-model guard, landed separately in #13392 so nothing was pushed onto a live branch.

⚠️ base-red inherited: #12732 — provider count 356 vs 358 and `open-sse/utils/stream.ts` 3115 > frozen 3098, both reproducing on the pure tip.
2026-09-11 22:28:54 -03:00
Dizzle
3156643f6c fix(opencode): require an http(s) baseURL in both OpenCode plugins (#13142)
Real and nasty precisely because it is silent: `z.string().url()` accepts `localhost:20128` as scheme `localhost:` plus a path, every model gets published with an unusable api url, and the failure happens inside the client so the gateway logs show nothing. Backing the option schema, the publish boundary and the snapshot filter with one `isHttpUrl` in v2 is the right call — those three cannot drift apart. Duplicating the predicate in v1 rather than sharing it is also correct, since the two packages ship independently.

---

Validated in one consolidated worktree cut from `release/v3.8.51`, boarded together with the rest of this batch — zero conflicts between them.

- `typecheck:core` clean; `check:changelog-integrity` OK
- complexity 2799 / baseline 3218 and cognitive-complexity 1265 / baseline 1437 — both under baseline
- 86 focused assertions green across the batch's 10 unit test files, plus 16/16 on the v1 plugin option schema and 16/16 on the v2 option tests
- `check-file-size` rebaselined for this batch's real growth (annotation `_rebaseline_2026_09_11_mergebatch_v3851_maxmad_opencode`, landed on #13141). `open-sse/utils/stream.ts` was deliberately left frozen: it is already 3115 > 3098 on the pure tip with zero contribution from this batch.

⚠️ base-red inherited: #12732 — `Docs Gates`, `Merge integrity`, `No new ESLint warnings`, `Unit Tests fast-path` and `Fast Quality Gates` all reproduce on the pure `release/v3.8.51` tip (provider count 356 vs the 358 the modules define, SKILL.md drift, and the `stream.ts` freeze above). None of them touch these diffs.

Thanks @maxmad64bis.
2026-09-11 13:51:17 -03:00
Diego Rodrigues de Sa e Souza
fd27ff08c7 chore(deps): drain the Dependabot queue — 10 of 13 alerts (#13213)
* chore(deps): drain the Dependabot queue — 7 of 10 alerts

Lockfile-only bumps; no manifest touched, so nothing changes for consumers.

Root package-lock.json:
  hono      4.13.0 -> 4.13.7  (#215 #216 #217, medium, patched 4.13.5)
  csv-parse 7.0.1  -> 7.0.2   (#213, medium)
  joi       18.2.3 -> 18.2.8  (#211 #212, low, patched 18.2.4/18.2.5)

@omniroute/opencode-plugin:
  toml      4.1.1  -> 4.3.0   (#209, HIGH, patched 4.1.2)

@omniroute/opencode-plugin-v2:
  esbuild   0.28.1 -> 0.28.2  (#210, low) — the direct copy only; see below.

The plugin-v2 diff looks large but is one package: esbuild ships 27 platform
binaries, each carrying version + resolved + integrity.

Three alerts stay open, deliberately:

  #218 extract-zip (HIGH) and #214 adm-zip (medium) have NO published patch.
  Both are dev-scope. Closing them needs an upstream release or a decision to
  replace the dependency — neither belongs in a lockfile bump.

  #210 esbuild is only half-closed. `node_modules/esbuild` is on 0.28.2, but
  `tsup` pins `esbuild: ^0.27.0`, so its nested copy stays at 0.27.7 — inside the
  vulnerable range (>= 0.27.3, < 0.28.1). Updating tsup does not move it (8.5.1
  is already current). Forcing it would take an `overrides` entry pushing a major
  of esbuild inside the bundler, which is exactly the change that breaks a build
  silently, for a LOW dev-only alert. Left for an upstream tsup release.

check:lockfile passes on all three, including the workspace lock/manifest
consistency check. check:tracked-artifacts OK.

* chore(deps): bump js-yaml to 4.3.2 (root + electron)

Two more HIGH alerts arrived after the first sweep:

  #220 js-yaml (root package-lock.json)     >= 4.0.0, < 4.3.2
  #219 js-yaml (electron/package-lock.json) >= 4.0.0, < 4.3.2

The root's own js-yaml was already on 5.4.1; the vulnerable copies were the ones
nested under @yarnpkg/parsers, lockfile-lint, xmlbuilder2 (root) and the direct
dependency in electron. All now 4.3.2. Four version lines, nothing else.

#221 smol-toml (HIGH, <= 1.7.0) is NOT closed here. The root is on 1.8.0; the
vulnerable 1.6.1 sits under @openai/codex-security, which pins it as an EXACT
version rather than a range, so `npm update` cannot move it. Bumping
codex-security itself (0.1.24 -> 0.1.26) does not help — 0.1.26 pins the same
1.6.1 — so that bump was reverted rather than carried along for no benefit.

Closing #221 needs an upstream codex-security release or an `overrides` entry,
the same trade already declined for #210/tsup: forcing a transitive pin from
outside is how a build breaks silently. Note that @openai/codex-security is also
the package carrying the unpatched extract-zip (#218), so one upstream release
would likely clear both.

* chore(deps): override smol-toml to 1.8.0 and raise the js-yaml floor

Closes #221 (smol-toml, HIGH, DoS via malformed TOML, vulnerable <= 1.7.0).

@openai/codex-security pins smol-toml at 1.6.1 as an EXACT version, so no
`npm update` reaches it. This repo already uses `overrides` as its standard tool
for exactly that situation — the block carries 20+ entries, including the
scoped-by-parent form and the `qs`/`fast-uri`/`ip-address` entries that back
earlier security bumps — so a scoped override is the idiomatic fix here, not a
new mechanism:

    "@openai/codex-security": { "smol-toml": "^1.8.0" }

The nested copy deduplicates to the root's existing 1.8.0, which two other
consumers (the root itself and knip) already run, so the version is proven in
this tree. The whole lockfile diff is the 14 lines of the removed 1.6.1 entry.

Also raised the `@yarnpkg/parsers` js-yaml floor from ^4.3.1 to ^4.3.2, so the
override documents the patched version rather than permitting the vulnerable one
it was written against.

Not fixed, and not fixable by version — verified against the npm registry rather
than trusting the advisory metadata:

  #218 extract-zip — latest published IS 2.0.1, the vulnerable version. Dev
       scope, via @openai/codex-security. No release to move to.
  #214 adm-zip — latest published IS 0.6.0, the top of the vulnerable range
       (>= 0.5.9, <= 0.6.0). RUNTIME scope, via onnxruntime-node's ^0.5.16, and
       the repo already overrides adm-zip to ^0.6.0. No release to move to.

Both need an upstream fix or a decision to replace the dependency; neither is a
lockfile change. adm-zip being runtime rather than dev makes it the one worth
tracking.

#210 esbuild stays open too. A flat `overrides: { esbuild: ^0.28.2 }` in
opencode-plugin-v2 does close it — npm then reports 0 vulnerabilities — but it
requires regenerating that lockfile from scratch: 823 lines, 96 packages moved,
for a LOW dev-only alert, and a major esbuild bump inside tsup cannot be
validated here without a real install of that package. Tried, measured,
reverted. Left for an upstream tsup release.

check:lockfile OK on all lockfiles including the workspace consistency check;
check:tracked-artifacts OK; prettier clean.
2026-09-10 13:37:55 -03:00
Dizzle
b345c7f6cd feat(opencode): opencode v2 plugin publishing the OmniRoute catalog (#12870)
opencode v2 loads plugins through a contract the existing
@omniroute/opencode-plugin cannot satisfy: v1 exports plugin factories with an
auth/provider/config/tool hook object, v2 expects a default define({id, setup})
carrying catalog and integration domains. One package would have to satisfy
both loaders from a single entrypoint. An opencode v2 install therefore has no
route to an OmniRoute gateway at all: no model discovery, no combos, no
enrichment.

This adds @omniroute/opencode-plugin-v2, a self-contained package. The v1
plugin is untouched, so v1 users see no move, no migration and no breaking
version. The two packages deliberately share no code and no release: the
mapping logic here began as a port of v1's and now lives in this package, which
keeps either one free to change without a coordinated publish.

The plugin publishes models, combos and auto-combos into the host catalog,
refreshes them lazily behind a 300s TTL, and keeps serving the last known
catalog from an on-disk snapshot when the gateway is unreachable. Publishing is
staged: models and combos are what a catalog is, so they go out as soon as they
are known, while auto-combos, the provider list and the enrichment overlay fold
into the snapshot when they land. Gating the publish on all of them made the
catalog hostage to the slowest source — a gateway that accepts the connection
and never answers /api/combos/auto left everything unpublished until that fetch
timed out, which is longer than a short-lived host stays alive.

Display names carry what the gateway knows about a model: the upstream provider
it routes to, whether it is free, and the budget that comes with it. Those parts
were already fetched and then dropped, so two connections selling the same model
looked identical in the picker. The provider prefix can be turned off with
`providerTag: false`.

The on-disk snapshot carries that overlay too, under a size cap, so a cold start
opens on named models rather than raw ids. The host is asked to reload only when
the catalog or the overlay actually moved, never once per refresh window.

The gateway key comes from the host credential store when one is connected, so
connecting the integration from opencode is enough and no secret needs to sit
in opencode.json; a plugin option and an environment variable remain as
fallbacks, and a host too old to expose a credential store still loads. Nothing
is silent when a key is missing or refused: an absent key is named once at
startup with the three ways to supply one, and an enrichment source the gateway
rejects is reported per endpoint with what the catalog loses. Those three
failures used to be empty catch blocks, which turned a management token the
gateway refuses into a catalog of raw model ids with no explanation.

Tool calling to Gemini keeps working. Gemini answers 400 INVALID_ARGUMENT for
an entire request whose tool declarations carry $schema, $ref or
additionalProperties. The v1 plugin handled it by wrapping fetch and rewriting
the JSON body; v2 does it on the language model, where the tools are still
structured data, and only for Gemini models of this provider. It can be turned
off with geminiSanitization: false, and a host exposing no aisdk domain loads
without it.

The catalog contract itself is a moving target, so the plugin adapts to the
host instead of assuming one shape. The released CLI keeps the aisdk package,
the endpoint (as settings.baseURL), the request headers and the variant options
directly on the model and provider; the current SDK types keep the same
information inside an api block. Writing only the api block yields a catalog
the released CLI lists but cannot route. Rather than key off a version list
that goes stale on the next release, the plugin reads the shape the host seeds
into the catalog draft and publishes accordingly: a seed with a top-level
package and no api block gets both field sets, a seed with an api block gets
that block alone, and an undisclosed seed gets both. None of the legacy keys
collide with a key of the current types, so the two shapes coexist on one
object, variants included.

Four v1 behaviours are deliberately not carried over, because v2 either owns
them or no longer needs them: the plugin-side debug log (the host has its own
logging), the compression-metadata suffix on combo names, the MCP auto-emit
(the v2 host owns MCP), and the omni-sync command plus its background timer
(the TTL and a content fingerprint drive catalog.reload instead).

A refresh never downgrades what is already published: the previous overlay is
carried forward until the new one lands, so names, pricing and the usable
filter no longer drop out for the length of every TTL window. The disk snapshot
is read after the credential is resolved, because it is keyed by that
credential — reading it earlier looked up the identity the options carry rather
than the one in use, and rejected a perfectly good catalog exactly when the
gateway was down.

The tool-schema cleaner now knows where a schema ends and a property name
begins. Stripping keywords by name anywhere in the tree deleted a tool
parameter called `ref` while leaving it in `required`, handing the model a
schema it could not satisfy; a `$ref` it cannot resolve now forwards the tool
untouched instead of widening it to accept anything. Gemini detection is
anchored on the model family, so `gemini-compatible-proxy` is no longer treated
as a Gemini model.

A source the gateway refuses is reported on the library entry point as well,
not only through the plugin, so the usable-provider filter can no longer disable
itself in silence. `providerId` is bounded to a safe character set because it
reaches a filesystem path, `hiddenModels` covers combos as it already covered
models, the Anthropic block gets the gateway root rather than a doubled `/v1`, an unparseable tool schema forwards the tool instead
of failing the request, and the package typechecks under the same settings as
the v1 plugin.

CI mirrors the existing plugin workflow: install, build and test on Node 22 and
24, for both packages. The plugin SDK stays pinned, and the host-shape assertions carry the risk of
a contract move rather than a check against a rolling upstream tag.

Co-authored-by: Max <maxmad64@gmail.com>
2026-09-06 18:36:27 -03:00