Turn protocol v1 parts into the old stream format, for widgets before 0.6
Los mantenedores suelen responder en 1 día
@Saifjafri212213 ya está trabajando en esto.
Desde el 20/10/2026.
- #259 de @Saifjafri212213 — fusionado
Evaluación
Este issue todavía no se ha evaluado.
Descripción
The 0.6 server streams typed parts (WirePart, in packages/core/src/protocol/v1.ts), but widgets on 0.5 and older read chunks like {"content":"Hi"} and {"done":true}. Those widgets will stay on sites and CDNs for months, so the server needs to translate. This issue is that translation, as one pure function.
What to do
Create packages/core/src/protocol/legacy.ts:
export interface LegacyChunk {
content?: string;
done?: boolean;
error?: string;
retryAfter?: number; // seconds
leadCaptured?: boolean;
leadData?: Record<string, unknown>;
suggestedActions?: string[];
}
/** The chunk an old widget expects for this part, or null for parts it has no use for. */
export function toLegacyChunk(part: WirePart): LegacyChunk | null;
| v1 part | Legacy chunk |
|---|---|
text-delta |
{ content: delta } |
lead-captured |
{ leadCaptured: true, leadData: lead } |
suggestions |
{ suggestedActions: items } |
error with rate_limited |
{ error: 'rate_limit', retryAfter }, with retryAfter = retryAfterMs rounded up to seconds, left out when there's none |
error with timeout |
{ error: 'timeout' } |
error with internal_error |
{ error: 'internal_error' } |
error with invalid_request |
{ error: 'Invalid request' } (what 0.5 servers send) |
error with any other code |
{ error: 'provider_error' } |
finish with reason error or aborted |
null (the error part already went out, or nobody is listening) |
finish with any other reason |
{ done: true } |
everything else (start, text-start, text-end, source, tool-call, tool-result, handoff, agent-message) |
null |
Those error strings are the ones the 0.5 widget understands (packages/widget/src/widget.ts, resolveErrorType, line 643).
Where to look
packages/core/src/protocol/v1.ts(the part types)packages/server/src/handler.ts, which writes the old chunks today (lines 51, 61, 71, 181, 209, 223, 250)
Acceptance criteria
- New
packages/core/src/protocol/legacy.ts, exported frompackages/core/src/protocol/index.tsand from@chatcops/core - One test per row of the table, plus
retryAfterMs: 1500becomingretryAfter: 2 - A test that runs a whole v1 stream through it and gets the exact chunks a 0.5 server sends for the same reply
- Changeset for
@chatcops/core(minor) -
pnpm test:coverageandpnpm lintpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- Lenguaje dominante
- TypeScript
- Estrellas
- 13
- Forks
- 7
- Merge medio
- 3 h 41 min
- PR fusionados (30 d)
- 155
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codercops/chatcops
-
Document the pre-chat formPosiblemente ocupada @masyarakatai la tomó hace 5 días. Abiertodocumentation good first issue hacktoberfest widget
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
codercops/chatcops#70 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
docs: update the providers page for openai-compatible, registerProvider and provider importsPosiblemente ocupada @prakashNalla la tomó hoy. Abiertodocumentation good first issue hacktoberfest website
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
codercops/chatcops#291 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
docs: add a protocol reference page for custom clientsPosiblemente ocupada @kachamsiddarth la tomó hoy. Abiertodocumentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)Posiblemente ocupada @bhushan4work la tomó hoy. Abiertoenhancement hacktoberfest help wanted server
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
codercops/chatcops#249 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Create @chatcops/store-sqlite, a store for single-server setupsPosiblemente ocupada @srikar-naidu la tomó hoy. Abiertoenhancement hacktoberfest help wanted server
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
codercops/chatcops#247 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de codercops/chatcops
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaitin/MonkeyCode#1437 ·
Los mantenedores suelen responder en 1 día
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
carbon-design-system/carbon-ai-chat#2615 ·
Los mantenedores suelen responder en 1 día
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePosiblemente ocupada @r2jaff la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ComposioHQ/composio#5054 ·
Los mantenedores suelen responder en 1 día