Skip to content

feat(providers): filter GitHub combo members against live catalog - #12473

Merged
diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.51from
RaviTharuma:fix/12137-github-live-catalog-filter
Sep 4, 2026
Merged

diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.51from
RaviTharuma:fix/12137-github-live-catalog-filter

Conversation

@RaviTharuma

Copy link
Copy Markdown
Contributor

Fixes #12137.

Extends checkModelAvailable() with a GitHub-specific live-catalog membership check using the same fail-open pattern as providerWildcard + getActiveSyncedCatalog (empty/unsynced catalog = unchanged). Explicit combo members missing from an authoritative GitHub catalog are skipped.

Also tightens isRoutableChatModel() so policy.state != enabled and model_picker_enabled=false are dropped, with unit coverage on those disabled paths.

Does not touch resolveComboTargets().

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are a few correctness/maintainability follow-ups needed (notably request-scoped caching for repeated live-catalog DB reads and some documentation/formatting fixes) before this is safe to merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR addresses #12137 by reducing wasted GitHub Models combo fallbacks: explicit GitHub-prefixed combo members are now filtered against the active synced (live) GitHub catalog using a fail-open approach when the catalog isn’t authoritative yet. It also tightens GitHub Copilot model discovery to drop models that are chat-capable but not actually routable (policy disabled or hidden from the picker), with unit coverage for those paths.

Changes:

  • Add catalogContainsModel() as a fail-open membership helper for authoritative live catalogs.
  • Filter GitHub/gh explicit combo members during combo availability prechecks using the active synced catalog (skip only when authoritative + missing).
  • Update GitHub Copilot model discovery routing rules to exclude policy.state != enabled and model_picker_enabled === false, with tests.
File summaries
File Description
src/sse/handlers/chat.ts Adds GitHub live-catalog membership filtering for explicit combo members inside the combo availability precheck.
src/lib/db/models/activeSyncedCatalog.ts Introduces catalogContainsModel() helper for authoritative catalog membership checks.
open-sse/services/githubCopilotModels.ts Tightens isRoutableChatModel() to exclude policy-disabled and picker-hidden models.
tests/unit/github-live-catalog-combo-12137.test.ts Adds unit tests covering fail-open + prefixed/bare membership behavior.
tests/unit/github-copilot-model-discovery.test.ts Extends discovery tests to assert disabled/hidden models are not advertised.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/sse/handlers/chat.ts Outdated
Comment thread open-sse/services/githubCopilotModels.ts Outdated
Comment thread tests/unit/github-live-catalog-combo-12137.test.ts
Memoize GitHub live catalog once per request in isModelAvailable,
document policy/model_picker filters on isRoutableChatModel, and
reformat long catalogContainsModel assertions.

Signed-off-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
@RaviTharuma
RaviTharuma force-pushed the fix/12137-github-live-catalog-filter branch from 5222f50 to 1119630 Compare September 3, 2026 23:26
diegosouzapw and others added 2 commits September 3, 2026 21:07
Move the #12137 GitHub combo live-catalog filter and the combo
prefix-override provider guard into a sibling helper so chat.ts stays
under the file-size and complexity ratchets.

Signed-off-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit 6aa3690 into diegosouzapw:release/v3.8.51 Sep 4, 2026
15 of 16 checks passed
@RaviTharuma
RaviTharuma deleted the fix/12137-github-live-catalog-filter branch September 23, 2026 19:36
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…egosouzapw#12473)

Validado em lote numa worktree combinada com os 10 PRs desta leva sobre o tip de `release/v3.8.51`: `typecheck:core` limpo, `check-file-size` OK e **241/242** nos 29 arquivos de teste que os PRs tocam.

A única "falha" não é falha: `tests/unit/autoCombo/strict-zero-cost-filter.test.ts` é um teste em estilo Vitest que eu incluí por engano na invocação do runner nativo do Node — ele quebra no import (`@vitest/runner`), não numa asserção. Ao investigar, descobri que esse arquivo não roda em nenhum dos dois runners hoje (o glob do `test:unit` não lista `autoCombo` e o `include` do Vitest só pega `.tsx` nessa pasta); é um problema pré-existente do repositório, sem relação com esta leva, e vou registrá-lo separadamente.

O diegosouzapw#12636 conflitava apenas na lista de testes do `@omniroute/opencode-plugin/package.json`, de forma aditiva: o tip já tinha `models-fetcher.test.ts` (do diegosouzapw#12607, irmão desta mesma leva) e o diegosouzapw#12636 acrescenta `telemetry.test.ts`. Fiz a união dos dois lados (25 arquivos contra 24 de cada) em vez de escolher um, o que teria removido um arquivo da suíte do plugin em silêncio.

Obrigado, @RaviTharuma.
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.

feat(providers): filter explicit combo members against the GitHub Models live catalog (follow-up to #8134)

3 participants