chore(diagnostics): Instrument agent no-response failures#2740
Conversation
|
9d4313b to
cfdc1e9
Compare
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Gates denied this PR because it touches auth-proxy code and exceeds the T2-never tier threshold. While the changes appear to be purely diagnostic logging with no behavioral modifications to auth logic, the deny-list rule exists to ensure human review of any auth-adjacent changes. With zero reviews on a multi-file change touching auth infrastructure, a human reviewer must sign off before auto-approval.

Problem
People intermittently get no response from the agent, transient and seemingly random, on both local and cloud tasks. The current logs don't capture the cause: undici's generic "terminated" hides the real socket reason, cloud SSE streams drop without naming the terminating hop, and local session-init failures surface only as opaque "Internal error".
Changes
serializeErrorto@posthog/sharedto flatten an error and its.causechain, surfacing the real undici socket reason (ECONNRESET, UND_ERR_SOCKET) behind "terminated"headersSent, duration, bytes streamed, plus a per-request completion baselinemodelConfigMsvsinitMs)serializeErrorand the proxy byte-countingHow did you test this?
Manually
Automatic notifications