Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[bug] text chat --api responses --tool web_search: non-streaming requests systematically fail with headers timeout; --stream works

未關閉
#239 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
57/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
node.js, typescript

研究方向

Start by reading the bl text chat command and its --stream option handling, then trace how non-streaming Responses API requests with tools are sent and how headers timeouts are handled. Reproduce the reported non-TTY request with --api responses --tool and compare it with --stream. Done means the non-streaming tool request can return successfully, or the CLI handles the timeout as intended; add a regression test for the behavior.

由索引模型根據 Issue 內容生成。

描述

Environment

  • CLI: bl 2.1.0
  • Skill: 2.1.0
  • Node: v25.9.0
  • OS: macOS 26.5.2 (arm64)
  • Region: cn-beijing (domestic; config profile token-plan, base_url https://token-plan.cn-beijing.maas.aliyuncs.com)

Reproduce

# Non-TTY (agent) invocation — systematically times out:
bl text chat --api responses --tool '{"type":"web_search"}' --timeout 300 \
  --system "Reply in 简体中文。" \
  --message "<a search question>"

# Same request with forced streaming — succeeds:
bl text chat --api responses --stream --tool '{"type":"web_search"}' --timeout 550 \
  --system "Reply in 简体中文。" \
  --message "<the same search question>"

Expected

Both invocations return the model's answer with web search results.

Actual

Without --stream: request systematically fails with headers timeout — Error: Network request failed: UND_ERR_HEADERS_TIMEOUT: Headers Timeout Error (exit 6) or Error: Request timed out ... This operation was aborted (exit 5). ~13 of 14 attempts failed over a period of hours; the single success took several minutes.

With --stream: 3/3 attempts succeeded, responses returned normally.

Analysis

bl text chat --help says --stream Stream response tokens (default: on in TTY). In non-TTY (agent/pipe) context the default is non-streaming, so the CLI waits for the full Responses-API + web_search run (multi-round searches, server-side) before receiving response headers — which reliably exceeds the gateway's headers timeout. Streaming receives headers early and works. Suggestion: for --api responses with tools (or in non-TTY generally), default to streaming, or automatically retry with streaming on UND_ERR_HEADERS_TIMEOUT.

Already tried

  • bl update / skill version aligned (2.1.0 across CLI, npm, skills)
  • Network ruled out: direct curl --noproxy '*' to the endpoint returns 404 in ~0.1s; same with system proxy — no local connectivity issue
  • --timeout raised to 550s — non-streaming still fails; streaming succeeds with the same timeout
  • Multiple retries over several hours: non-stream failure rate ~13/14, stream success 3/3

Notes

  • Frequency: always (non-streaming); none so far (streaming)
  • Invoked via: agent (non-TTY automation)
  • No request ID available: headers timeout means no response headers/ID were ever received
主要語言
TypeScript
星號
527
分支
33
平均合併
6 小時 11 分鐘
30 天內合併 PR
26

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

modelstudioai/cli 的其他 Issue

查看 modelstudioai/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。