refactor: extract storage path state#173
refactor: extract storage path state#173ndycode wants to merge 2 commits intorefactor/pr3-storage-path-state-helpersfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
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 |
21aaa89 to
8fc0531
Compare
ca9f9a6 to
f3604f5
Compare
Summary
lib/storage.tsinto a dedicated helper moduleWhat Changed
lib/storage/path-state.tswith the storage path state shape and itsget/sethelperslib/storage.tsto consume the extracted path-state helper module while preserving current behaviorValidation
npm run test -- test/storage.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
ca9f9a6to restore the inline storage path-state implementationAdditional Notes
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
clean mechanical extraction — moves the
StoragePathStatetype, module-levelcurrentStorageStatesingleton,AsyncLocalStoragecontext, andgetStoragePathState/setStoragePathStatehelpers verbatim fromlib/storage.tsinto a newlib/storage/path-state.tsmodule. behavior inlib/storage.tsis fully preserved; all call sites are unchanged.getStoragePathState()correctly documents the ALS/fallback trade-off and addresses the prior review thread on concurrencytest/storage-path-state.test.tswas added despite the project's 80% coverage threshold and the convention of pairing every extractedlib/storage/helper with a test suite — the fallback branch and ALS isolation are unexercisedcurrentStorageStateis a module-level singleton with no exported reset helper, creating test-isolation risk for future vitest suites that callsetStoragePathStatedirectlylib/AGENTS.mdstructure listing forlib/storage/still shows onlymigrations.tsandpaths.ts;path-state.tsshould be added to keep the knowledge base accurate for future agents working in this repoConfidence Score: 4/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant caller as lib/storage.ts callers participant storage as lib/storage.ts participant ps as lib/storage/path-state.ts participant als as AsyncLocalStorage caller->>storage: setStoragePath(projectPath) storage->>ps: setStoragePathState(state) ps->>ps: currentStorageState = state ps->>als: enterWith(state) caller->>storage: getStoragePath() storage->>ps: getStoragePathState() ps->>als: getStore() alt ALS store exists (async chain propagated) als-->>ps: StoragePathState else ALS store undefined (new/un-propagated context) ps->>ps: fallback: currentStorageState end ps-->>storage: StoragePathState storage-->>caller: resolved path stringPrompt To Fix All With AI
Last reviewed commit: "docs: clarify storag..."