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 を実行し、stream の消費まで agent fetch を追跡します。ローカルの 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時間
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
CopilotKit/OpenTag#90 ·
メンテナーはふだん 10 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CopilotKit/OpenTag#76 ·
メンテナーはふだん 10 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
CopilotKit/OpenTag#72 ·
メンテナーはふだん 10 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
CopilotKit/OpenTag#69 ·
メンテナーはふだん 10 日以内に返信
CopilotKit/OpenTag の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4860 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
:bug: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
scikit-image/scikit-image#8377 ·
メンテナーはふだん 1 日以内に返信
-
Ingredient import validation accepts negative nutrient values and NaN対応中かも @LukeSekai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wger-project/wger#2564 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/ponymail-foal#351 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 4 日以内に返信