chore(diagnostics): Add logging to debug missing agent responses#2726
Open
charlesvien wants to merge 2 commits into
Open
chore(diagnostics): Add logging to debug missing agent responses#2726charlesvien wants to merge 2 commits into
charlesvien wants to merge 2 commits into
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/workspace-server/src/services/auth-proxy/auth-proxy.ts:235-236
Both `err` and `errorDetail: serializeError(err)` are included in the same log call. The `errorDetail` already captures the full cause chain that `serializeError` was added to surface; the raw `err` field is redundant unless the logging framework uses it specifically for stack-trace extraction. Consider dropping `err` to keep the payload clean, or rename it to `stack: err instanceof Error ? err.stack : undefined` if the stack is the only extra signal you want.
```suggestion
errorDetail: serializeError(err),
```
Reviews (1): Last reviewed commit: "add diagnostics for missing agent respon..." | Re-trigger Greptile |
There was a problem hiding this comment.
The automated gates denied this PR because it touches auth-proxy code and exceeds the T1-auto threshold. While the changes are purely diagnostic logging (no auth logic modified, no security risk), the deny-list match and T2-never classification require human review rather than auto-approval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users intermittently get no response from the agent: the turn shows "Generated in Xs" but no text appears, on both local and cloud tasks. Logs point at cloud SSE streams being terminated on a ~120s cadence with content lost on reconnect or at the terminal transition, but we lack the targeted signals to confirm it in prod. This adds diagnostics so the next log dump can pinpoint the failure.
Changes
cloud-task.ts): log connection response headers (to identify what cuts the stream at ~120s), Last-Event-ID resume verification, per-connection delivery counts, a terminal-stop signal, and watcher failure.sessionService.ts): warn when a turn completes with zero assistant text and zero tool output, for both local and cloud.streams.ts): quantify agent-to-client chunks dropped when a stream closes mid-turn.agent.ts): warn when a session is cleaned up while a prompt or tool call is in flight.shared/errors.ts) plus proxy forward and stream diagnostics (auth-proxy.ts,proxy-stream.ts) to capture socket-level causes (ECONNRESET, UND_ERR_SOCKET) behind "terminated".How did you test this?
Manually
Automatic notifications