Skip to content

feat(desktop): sign in through the browser, sharing the t3 connect credential - #7483

Open
t3dotgg wants to merge 9 commits into
mainfrom
t3code/move-electron-auth-to-browser
Open

t3dotgg wants to merge 9 commits into
mainfrom
t3code/move-electron-auth-to-browser

test(server): stop socket reuse and port stranding across loopback lo…

627b8cb
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Effect Service Conventions succeeded Aug 19, 2026 in 2m 6s

Effect Service Conventions: No issues found

All clear

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.


🔍 Agent activity — reasoning, no tool calls

💭 Good, the missing test issue is resolved now that DesktopSingleInstance.test.ts is included. I'm now reviewing the diff for Effect service convention violations, checking that DesktopSingleInstance.ts properly uses Context.Service, make, layer, and namespace imports while acquiring ElectronApp from the environment, then moving on to look at the larger changes in CliTokenManager.ts and the React-based connectAuth.tsx. I'm checking CliTokenManager's use of Fiber, Ref, and Semaphore, along with its error wrapping into CloudCliAuthorizationError and its catchTags usage in http.ts, both of which look consistent with convention. In connectAuth.tsx, I'm confirming the imports follow the right patterns—using namespace imports for Effect and Schema, and named imports from the contracts package—while noting it defines a local predicate using Schema.is to check for bad request errors. That predicate isn't just a redundant wrapper since it's consumed inside a larger function that walks the cause chain, so it seems fine. I'm also verifying the DesktopApp.ts change that removes the clerk-tokens.json file via FileSystem, and checking that DesktopSingleInstance only imports Scope as a type, which is allowed. Now I want to dig into CliTokenManager.ts more closely to see if any new error types were introduced, and check whether beginBrowserLogin's use of Effect.provide with a captured services context matches existing patterns—so I'm going to pull up that file directly. I'm questioning whether constructing a string message from the query param and passing it as cause actually violates the convention of preserving the exact underlying value, since it's synthesizing a new string rather than passing through the original error value. But there's already a similar pattern elsewhere in the code at line 432, so this seems like a pre-existing pattern rather than a new issue worth flagging. I'm now scanning the rest of the diff for clearer violations, checking the HTTP handlers, the auth token handler, the React connectAuth component, and managedAuth.tsx — all of these look fine so far, with the mutable module-level token provider already removed as expected. Moving to the desktop single-instance service, I'm checking whether the lock acquisition during layer construction is acceptable, and reviewing the Electron app and relay config additions — nothing stands out as problematic there either. I'm also checking the client-runtime's managedRelay change and the web connectAuth component for any schema predicate conventions being violated, but the existing patterns seem consistent with what's expected. Now I'm looking at whether the new loopback callback server code uses the singular Effect.catchTag correctly. The convention actually prefers Effect.catchTags even for single-tag cases, so I'm checking whether this is newly introduced code or just moved from elsewhere in the file — it looks like this is pre-existing code relocated into the new function rather than a fresh violation, so it likely falls under preserving legacy patterns during a move rather than a new style issue to flag. I'm scanning the rest of the diff for similar patterns — other uses of catchTag, Layer.succeed, or runPromise in service code — and checking whether Effect.runPromiseWith inside the Electron second-instance callback is consistent with how it was used before, since that's a legitimate boundary case rather than a new violation. I notice the early return when pending is already Some actually returns the full internal object, not just the typed authorizationUrl field—structurally it still satisfies the interface since extra fields like state and the manualCode Deferred just leak through untyped. It's not a real Effect convention violation, more a minor smell worth flagging since http.ts only cares about the side effect anyway. Moving on, I'm checking beginBrowserLogin's error mapping and clientAuthState's error handling, both of which look fine. I also want to verify the web/desktop pieces follow the same service conventions—checking connectAuth.tsx and DesktopSingleInstance.ts, which both look compliant with the expected namespace imports, Context.Service pattern, make, and layer structure. Now I'm trying to parse what "defaults to failure" means for this check—whether it implies that any findings at all should cause a fail, or whether the absence of findings is what triggers an automatic "all clear" result. Given the instruction to respond exactly "All clear" when there are no findings, I'm reconciling that with the JSON schema requirement, concluding I should still emit valid JSON but with a success state and a title like "Effect Service Conventions: Complete." Before finalizing that there's nothing to flag, I want to double-check a few more changed files—managedAuth.tsx, useCloudLinkController.ts, and http.ts—for any named imports or aliasing from "effect" that might violate conventions. I'm checking the web app files for import conventions and service shape issues—connectAuth.tsx looks fine using Effect and Schema, and the contracts package schema changes look okay too. I'm also reviewing the relay API's token verification logic, particularly the error thrown when a Clerk OAuth token was issued to an unexpected client. That looks consistent with the existing style. Now I want to check the desktop side for any convention issues with removed error definitions, and also look at the managedAuth.tsx changes to see if there's any lingering module-level state I should be aware of. I'm checking a few borderline cases around error handling patterns but nothing looks like a real violation—these are pre-existing or fully handled channels. I'll conclude everything is clear, though I need to reconcile that with the required JSON output format. Since this check defaults to failure only when unresolved findings exist, and there are none here, I'll set the state to success with the summary "All clear" and skip posting any comments.


Agent Credits: 136 credits