runtime: process exits on any failed agent fetch (UND_ERR_SOCKET / UND_ERR_BODY_TIMEOUT)
Maintainer antworten meist innerhalb von 10 Tagen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- node.js, python, typescript
Rechercherichtung
Beginne bei server.ts, indem du die Runtime mit pnpm runtime oder tsx server.ts ausführst, und verfolge den Agenten-Fetch bis zum Konsumieren des Streams. Reproduziere den Fehler, indem du den lokalen uvicorn-Agenten stoppst oder einen Turn über das Timeout hinaus verzögerst. Erledigt ist die Aufgabe, wenn diese Fehler abgefangen, protokolliert und nach außen gemeldet werden, ohne die Runtime zu beenden oder die Kanalsitzung zu verlieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 1.3k
- Forks
- 138
- Ø Merge
- 5 T. 10 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CopilotKit/OpenTag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
CopilotKit/OpenTag#86 ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Approval card shows Python repr for list arguments that contain objectsEvtl. vergeben @RaphaelFakhri hat das vor 7 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
CopilotKit/OpenTag#90 ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
CopilotKit/OpenTag#76 ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
CopilotKit/OpenTag#72 ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
CopilotKit/OpenTag#69 ·
Maintainer antworten meist innerhalb von 10 Tagen
Alle Issues in CopilotKit/OpenTag
Ähnliche Issues
-
backlog
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
EchoTools/nevr-runtime#1108 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
btclib-org/btclib-wallet#587 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Maintainer antworten meist innerhalb von 1 Tag