Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix(server): thread snapshot returns empty HTTP 400 when an AskUserQuestion entry has no question text

Chiusa Adatta ai principianti
#13,762 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, backend

Direzione di ricerca

Inizia in packages/shared/src/toolActivity.ts, su projectQuestionToolInput, poi trova i test esistenti e verifica come viene rappresentato il testo della domanda mancante. Aggiungi la copertura di regressione toStrictEqual richiesta e verifica che uno snapshot di thread contenente un’attività AskUserQuestion incompleta non produca più l’HTTP 400 segnalato né una risposta vuota.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

accepted bug via-triage

Version: v0.0.42 (stock npm install); the same code is on current main and the v0.0.43 nightly/preview tags as of 2026-09-26.

Repro

In a Claude thread, the model calls AskUserQuestion with an entry that has header and options but no question text (Claude rejects the call and the agent retries). The same shape also appears transiently when a streamed tool.updated for AskUserQuestion holds input.questions: [{}] because header streams before question.

From then on GET /api/orchestration/threads/:id returns HTTP 400 with an empty body; the web and mobile clients never load the thread ("waiting for input" / loading forever), while every other thread is fine. The WebSocket thread snapshot path fails the same way.

Server trace:

HttpApiSchemaError: Body … SchemaError: Expected JSON value at ["thread"]["activities"][N]["payload"]
Root cause

projectQuestionToolInput (packages/shared/src/toolActivity.ts) maps each question to { question: asTrimmedString(...) }, which yields { question: undefined } when there is no text. OrchestrationThreadActivity.payload is Schema.Unknown, and the HttpApi JSON codec rejects undefined, so one bad activity fails the whole snapshot. Because the failed call's tool.completed row is kept, the thread stays unloadable permanently.

Proposed fix

Leave the key out when there is no text:

// packages/shared/src/toolActivity.ts, projectQuestionToolInput
text === undefined ? {} : { question: text }

with a toStrictEqual regression test. Clients already read record(question)?.question, so a missing key is handled. It may also be worth making projectActivityPayload JSON-safe in general (drop undefined values) so a single malformed activity can never make a thread unloadable.

Possibly related symptom: #10418.

Found and patched with Claude Opus 5.5 via Claude Code; a one-commit local build with this change fixes it here.

Lingua principale
TypeScript
Stelle
24.8k
Fork
6.4k
Merge medio
7h 9m
PR unite (30g)
244

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pingdotgg/t3code

Tutte le issue di pingdotgg/t3code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.