Skip to content

fix(o87): preserve proxy connect cause; skip rdk-docs warm under HTTPS_PROXY - #84

Merged
QiaolongLi1201 merged 3 commits into
mainfrom
fix/o87-connect-without-answer
Oct 11, 2026
Merged

QiaolongLi1201 merged 3 commits into
mainfrom
fix/o87-connect-without-answer

Conversation

@QiaolongLi1201

Copy link
Copy Markdown
Collaborator

Summary

O87 (板上 P0): CONNECT 有、回答无 — preserve full failure cause, raise proxy connectTimeout, and skip eager rdk-docs npx warm under HTTPS_PROXY so default MCP-on does not squeeze the main gateway on a narrow reverse tunnel.

Board lock (/workspace/ux/board-o67-o70-baseline.md, tip 4b783fc7):

Condition Result
Same tunnel, only HTTPS_PROXY, MOSS_NO_RDK_DOCS=1 11s useful answer PASS
Same tunnel, MCP (rdk-docs) on CONNECT present but fails + truncated 网关原文:)

Acceptance (QA / PM, locked after #83)

  1. Complete cause — forbid truncated 网关原文:)
  2. Only HTTPS_PROXY: CONNECT ∧ useful answer even with default MCP on (must not squeeze main gateway)
  3. Failures must not be mislabeled as timeout/auth
  4. UX board matrix: default MCP vs MOSS_NO_RDK_DOCS=1

Fix

Cause-complete (priority 1)

  • Classify UND_ERR_CONNECT_TIMEOUT / ConnectTimeoutError as network (never model timeout / auth /「换更快的模型」)
  • Connection failures use attach='details' so chat keeps low-level cause (详细信息:…UND_ERR_…)
  • Drop punctuation-only gateway leftovers (lone )) — never show 网关原文:)
  • connection-error.ts: proxy-aware hint for undici connectTimeout (MOSS_CONNECT_TIMEOUT_MS)

MCP / tunnel contention (priority 2)

  • EnvHttpProxyAgent connectTimeout 30s when proxy set (override via MOSS_CONNECT_TIMEOUT_MS; 0 = undici default)
  • shouldEagerWarmRdkDocs(env): skip eager rdk-docs npx warm when HTTPS_PROXY/HTTP_PROXY set; first rdk-docs tool call still starts the server

Does not touch src/safety/** or git-config-env.ts. Independent of #80 exit-hang sign-off.

Files

  • src/provider/errors.ts
  • src/provider/error-classify.ts
  • src/provider/connection-error.ts
  • src/provider/keep-alive-dispatcher.ts
  • src/cli/rdk-docs-mcp.ts
  • src/cli-main.ts
  • test/o87-connect-without-answer.spec.mjs (new)
  • test/error-classify-500.spec.mjs (minor assert align)

Tests

npm run check                                          # PASS (format + lint + typecheck)
node --test test/o87-connect-without-answer.spec.mjs   # 8/8 PASS
node --test test/error-classify-500.spec.mjs           # PASS
npm run test:filter -- --filter error-classify         # PASS (3 files)

Coverage:

  • UND_ERR_CONNECT_TIMEOUT → network + Details, not timeout/auth
  • lone ) → no 网关原文
  • CONNECT-then-blackhole fixture → network + cause
  • shouldEagerWarmRdkDocs false under proxy
  • resolveConnectTimeoutMs 30s / override / 0

Base

Board (UX)

After CI green: re-run matrix — only HTTPS_PROXY, default MCP vs MOSS_NO_RDK_DOCS=1; lock CONNECT ∧ useful answer + complete cause on failure.

…S_PROXY

Board lock (board-o67-o70-baseline): same tunnel, only HTTPS_PROXY —
MOSS_NO_RDK_DOCS=1 → 11s useful answer; MCP-on → CONNECT present but
fails with truncated 网关原文:). H3 = MCP/npx tunnel contention.

- Classify UND_ERR_CONNECT_TIMEOUT as network (not model timeout/auth)
- Always attach low-level Details for connection failures; drop junk )
- EnvHttpProxyAgent connectTimeout 30s when proxy set (MOSS_CONNECT_TIMEOUT_MS)
- Skip eager rdk-docs npx warm under proxy (shouldEagerWarmRdkDocs); tool call still starts it
- Fixture: CONNECT-then-blackhole → network + cause, not timeout/auth
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

O87 added the env for proxy connectTimeout but missed the
authoritative inventory; cli-config-env.spec failed on Ubuntu CI.
Rewrite MOSS_CONNECT_TIMEOUT_MS EN/ZH notes to prose (代理连接超时 /
library default). Skip bare English transport prose under 详细信息 so
cli-ui-language stays green; still attach ECONNREFUSED/UND_ERR_* codes.
@QiaolongLi1201
QiaolongLi1201 merged commit 78ea07c into main Oct 11, 2026
10 of 12 checks passed
@QiaolongLi1201
QiaolongLi1201 deleted the fix/o87-connect-without-answer branch October 12, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant