Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#13,762 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api, backend

調査の方向性

packages/shared/src/toolActivity.ts の projectQuestionToolInput から始め、既存のテストを見つけて、質問テキストがない場合にどのように表現されているかを確認します。要求された toStrictEqual のリグレッションカバレッジを追加し、不完全な AskUserQuestion アクティビティを含む thread snapshot によって、報告された HTTP 400 や空のレスポンスが発生しなくなったことを検証します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
23.6k
フォーク
6.1k
平均マージ
10時間 20分
マージ済み PR(30日)
309

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。