Agent thread execution fails on transient model-provider connection reset mid-SSE-stream

Chiusa
#5,892 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start at the MeshWeaver.AI.AgentChatClient streaming-response consumption path and the ThreadExec error handler that emits the [ThreadExec] ERROR log; the issue gives no file paths, so locate these from the log category and error site. Check whether transient SSE failures are retried or already retried before changing behavior or log severity. Done means a transient connection reset is handled as intended instead of failing the run or being reported as an unhandled error; verify with an appropriate streaming-failure test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug sev:L

What is failing

During an agent thread execution (an automated PR-review triage thread), the model provider's streaming chat-completion response was cut off mid-stream by a TCP reset, and the exception propagated unhandled out of the SSE consumption loop into the ThreadExec error handler, which logged the run as failed. The component at the boundary is MeshWeaver.AI.AgentChatClient.

Probable cause

The reset itself is external — socket error 104 (ECONNRESET) from the remote peer (provider or an intermediary gateway closing a long-lived SSE connection), with the visible stack running entirely through the .NET networking stack and the OpenAI SDK's SSE enumerator (OpenAI.AsyncSseUpdateCollection1.AsyncSseUpdateEnumerator1...MoveNextAsync) and no MeshWeaver frame in between. High confidence on that mechanism; what is not established is whether AgentChatClient is supposed to retry or degrade gracefully on a transient stream failure. The exception escaping to the ThreadExec ERROR site suggests it does not, and that is the actionable defect. If a retry does exist and this was logged after it, then the issue is instead the log level — a transient external event surfaced as ERROR with a full stack.

Impact

Single occurrence on a single pod; one background agent run interrupted. No user-visible data loss and no portal impact — re-running the thread is the workaround. If these recur at any rate, the reliability of all automated thread executions is affected and the severity should be re-ruled.

Where to look

MeshWeaver.AI.AgentChatClient — the streaming-response consumption path around the OpenAI SDK's async streaming collection — and the ThreadExec error handler that emits the [ThreadExec] ERROR ... threadPath=... line. The MeshWeaver.AI source is not locatable in the readable mesh from this triage context, so start from the log category and the ThreadExec error site rather than a file link.

No existing incident or issue covers this component/symptom — this appears to be the first.


Evidence
Fingerprint a6273decbdc10005
Category MeshWeaver.AI.AgentChatClient
Severity Error
Exception System.IO.IOException
Top frame OpenAI.AsyncSseUpdateCollection1.AsyncSseUpdateEnumerator1.System.Collections.Generic.IAsyncEnumerator<U>.MoveNextAsync()
Namespace memex
Pods memex-portal-deployment-5dc5995596-d9qj7
Occurrences 1
First seen 2026-09-29 09:26:32Z
Last seen 2026-09-29 09:26:32Z
Routing not determined — no configured route matches the category MeshWeaver.AI.AgentChatClient. This repository is the configured fallback, not a finding about who owns the fault; the category names the LOGGER, which may not be the subject.
Recent log lines
2026-09-29 09:26:32Z memex-portal-deployment-5dc5995596-d9qj7 fail: MeshWeaver.AI.AgentChatClient[0]
      [ThreadExec] ERROR: 09:26:32.677 threadPath=Hosting/Triage/_Thread/review-pull-request-systemorph-meshweave-668a
      System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
       ---> System.Net.Sockets.SocketException (104): Connection reset by peer
         at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
         at System.Net.Sockets.NetworkStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
         at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
         at System.Net.Sockets.SocketAsyncEngine.System.Threading.IThreadPoolWorkItem.Execute()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
         at System.Threading.Thread.StartCallback()
      --- End of stack trace from previous location ---
      
         --- End of inner exception stack trace ---
         at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at System.Net.Http.HttpConnection.FillAsync(Boolean async)
         at System.Net.Http.HttpConnection.ChunkedEncodingRea…[truncated]

Opened automatically from Admin/_LogIncident/a6273decbdc10005. Recurrences are folded into this issue rather than opening new ones.
It also stands for the whole log site 85c3f064b5f7348e: other fingerprints of this site fold in here as comments rather than opening tickets of their own.

Lingua principale
C#
Stelle
12
Fork
5
Merge medio
5h 7m
PR unite (30g)
981

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Systemorph/MeshWeaver

Tutte le issue di Systemorph/MeshWeaver

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.