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 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃

调研方向

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
星标
540
派生
35
平均合并
6 小时 43 分钟
30 天内合并 PR
23

环境准备

  • 没有 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 摘要。