Uh oh!
There was an error while loading. Please reload this page.
[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 modify files in the auth directory (apps/server/src/auth/http.ts), which requires human review regardless of change complexity per security guidelines. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
0f8b837 to
edf63a7Comparef476f6d to
519cb0aCompareedf63a7 to
d430f59Compare519cb0a to
265d3cbCompared430f59 to
fae19efCompare265d3cb to
55daaa4Comparefae19ef to
2b5e1cfCompare55daaa4 to
6d9fb38Compare2b5e1cf to
8728ebfCompare6d9fb38 to
5697b83Compare8728ebf to
55e9cd5Compare5697b83 to
a1f24c7Comparea1f24c7 to
c26e2ffCompare70fdb85 to
5a80908Comparec26e2ff to
89040c9Compare553daf6 to
ed36096Compare89040c9 to
2d37a35Compareed36096 to
15aa01aCompare2d37a35 to
307df64CompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Interrupt missed in Cause
- Extracted the loop body into a recursive walkForInterrupt helper that, upon encountering a non-interrupt-only Cause, iterates its Fail reasons and continues walking each error's .cause chain to find nested interrupt causes.
Or push these changes by commenting:
@cursor push 5780d93e6f
Preview (5780d93e6f)
diff --git a/apps/server/src/auth/http.ts b/apps/server/src/auth/http.ts--- a/apps/server/src/auth/http.ts+++ b/apps/server/src/auth/http.ts@@ -83,10 +83,27 @@
function findInterruptCause(input: unknown): Cause.Cause<never> | undefined {
const seen = new Set<object>();
+ return walkForInterrupt(input, seen, 0);+}++function walkForInterrupt(+ input: unknown,+ seen: Set<object>,+ depth: number,+): Cause.Cause<never> | undefined {
let current = input;
- for (let depth = 0; depth < MAX_CAUSE_CHAIN_DEPTH; depth += 1) {+ for (let d = depth; d < MAX_CAUSE_CHAIN_DEPTH; d += 1) {
if (Cause.isCause(current)) {
- return Cause.hasInterruptsOnly(current) ? (current as Cause.Cause<never>) : undefined;+ if (Cause.hasInterruptsOnly(current)) {+ return current as Cause.Cause<never>;+ }+ for (const reason of current.reasons) {+ if (Cause.isFailReason(reason)) {+ const found = walkForInterrupt(reason.error, seen, d + 1);+ if (found !== undefined) return found;+ }+ }+ return undefined;
}
if (typeof current !== "object" || current === null || seen.has(current)) {
return undefined;You can send follow-ups to the cloud agent here.
Uh oh!
There was an error while loading. Please reload this page.
307df64 to
07d8a37Compare15aa01a to
bd937beCompare07d8a37 to
e9e9089Comparebd937be to
517c1eaCompare517c1ea to
8d916bcComparee9e9089 to
629ce09Compare8d916bc to
7670d78Compare629ce09 to
9c1fed6Compare7670d78 to
1ed6271Compare9c1fed6 to
f5fe411CompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: IPC openExternal breaks boolean contract
- Added Effect.orElseSucceed(() => false) to the IPC handler so that ElectronShellOpenExternalError is caught and returns false instead of rejecting the IPC call, preserving the boolean contract for renderer callers.
Or push these changes by commenting:
@cursor push f71e08ecb0
Preview (f71e08ecb0)
diff --git a/apps/desktop/src/ipc/methods/window.ts b/apps/desktop/src/ipc/methods/window.ts--- a/apps/desktop/src/ipc/methods/window.ts+++ b/apps/desktop/src/ipc/methods/window.ts@@ -141,6 +141,6 @@
result: Schema.Boolean,
handler: Effect.fn("desktop.ipc.window.openExternal")(function* (url) {
const shell = yield* ElectronShell.ElectronShell;
- return yield* shell.openExternal(url);+ return yield* shell.openExternal(url).pipe(Effect.orElseSucceed(() => false));
}),
});You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit f5fe411934d709ab8dbc660896ff7eabf85c8222. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
c91fad6 to
9e0c536Comparef5fe411 to
efacbf7Compareefacbf7 to
15a2898CompareCo-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
15a2898 to
f0537a8Compare

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 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 onlycode,reason, andtraceId(no raw errors in responses).Logging no longer dumps full
Cause/error objects. Request and operation failures log a boundedfailureTagplus reason/failure/defect/interruption counts. Request finalizers skip logging when the exit is interrupt-only.failEnvironmentInternalre-propagates nested interruption causes instead of turning them into synthetic 500s.browserSessioncookie handling usescatchTagsforCookieErroronly, 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
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 f0537a8.