[codex] Preserve auth HTTP failure diagnostics#3419
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review Changes to files in the auth directory ( No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
0f8b837 to
edf63a7
Compare
f476f6d to
519cb0a
Compare
edf63a7 to
d430f59
Compare
519cb0a to
265d3cb
Compare
d430f59 to
fae19ef
Compare
265d3cb to
55daaa4
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
fae19ef to
2b5e1cf
Compare
55daaa4 to
6d9fb38
Compare
Summary
catchTagshandlingValidation
vp test apps/server/src/auth/http.test.ts apps/server/src/auth/EnvironmentAuth.test.tsvp check(passes with 20 pre-existing warnings)vp run typecheckStacked on #3240.
Note
Medium Risk
Touches auth HTTP error paths and logging on a security-sensitive surface; changes are defensive (redaction, interrupt handling) but affect how all internal failures are surfaced.
Overview
Auth environment HTTP failures now log summarized diagnostics (
failureTag, reason/failure/defect/interruption counts) instead of dumping fullError/Causeobjects, so secrets in error messages are less likely to leak into logs.failEnvironmentInternalnow requires a cause, returnsEnvironmentHttpInternalError(keeps the original cause as a defect while public JSON still encodes asEnvironmentInternalError), and re-propagates interrupt-only causes without logging or turning them into synthetic 500s. Request finalizers skip failure logs for interrupt-only exits.browserSessioncookie handling usescatchTagsforCookieErroronly instead of a broad catch. Newhttp.test.tscovers redacted logging/encoding and interruption behavior.Reviewed by Cursor Bugbot for commit 6d9fb38. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve auth HTTP failure diagnostics by summarizing causes instead of serializing them
failureTagand counts of failures, defects, and interruptions via a newfailureLogAttributeshelper.findInterruptCauseto detect nested interruption causes and re-propagate them directly, avoiding conversion into synthetic internal errors and suppressing redundant logs.EnvironmentHttpInternalErrorwith a boundedfailureTagfield and preserved original cause as a defect, replacing the generic internal error type.annotateEnvironmentRequestfinalizer so it skips logging entirely when the exit cause contains only interrupts.browserSessioncookie error catch to only handleCookieError, letting other errors fall through to upstream handling.Macroscope summarized 6d9fb38.