Skip to content

fix(sse): correlate mid-stream continuation logs with requesting call - #14793

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/recovery-trace-correlation
Sep 25, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/recovery-trace-correlation

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14547

Summary

Mid-stream recovery lines carry no request correlation, so concurrent recoveries cannot be attributed, and every non-abandon outcome stays at debug, so successful recoveries are invisible. This change threads the request id through the log hooks and routes stitched outcomes to info while give-ups stay warn and tool-call refusals stay debug. The two file:line references now name the formatBufferedVerdictLog symbol instead of a perishable line number.

Related Issues

No linked issue — #13650 (merged) added the recovery traces this change attributes; #14639 widened them to Responses upstreams (searched recoveryTraceLogging, continuation outcome info: no open match at a41ded27cc).

Validation

  • Change type: sse
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/stream-recovery-trace-logging.test.ts: correlation suffix, per-outcome levels, and empty-id fallback.
  • tests/unit/chatcore-stream-recovery-log-wiring.test.ts: wiring asserting the persisted lines carry the request id at the new levels.
  • Comment-only pass in this round: the two emptyTurnRetry.ts:337 references now read as the empty-string fallback in formatBufferedVerdictLog (11/11 green).

Coverage Notes

  • The change touches open-sse/handlers/chatCore/recoveryTraceLogging.ts plus a one-argument call-site hunk; both test files above cover the hooks and the wiring.

Reviewer Notes

  • A single call-site argument in the frozen handler file; line count there is unchanged.
  • N/A — no migration, no flag, no default change.

buildContinuationLogHooks takes the request correlationId, suffixes every
line with correlationId=<id|none> (same empty-string fallback as the
emptyTurnRetry neighbor guard), and routes stitched/terminal outcomes to
info so a recovery stays visible outside debug; give-ups stay warn and
tool-call refusals stay debug. Single call-site argument at chatCore.ts.
@maxmad64bis
maxmad64bis force-pushed the fix/recovery-trace-correlation branch from 90446c5 to cb6c8ce Compare September 24, 2026 20:41
@maxmad64bis
maxmad64bis marked this pull request as draft September 24, 2026 23:41
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 25, 2026 01:01
@diegosouzapw
diegosouzapw merged commit d6bd040 into diegosouzapw:release/v3.8.51 Sep 25, 2026
16 of 28 checks passed
fouadSalkini added a commit to fouadSalkini/OmniRoute that referenced this pull request Sep 26, 2026
Slice 2/3 rewrote open-sse/handlers/chatCore.ts from an older snapshot,
silently undoing four merged fixes. Rebuild the file as the base version
plus only this PR's own hunks: stripNonStreamingForwardedHeaders on the
non-streaming path and apiKeyInfo on the streaming headers meta.

Restored:
- handleChatCore -> withResilienceActionsContext -> handleChatCoreInner
  wrapper, previousResponseResumed handling, notePreviousResponseResumed
  and the three noteBufferedVerdictOutcome calls (diegosouzapw#14810)
- pendingRequestId in every trackPendingRequest call, the pipeline
  options and finalizeToolLoopError (diegosouzapw#14797)
- the full-UUID traceId and its collision comment (diegosouzapw#14474)
- correlationId on buildContinuationLogHooks (diegosouzapw#14793)
@maxmad64bis
maxmad64bis deleted the fix/recovery-trace-correlation branch September 30, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants