Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

generateStream: no empty-response guard, no fallback, and a raw provider error yielded as content

Abierto
#237 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
ai, backend

Línea de trabajo

Comienza en packages/outpost/ai/src/generator.ts:196-208 y compara generateStream con el comportamiento de generate corregido por #223. Sigue cómo pipeline.generateStreamingResponse consume los valores producidos y usa la receta de aimock de #223 para cubrir un stream vacío y la ruta de catch. Se considera terminado cuando las respuestas vacías reciben el comportamiento de fallback previsto y los errores del proveedor no se emiten como contenido ordinario.

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

Descripción

area: ai roadmap roadmap: next

Split out of #231, which carries this as a bullet rather than a tracked item. #223's review said "tracking with #228" — that reference is wrong: #228 is the QA chat SSE cross-chunk buffer bug in apps/web/src/hooks/use-qa-chat.ts, a different subject. So this has had no issue of its own.

generate() was fixed by #223 (merged as 825d0981): it now reads every text block and throws 'Model response contained no usable text' on none, caught by the never-crash fallback. generateStream has the same two defects, both unfixed.

1. No empty-response guard, and no fallback at all

packages/outpost/ai/src/generator.ts:196-206 yields only content_block_delta/text_delta events. A completion with no text yields nothing — the consumer sees a successful empty stream. There is no degraded signal on this path and no apology fallback, so it is strictly worse than the pre-#223 non-streaming behaviour, which at least returned an empty string a caller could test.

2. The catch yields a raw provider error as ordinary content

:207-208:

} catch (error) {
    yield `\n\n_Error generating response: ${error instanceof Error ? error.message : String(error)}_`;
}

That is provider error text placed into the response body. pipeline.generateStreamingResponse buffers what it yields, so a 500 becomes publishable content. Trap rather than live bug — no production caller reaches it today, which is also why it has stayed unnoticed. Overlaps #146 (the streaming path still reads the pre-#143 groundedness signal) and should probably be fixed in the same pass.

Why it hasn't bitten yet

generateStream's only caller is pipeline.generateStreamingResponse, which nothing in the queue invokes. The moment streaming is wired to a real channel, both defects are live.

Test gaps

No coverage for an empty stream and none for the catch path. Both are straightforward with the aimock recipe #223 used — the empty case needs a mocked stream that yields no text delta.

Lenguaje dominante
TypeScript
Estrellas
10
Forks
4
Merge medio
4 d 2 h
PR fusionados (30 d)
7

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

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 CopilotKit/outpost

Todos los issues de CopilotKit/outpost

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.