Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#5,892 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C#
Stars
12
Forks
5
Avg merge
4h 19m
Merged PRs (30d)
932

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Systemorph/MeshWeaver

All issues in Systemorph/MeshWeaver

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.