Skip to content

[codex] Preserve auth HTTP failure diagnostics#3419

Open
juliusmarminge wants to merge 2 commits into
codex/server-auth-error-boundariesfrom
codex/auth-http-diagnostics
Open

[codex] Preserve auth HTTP failure diagnostics#3419
juliusmarminge wants to merge 2 commits into
codex/server-auth-error-boundariesfrom
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 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 full Error/Cause objects, so secrets in error messages are less likely to leak into logs.

failEnvironmentInternal now requires a cause, returns EnvironmentHttpInternalError (keeps the original cause as a defect while public JSON still encodes as EnvironmentInternalError), and re-propagates interrupt-only causes without logging or turning them into synthetic 500s. Request finalizers skip failure logs for interrupt-only exits.

browserSession cookie handling uses catchTags for CookieError only instead of a broad catch. New http.test.ts covers 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

  • 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 6d9fb38.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ab7219af-1c03-4fe3-9010-d9f9df945d7c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/auth-http-diagnostics

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Changes to files in the auth directory (apps/server/src/auth/http.ts and new test file) require human review regardless of scope, as auth-related code is treated as sensitive. The changes also modify error handling and diagnostic logging behavior in authentication code paths.

No code changes detected at 6d9fb38. Prior analysis still applies.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge force-pushed the codex/server-auth-error-boundaries branch from 0f8b837 to edf63a7 Compare June 20, 2026 22:46
@juliusmarminge juliusmarminge force-pushed the codex/auth-http-diagnostics branch from f476f6d to 519cb0a Compare June 20, 2026 22:47
@juliusmarminge juliusmarminge force-pushed the codex/server-auth-error-boundaries branch from edf63a7 to d430f59 Compare June 20, 2026 22:50
@juliusmarminge juliusmarminge force-pushed the codex/auth-http-diagnostics branch from 519cb0a to 265d3cb Compare June 20, 2026 22:51
@juliusmarminge juliusmarminge force-pushed the codex/server-auth-error-boundaries branch from d430f59 to fae19ef Compare June 20, 2026 23:11
@juliusmarminge juliusmarminge force-pushed the codex/auth-http-diagnostics branch from 265d3cb to 55daaa4 Compare June 20, 2026 23:11
juliusmarminge and others added 2 commits June 20, 2026 16:18
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/server-auth-error-boundaries branch from fae19ef to 2b5e1cf Compare June 20, 2026 23:20
@juliusmarminge juliusmarminge force-pushed the codex/auth-http-diagnostics branch from 55daaa4 to 6d9fb38 Compare June 20, 2026 23:20
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