runtime: process exits on any failed agent fetch (UND_ERR_SOCKET / UND_ERR_BODY_TIMEOUT)
維護者通常 10 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 58/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- node.js, python, typescript
研究方向
從 server.ts 開始,使用 pnpm runtime 或 tsx server.ts 執行 runtime,並追蹤 agent fetch 直到消費 stream。藉由停止本機的 uvicorn agent,或將一個回合延遲到超過 timeout,來重現問題。完成標準是:這些失敗會被捕捉、記錄並呈現出來,同時不會終止 runtime 或遺失 channel session。
由索引模型根據 Issue 內容生成。
描述
Summary
Any failure of the runtime's HTTP request to the Python agent — a dropped socket, a slow turn, an agent restart — raises an unhandled rejection inside undici and kills the whole runtime process (server.ts). The Slack/Teams channel session dies with it, and every message until an operator restarts the process is silently lost.
Observed three times in one evening of local testing, two distinct signatures:
1. Agent restarted mid-request (also reproduced by killing the agent during a turn):
Agent execution failed: TypeError: terminated
at Fetch.onAborted (node:internal/deps/undici/undici:11124:53)
[cause]: SocketError: other side closed
code: 'UND_ERR_SOCKET'
2. Agent turn exceeded undici's default 300s body timeout (a long tool-heavy turn with no stream activity):
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
TypeError: terminated
code: 'UND_ERR_BODY_TIMEOUT'
Both escape as uncaught exceptions / unhandled rejections, so Node terminates the process.
Why it matters
The runtime is the long-lived member of the pair — it holds the Intelligence channel session. A transient agent-side hiccup (deploy, OOM, slow model call) shouldn't take down message delivery for the whole workspace. There's also a secondary effect: when the crash lands mid-turn, the agent's LangGraph state can be left with a dangling tool call, and the next turn on that thread fails with the Responses API's No tool output found for function call ….
Suggested fix
- Wrap the agent fetch (and its stream consumption) so failures are caught, logged, and surfaced as a failed run — not an uncaught exception. A
process.on('unhandledRejection')backstop that logs instead of exiting would also stop the bleeding. - Consider raising or configuring undici's
bodyTimeoutfor the agent request (long agentic turns with sparse stream output can legitimately exceed 300s), or send periodic keep-alive events from the agent.
Happy to help test a fix — local repro is reliable: start a turn, then either kill the agent process or give it a tool that sleeps past 300s.
Environment: OpenTag main, Node v22.14.0, runtime via pnpm runtime / tsx server.ts, agent via uvicorn locally.
- 主要語言
- Python
- 星號
- 1.3k
- 分支
- 138
- 平均合併
- 5 天 10 小時
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CopilotKit/OpenTag 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
CopilotKit/OpenTag#86 ·
維護者通常 10 天內回覆
-
Approval card shows Python repr for list arguments that contain objects可能已有人在做 @RaphaelFakhri 於 8 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 25/100
CopilotKit/OpenTag#90 ·
維護者通常 10 天內回覆
-
難度 5/5 一週以上 新手友好度 25/100
CopilotKit/OpenTag#76 ·
維護者通常 10 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
CopilotKit/OpenTag#72 ·
維護者通常 10 天內回覆
-
難度 5/5 一週以上 新手友好度 30/100
CopilotKit/OpenTag#69 ·
維護者通常 10 天內回覆
查看 CopilotKit/OpenTag 的全部 Issue
相似的 Issue
-
filesystem: `file://C:/...` bucket_url is read as a UNC share named `C:` and silently lists no files未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
comp/desktop desktop/shell os/windows P3 tool/file type/bug
難度 2/5 1-3 小時 新手友好度 76/100
NousResearch/hermes-agent#145928 ·
維護者通常 1 天內回覆
-
integration:coding-agents
難度 1/5 1 小時以內 新手友好度 83/100
vectorize-io/hindsight#6151 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
FormalLanguageConstrainedPathQuerying/FLPQ_Data#174 ·
維護者通常 1 天內回覆
-
[VLM] granite_vision preset produces empty output and runs ~3× slower with Granite Vision 3.3-2B than with Granite Vision 4.1-4B可能已有人在做 @prassu017 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 74/100
docling-project/docling#5068 · 4 則留言 ·
維護者通常 1 天內回覆