opencode-go fetcher: skip models whose declared type is not chat

Abierto
#2,679 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
api

Línea de trabajo

The filter is meant to live in src/api/providers/fetchers/opencode-go.ts, and the spec skips models whose type is not chat (maintainer review) is in src/api/providers/fetchers/tests/opencode-go.spec.ts. The issue says this is already implemented on PR #2646, so first check that PR's diff and the maintainer's review item before writing anything. Done means the filter and its spec are tracked as their own scoped piece of work, and the TLA+ OnlyChatListed invariant in docs/architecture/tla/OpencodeGoModelMerge.tla still holds.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Current behavior

The OpenCode Go /models fetcher (src/api/providers/fetchers/opencode-go.ts) now skips any model whose endpoint-declared type is neither chat nor absent. Entries without a type field stay listed, so older responses that lack the discriminator are unaffected:

// Only chat models belong in the picker; an embedding or other
// type would surface as an unusable choice. Entries without a
// type stay listed for older responses (maintainer review).
if (parsed.data.type !== undefined && parsed.data.type !== "chat") {
	continue
}

Why

The current /models endpoint publishes a type discriminator alongside limit.context, limit.output and modalities.input. An embedding or other non-chat model would otherwise surface in the chat model picker as an unusable choice.

This behavior was explicitly requested by maintainer @edelauna in their review of PR #2646 (review 6033833085, item: "Skip models whose type is not chat").

Scope

The type filter is implemented and tested on PR #2646: covered by the skips models whose type is not chat (maintainer review) spec in src/api/providers/fetchers/__tests__/opencode-go.spec.ts, and by the OnlyChatListed invariant with its OpencodeGoModelMerge.NoTypeFilter.cfg sabotage config in docs/architecture/tla/OpencodeGoModelMerge.tla. This issue tracks the filter as its own scoped piece of work so PR #2646 can list it as in-scope.

Lenguaje dominante
TypeScript
Estrellas
2k
Forks
301
Merge medio
3 d 14 h
PR fusionados (30 d)
103

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Zoo-Code-Org/Zoo-Code

Todos los issues de Zoo-Code-Org/Zoo-Code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.