Open
Conversation
Contributor
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE 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)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
auth,storage,config,request, andcliValidation
npm run typechecknpm run lint -- package.json lib/auth/index.ts lib/request/index.ts lib/codex-cli/index.ts test/public-api-contract.test.ts(ESLint ignorespackage.json, no TypeScript lint errors)npm run test -- test/public-api-contract.test.tsnpm run buildnode --input-type=module -e "const root = await import('codex-multi-auth'); const auth = await import('codex-multi-auth/auth'); const storage = await import('codex-multi-auth/storage'); const config = await import('codex-multi-auth/config'); const request = await import('codex-multi-auth/request'); const cli = await import('codex-multi-auth/cli'); console.log(JSON.stringify({ rootPlugin: typeof root.OpenAIOAuthPlugin, authExchange: typeof auth.exchangeAuthorizationCode, storageLoad: typeof storage.loadAccounts, configLoad: typeof config.loadPluginConfig, requestHeaders: typeof request.createCodexHeaders, cliState: typeof cli.loadCodexCliState }));"note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this PR adds five explicit package subpath exports (
auth,storage,config,request,cli) with narrow barrel entrypoints, replacing the need for consumers to rely on the broad root barrel. it also extends the public API contract test to snapshot the full exports map and validate barrel alignment.highlights:
lib/request/index.tscorrectly excludesresponse-handler.tsandstream-failover.ts(SSE internals), and the contract test explicitly asserts their absence — clean follow-through on the prior review concernlib/auth/index.tsis narrow by design — onlyauth.ts, leavingbrowser.ts,server.ts,token-utils.tsas implementation detailspackage.jsonexports map has correcttypes-first condition ordering for all five subpaths; ESM-only shape is consistent with"type": "module"one gap worth closing: the
codex-multi-auth/clibarrel (lib/codex-cli/index.ts) promotes all four CLI modules — includingobservability.tsandsync.ts(account sync coordination, concurrency-sensitive) — to Tier A semver-stable surface. the contract test only pinscli.loadCodexCliState; no positive assertions guardobservability.ts/sync.ts/writer.tsexports, and there are no negative guards either. this is asymmetric with therequestbarrel test pattern and leaves those exports silently unprotected against future renames.Confidence Score: 4/5
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph consumers["consumer import paths"] R[codex-multi-auth] A[codex-multi-auth/auth] S[codex-multi-auth/storage] C[codex-multi-auth/config] RQ[codex-multi-auth/request] CL[codex-multi-auth/cli] end subgraph barrels["barrel entrypoints (dist/)"] RI[dist/index.js] AI[dist/lib/auth/index.js] SI[dist/lib/storage.js] CI[dist/lib/config.js] RQI[dist/lib/request/index.js] CLI[dist/lib/codex-cli/index.js] end subgraph modules["source modules"] AM[auth/auth.ts] SM[storage.ts] CM[config.ts] FP[request/failure-policy.ts] FH[request/fetch-helpers.ts] RLB[request/rate-limit-backoff.ts] RT[request/request-transformer.ts] RH[request/response-handler.ts ❌ excluded] SF[request/stream-failover.ts ❌ excluded] OB[codex-cli/observability.ts] ST[codex-cli/state.ts] SY[codex-cli/sync.ts] WR[codex-cli/writer.ts] end R --> RI A --> AI S --> SI C --> CI RQ --> RQI CL --> CLI AI --> AM SI --> SM CI --> CM RQI --> FP RQI --> FH RQI --> RLB RQI --> RT CLI --> OB CLI --> ST CLI --> SY CLI --> WRPrompt To Fix All With AI
Last reviewed commit: "Hide internal reques..."