chore: add a tuned knip config and drop the unused @fast-check/vitest#555
chore: add a tuned knip config and drop the unused @fast-check/vitest#555ndycode wants to merge 3 commits into
Conversation
Raw knip output was untrustworthy here (it flagged lib/index.ts itself): the config declares the real entry points (plugin host index.ts, the lib/index.ts facade, the auth/request/codex-cli/ui subpath index files, the scripts/ bins, and the test suites), ignores bench/vendor/dist/docs, ignores the host-resolved @openai/codex peer and the platform clipboard binaries, and downgrades export-level findings to warnings so the blocking signal is unused files and dependencies only. With it, knip reports zero errors against this tree (94 unused-export warnings remain as a pruning backlog). @fast-check/vitest is removed: nothing imports it — the property/chaos suites import fast-check directly, which stays. package.json and the tab-indented package-lock.json are edited surgically (the lockfile diff is exactly the removed entry). No npm script is added: knip is not a devDependency, and pinning it is a maintainer decision in a repo that SHA-pins its CI actions; run it with `npx knip`. https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 WalkthroughWalkthroughpr adds knip static analysis configuration to detect unused code and exports, and removes the now-unused ChangesTooling and dependency updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Review note: @latest resolves to whatever knip ships next, so editor validation and the npx-resolved CLI could silently diverge. Pin the schema to 6.16.1, the version this config was validated against. https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@knip.json`:
- Around line 35-42: Add an inline comment inside the "rules" object explaining
that the listed keys ("exports", "types", "nsExports", "nsTypes", "duplicates",
"enumMembers") are intentionally set to "warn" to support an incremental
export/type cleanup strategy (e.g., to allow ongoing PRs to gradually resolve
~94 warnings) rather than failing CI; place the comment above the "rules" block
and briefly state the purpose, scope, and when/how to escalate to "error".
- Around line 31-34: Add a short inline comment next to the "ignoreDependencies"
entry explaining why "`@openai/codex`" is excluded (e.g., this repo wraps the
official Codex CLI but does not directly depend on it; dependency is documented
as a peer in the README) so future maintainers understand the intentional
exclusion; update the comment near the ignoreDependencies array and reference
"`@openai/codex`" explicitly.
- Around line 1-43: Add an npm script named "knip" that runs the knip CLI using
the knip.json config, update CI workflow(s) to add a non-concurrent step that
runs the "knip" script before any steps that mutate build output (e.g.,
before/dist creation or "build" steps) so it won't race with dist writes, and
ensure the CI step uses a windows-safe invocation (npm run knip or node -e with
globs quoted) and not a concurrent task; then update the test expectations in
test/ci-workflows.test.ts to assert the "knip" script is invoked in both the
linux validate and the windows scripts expectations (alongside existing
"release-harness"/"validate" and "scripts-windows" checks) and use globs that
are safe on Windows.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5f61c4e5-0dc8-40c2-b6f9-c4ac55957861
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
knip.jsonpackage.json
💤 Files with no reviewable changes (1)
- package.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
**: # PROJECT KNOWLEDGE BASEGenerated: 2026-04-25
Commit: a87e005
Validated: 2026-06-10 against commit 98d9819 (repo audit; claims re-checked against the tree, content not regenerated)
Branch: main
Package version: 2.3.0-beta.1OVERVIEW
codex-multi-authis a Codex CLI-first OAuth account manager and optional forwarding wrapper for the official Codex CLI. The installedcodex-multi-authentrypoint handles account-management commands locally,codex-multi-auth-codexforwards official Codex commands through this package's wrapper when explicitly used, and runtime rotation can route live Responses traffic through a localhost account-rotation proxy by default. The plugin-host entrypoint remains exported for compatibility, but the primary product surface is the account manager, optional wrapper, storage, runtime proxy, and repair tooling.STRUCTURE
./ ├── scripts/ │ ├── codex.js # codex-multi-auth-codex wrapper, official CLI forwarder, shadow CODEX_HOME/runtime proxy setup │ ├── codex-multi-auth.js # standalone package CLI entrypoint │ ├── codex-routing.js # auth command and compatibility alias routing │ ├── codex-bin-resolver.js # official Codex binary discovery │ ├── codex-app-router.js # persistent localhost router for packaged Codex app bind │ └── codex-app-launcher.js # reversible user-level app launcher routing helper ├── index.ts # optional plugin-host runtime entry ├── lib/ # core runtime logic (see lib/AGENTS.md) │ ├── auth/ # OAuth flow, PKCE, callback server │ ├── runtime/ # Codex CLI/app integration helpers, app bind, live sync, runtime observability │ ├── request/ # request transform, SSE, failover, backoff │ ├── storage/ # path resolution, migrations, backups, restore, import/export │ ├── codex-cli/ # Codex CLI state sync and writer helpers │ ├── codex-manager/ # command modules and...
Files:
knip.json
🔇 Additional comments (5)
knip.json (5)
3-13: LGTM!
14-19: LGTM!
20-25: LGTM!
26-30: LGTM!
1-2: knip $schema pin matches current knip version
knip.jsonpins the schema toknip@6.16.1, andnpx knip --versionresolves to6.16.1, so the schema/CLI drift concern is moot.
Review asked for inline explanations of the @openai/codex exclusion and the warn-level rule strategy; plain JSON cannot carry comments, so the config becomes knip.jsonc (a format knip resolves natively) with both rationales documented in place. https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
chore: add a tuned knip config and drop the unused @fast-check/vitest
Summary
Follow-up to #554: makes dead-code detection repeatable instead of a one-off manual audit. Raw
knipoutput on this repo was untrustworthy — it flaggedlib/index.tsitself as unused because nothing declared the entry points — which is exactly why #554 needed every finding hand-verified.Changes
knip.json(new): declares the real entry points — the plugin-hostindex.ts, thelib/index.tsfacade, theauth/,request/,codex-cli/,ui/subpath index files that backpackage.jsonexports, thescripts/bins, and the test suites; ignoresbench/,vendor/,dist/,docs/; ignores the host-resolved@openai/codexpeer, the editor-onlytypescript-language-server, and the platform clipboard/locator binaries; downgrades export-level findings to warnings, so the blocking signal is unused files and dependencies only. With this config, knip exits clean on the current tree (94 unused-export warnings remain as an explicit pruning backlog rather than noise).@fast-check/vitestremoved from devDependencies: zero imports anywhere — the property/chaos suites importfast-checkdirectly, which stays. Bothpackage.jsonand the tab-indentedpackage-lock.jsonwere edited surgically; the lockfile diff is exactly the one removed entry (24 lines), no formatting churn.Deliberately no npm script:
knipis not a devDependency, and whether to add and pin it (this repo SHA-pins its CI actions) is a maintainer decision. Until then it runs vianpx knipand picks the config up automatically.Validation
npx knipexits 0 with zero error-level findings on this treenpm ci --dry-runvalidates the hand-edited lockfilenpm run typecheck; the fast-check property suite still passes (4/4)Risk / Rollback
Tooling config + one unused devDependency; revert the single commit.
https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
Generated by Claude Code
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 a
knip.jsoncconfig that declares entry points and demotes export-level findings to warnings, and removes the@fast-check/vitestdevDependency which has zero imports across the repo (property tests usefast-checkdirectly).knip.jsonc: pins entry points for the plugin-host, lib facade, subpath exports, scripts, and test suites; ignoresbench/,vendor/,dist/,docs/; lists platform-specific binaries (powershell.exe,pbcopy,where) and runtime-resolved deps (@openai/codex,typescript-language-server) explicitly; keepsfiles/dependenciesat error severity.@fast-check/vitestremoval: confirmed unused — all property and chaos test files import fromfast-checkdirectly; bothpackage.jsonandpackage-lock.jsonare updated surgically with no collateral formatting churn.Confidence Score: 5/5
safe to merge — tooling config and one unused devDependency removal, no runtime code touched
the change is entirely in tooling config and lockfile; all declared entry points were verified to exist on disk; @fast-check/vitest has zero imports across the codebase; the lockfile diff is surgical with no collateral churn
no files require special attention
Important Files Changed
Reviews (3): Last reviewed commit: "chore: convert the knip config to jsonc ..." | Re-trigger Greptile