Skip to content

[codex] Preserve auth HTTP failure diagnostics - #3419

Closed
juliusmarminge wants to merge 2 commits into
codex/redact-dpop-request-targetfrom
codex/auth-http-diagnostics
Closed

[codex] Preserve auth HTTP failure diagnostics#3419
juliusmarminge wants to merge 2 commits into
codex/redact-dpop-request-targetfrom
codex/auth-http-diagnostics

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • retain exact underlying causes on typed auth HTTP 500 errors while keeping public JSON schemas redacted
  • log only bounded failure tags and reason counts, and suppress synthetic interruption failures
  • replace the remaining broad cookie catch with exhaustive catchTags handling

Validation

  • vp test apps/server/src/auth/http.test.ts apps/server/src/auth/EnvironmentAuth.test.ts
  • vp check (passes with 20 pre-existing warnings)
  • vp run typecheck

Stacked on #3240.


Note

Medium Risk
Touches auth HTTP 500 and logging paths where mishandling could hide real failures or leak data; changes are guarded by new tests and redacted API encoding.

Overview
Auth HTTP internal failures now keep the full underlying cause on a typed EnvironmentHttpInternalError, while public JSON still encodes only code, reason, and traceId (no raw errors in responses).

Logging no longer dumps full Cause/error objects. Request and operation failures log a bounded failureTag plus reason/failure/defect/interruption counts. Request finalizers skip logging when the exit is interrupt-only.

failEnvironmentInternal re-propagates nested interruption causes instead of turning them into synthetic 500s. browserSession cookie handling uses catchTags for CookieError only, passing the cause into internal failure handling.

Reviewed by Cursor Bugbot for commit f0537a8. 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

  • Replaces raw cause/error serialization in auth HTTP logs with bounded diagnostics: a trimmed failureTag and counts of failures, defects, and interruptions via a new failureLogAttributes helper.
  • Adds findInterruptCause to detect nested interruption causes and re-propagate them directly, avoiding conversion into synthetic internal errors and suppressing redundant logs.
  • Introduces EnvironmentHttpInternalError with a bounded failureTag field and preserved original cause as a defect, replacing the generic internal error type.
  • Limits annotateEnvironmentRequest finalizer so it skips logging entirely when the exit cause contains only interrupts.
  • Narrows the browserSession cookie error catch to only handle CookieError, letting other errors fall through to upstream handling.

Macroscope summarized f0537a8.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant