Repository navigation
fix: resolve 46 unused local findings (batch 6) - #2458
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Remove unused code src/commands/provider/provider.tsx, src/components/LogSelector.tsx, src/entrypoints/sdk/query.ts, src/main.tsx, src/query.ts, src/services/api/openaiShim.test.ts, src/services/api/openaiShim/requestExecutor.test.ts, src/services/tools/toolExecution.ts, src/utils/*, tests/sdk/*, vscode-extension/openclaude-vscode/src/chat/* |
Removes unused imports, locals, helpers, and test utilities. LogSelector no longer builds searchable transcript text. The TEMPLATES-enabled query path loads the classifier for side effects. Existing permission-denial behavior and provider-profile re-exports remain. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
- Twigpine/openclaude#2456: Both PRs are batches in the same unused-local cleanup sequence and touch overlapping areas.
- Twigpine/openclaude#2440: It removes Fuse-based deep-search execution in
LogSelector.tsx; this PR removes related search-text helpers and constants. - Twigpine/openclaude#2457: Both PRs are batches in the same cleanup sequence and include SDK and OpenAI shim areas.
Suggested reviewers: chioarub, kevincodex1
Merge Risk: 
Minimal · up to 1ead0
-
No concrete current-head behavior or operational risk was identified; the cleanup is mergeable with normal checks.
Pre-merge checks: 
6 · 
1
-
Failed checks: 1 warning Passed checks: 6 passed-
Full details: Risk Surface Disclosed
-
Explanation
PASS. The diff touches provider setup, SDK permission interruption, tool execution, MCP scope handling, and startup/module-loading paths. The PR description identifies provider chooser/profile, SDK pending-prompt handling, tool execution, and preserved module loading or side effects. It also states that no live-provider behavior, live API behavior, user-facing behavior, or public interface changed. The current review reports zero actionable findings, so no blocker is identified.
Full details: No Hidden Policy Change
-
Explanation
PASS — The diff contains cleanup only. The provider helper was unreferenced, and the active
/providerhelp text and provider choices remain. The TEMPLATES classifier still loads under the same feature gate. Permission interruption still resolves every pending prompt as denied. Telemetry and MCP metadata calls remain. Module-loading calls for Gemini metadata andcryptoremain. No product, trust-model, routing-default, network, telemetry, or permission-policy decision changed.
Full details: Description check
-
Explanation
The pull request description follows the repository template. It explains the changes and rationale, documents user-facing and maintainer impact, lists detailed validation commands and results, identifies inapplicable checks and platform limits, records CI and CodeRabbit status, and includes relevant notes.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 14 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Summary
Resolve 46
js/unused-local-variableCode Quality findings across 19 files, excluding findings covered by #2451, #2453, #2454, #2456, and #2457.Remove unused imports, locals and uncalled private helpers, including the private helpers/constants used only by a discarded resume-search map. Preserve module loading, initializer calls with possible effects, public reexports, active test assertions and SDK pending-prompt handling.
Finding IDs: 3086, 3085, 3083, 3084, 3081, 3082, 3080, 3078, 3079, 3077, 3076, 3075, 3074, 3061, 3062, 3063, 3060, 3059, 3035, 3036, 3034, 2999, 2997, 2998, 2996, 2994, 2995, 2968, 2966, 2967, 2965, 2964, 2950, 2942, 2941, 2927, 2928, 2925, 2926, 2924, 2923, 2922, 2921, 2912, 2908, 2906.
Impact
No intended user-facing behavior or presentation change. Removes dead bindings and unreachable private code that generated these quality findings. No dependencies, configuration or public interfaces changed.
Testing
1ead00536ab030d250a9cca509d4ddc54621dda0; committed diff matches the reviewed candidate.bun install --frozen-lockfile— passed.bun run check:static— passed (lint, any budget, smoke build, deadcode).bun run typecheck:fastandbun run typecheck:type-tests— passed.node bin/openclaude --versionandNODE_DISABLE_COMPILE_CACHE=1 node bin/openclaude --version— passed, 0.33.0.bun run test:conversation-arc— 1 passed;bun run test:context-efficiency— 4 passed.npm --prefix vscode-extension/openclaude-vscode run lint— passed.bun run --cwd vscode-extension/openclaude-vscode test— 51 passed. The sandbox run interfered with child-process output and timed out; the identical command passed with host process access, without source changes.git diff --check— passed.git fetch https://github.com/Twigpine/openclaude.git mainfollowed bybun run security:pr-scan -- --base FETCH_HEAD --head HEAD— passed on the committed candidate.bun run test src/commands/provider/provider.test.tsx src/components/LogSelector.resumeBranches.test.ts src/query.abortClassification.test.ts src/screens/REPL.queryLifecycle.test.ts src/services/api/openaiShim.test.ts src/services/api/openaiShim/requestExecutor.test.ts src/services/tools/toolExecution.test.ts src/utils/attachments.extractors.test.ts src/utils/attachments.nestedDirs.test.ts src/utils/attachments.performance.test.ts src/utils/contextPartitioning.test.ts src/utils/conversationArc.test.ts src/utils/messages/streaming.test.ts src/utils/providerProfile.test.ts tests/sdk/mcp-cleanup.test.ts tests/sdk/query-lifecycle.test.ts tests/sdk/query-methods.test.ts tests/sdk/sdk-v2-lifecycle.test.tsAn external AST/transpilation check verified identical emitted JavaScript for all 8 import-only files and preserved 455 non-import top-level statements across 8 test files (normalizing only the unused arc binding to its retained initialization call). Three removed private test helpers have no surviving references; active assertions remain.
Focused local validation follows the contributor contract for dead-code removal with no shared runtime behavior changes. No website/build configuration inputs changed, so web checks are inapplicable. Local platform: Linux with Node 26; native Windows and the full clean-runner/Node matrix are covered by CI. All CI workflows passed on the validated revision: PR Checks, CodeQL, Install hygiene, and VS Code Windows launcher. CodeRabbit approved with no requested changes; this PR remains a draft.
Notes
Provider chooser/profile, API shim/request executor, SDK lifecycle, tool execution, resume selection, message streaming and attachment paths were covered by existing tests. No live-provider behavior changed, and no live API call was needed. No visual change; screenshots are inapplicable. Quality findings should close after merge and the next analysis. No alert dismissals or earlier-batch changes are included.