[codex] Fix baseline Windows OAuth login#690
Open
brandonkachen wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Windows login fragility points that can show up in Bun baseline compiled binaries on older hardware.
openpackage's Windows PowerShell path.spawnerrorevents from the Windows URL handler sosafeOpen()returnsfalseinstead of letting an unhandled child-process error crash the CLI.withTimeout()helper fromcommon/src/util/promise.tsand add shared coverage for resolve, timeout, and cleanup behavior.--smoke-login-primitivescheck and run it in Windows, Linux, and macOS executable smoke paths where the built binary can run on the runner.Root Cause
The baseline Windows binary can run on older CPUs, but the OAuth flow still depends on local startup/login steps before the browser can complete authentication. Slow or hanging hardware fingerprint commands can prevent the CLI from reaching the login URL or poll loop, Windows URL opening through PowerShell is another brittle dependency from a compiled executable, and
spawn()failures are reported through an asynchronous child-processerrorevent rather than the surroundingtry/catch.The first CI smoke also exposed that prod-mode pre-login fingerprint logging/analytics can throw before analytics initialization. That is now guarded so telemetry cannot break login primitives.
Validation
bun test cli/src/utils/__tests__/open-url.test.ts cli/src/utils/__tests__/fingerprint.test.ts common/src/util/__tests__/promise.test.tsNEXT_PUBLIC_CB_ENVIRONMENT=prod bun cli/src/index.tsx --smoke-login-primitivesNEXT_PUBLIC_CB_ENVIRONMENT=prod ./cli/bin/freebuff --smoke-login-primitivesbun run --cwd cli typecheckbun run --cwd common typecheckgit diff --checkbuild-freebuffpassedbuild-and-smoke-freebuff-windowspassedNotes
The workflow smoke test does not perform a real GitHub OAuth browser/account round trip. It validates the compiled executables can load and exercise the local login prerequisites that failed here: timeout behavior, fingerprint generation/classification, and Windows browser-opener command construction.