Skip to content

chore: resolve next 40 unused-local-variable findings - #2453

Merged
jatmn merged 1 commit into
Twigpine:mainfrom
jatmn:fix/next-40-unused-locals
Oct 27, 2026
Merged

jatmn merged 1 commit into
Twigpine:mainfrom
jatmn:fix/next-40-unused-locals

Conversation

@jatmn

@jatmn jatmn commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix the next 40 open findings from the bottom of the unused-local-variable Code Quality list, excluding every finding covered by merged PR #2451. Selected from the managed findings API's default descending order on current main.

Remove 43 unused import bindings and the unreferenced ClaudeInChromePromptNotificationSchema, plus its two exclusively used imports (z and lazySchema). The lazy schema only created an unused closure; its factory was never called. Existing Chrome permission-mode synchronization and all hooks remain intact.

Managed Code Quality IDs: 83, 86, 87, 88, 89, 92, 95, 96, 97, 98, 99, 100, 104, 105, 106, 107, 109, 110, 111, 112, 113, 114, 115, 116, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 136, 138, 139.

Impact

  • User-facing impact: no change to runtime behavior, rendering, permissions, or public interfaces.
  • Developer/maintainer impact: resolves the selected 40 findings through bounded removals in 35 files. No files, tests, dependencies or configuration were added or deleted. PR chore: resolve bottom 40 unused-import quality findings #2451's fixes remain intact.

Testing

  • I followed Validation, including applicable lint/static/type checks and regression tests.
  • Affected surfaces: unused source/test imports and an unused lazy-schema allocation. Core gates and existing affected tests selected; no earlier PR validation reused.
  • Passed on reviewed commit f14e9b81f4e7b72158addb975bfbd7005ef55394, using Node 26.12.1 and Bun 1.4.4:
    • bun install --frozen-lockfile
    • bun run check:static — lint, any budget, CLI/SDK build/smoke, Knip
    • bun run typecheck:fast — 3,310 files
    • bun run typecheck:type-tests — 11 files
    • node bin/openclaude --version
    • NODE_DISABLE_COMPILE_CACHE=1 node bin/openclaude --version
    • git diff --check
    • git fetch https://github.com/Twigpine/openclaude.git main, then bun run security:pr-scan -- --base FETCH_HEAD --head HEAD
  • Focused command: bun run test src/hooks/usePromptsFromClaudeInChrome.test.ts src/hooks/useCanUseTool.permissionSession.test.tsx src/hooks/toolPermission/permissionSessionOwnership.test.ts src/services/compact/microCompact.test.ts src/components/agents/new-agent-creation/wizard-steps/wizardSteps.test.tsx src/hooks/useBackgroundTaskNavigation.interruptionTrace.test.tsx — 20 passed, 0 failed, 50 assertions across 6 files.
  • Verified all allowed import removals and unchanged remaining non-import ASTs/TypeScript emitted JavaScript against base 099cd505fe18585180c51e32f8b1c789e8b83b25, excluding only the removed unused schema declaration. Existing test assertions are unchanged.
  • Full unit suite not selected locally because these removals preserve shared runtime behavior; CI runs the full matrix. Website/extension checks are inapplicable. Existing non-failing lint warnings and Knip hints remain; no gate waivers or local blockers.
  • CI: all 25 completed checks passed, with 3 expected untouched-surface skips. Both CodeQL analyses and the code-scanning result passed. CodeRabbit approved exact commit f14e9b81f4e7b72158addb975bfbd7005ef55394 with no findings. The PR remains a draft for user/maintainer review.

Notes

  • Reviewed AGENTS.md and CONTRIBUTING.md.
  • Provider/model path tested: not applicable; provider behavior unchanged. Chrome permission-mode and permission-session tests pass.
  • Screenshots: not applicable; no rendered UI or terminal presentation changes.
  • Main-branch findings close after merge and a successful Code Quality rescan. No findings dismissed.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 099cd50 and f14e9b8.

Files selected for processing: 35
  • src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx
  • src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
  • src/components/permissions/PermissionDecisionDebugInfo.tsx
  • src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
  • src/components/permissions/rules/AddPermissionRules.tsx
  • src/components/permissions/rules/AddWorkspaceDirectory.tsx
  • src/components/permissions/rules/RecentDenialsTab.tsx
  • src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
  • src/components/permissions/rules/WorkspaceTab.tsx
  • src/components/shell/OutputLine.tsx
  • src/components/tasks/AsyncAgentDetailDialog.tsx
  • src/components/tasks/BackgroundTaskStatus.tsx
  • src/components/tasks/InProcessTeammateDetailDialog.tsx
  • src/components/wizard/WizardProvider.tsx
  • src/context/mailbox.tsx
  • src/context/stats.tsx
  • src/hooks/notifs/usePluginInstallationStatus.tsx
  • src/hooks/notifs/useRateLimitWarningNotification.tsx
  • src/hooks/notifs/useSettingsErrors.tsx
  • src/hooks/useCanUseTool.tsx
  • src/hooks/useCommandKeybindings.tsx
  • src/hooks/useMergedTools.ts
  • src/hooks/usePromptsFromClaudeInChrome.tsx
  • src/hooks/useTeleportResume.tsx
  • src/ink/components/Button.tsx
  • src/ink/components/TerminalFocusContext.tsx
  • src/keybindings/KeybindingContext.tsx
  • src/main.tsx
  • src/screens/Doctor.tsx
  • src/services/analytics/config.ts
  • src/services/compact/microCompact.test.ts
  • src/services/mcp/MCPConnectionManager.tsx
  • src/setup.ts
Files with no reviewable changes: 10
  • src/components/permissions/rules/AddPermissionRules.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx
  • src/services/compact/microCompact.test.ts
  • src/hooks/useMergedTools.ts
  • src/hooks/useCommandKeybindings.tsx
  • src/setup.ts
  • src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
  • src/main.tsx
  • src/services/analytics/config.ts
  • src/components/shell/OutputLine.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Recent review details
Context from checks skipped due to timeout: 2
  • GitHub Check: CodeRabbit
  • GitHub Check: CodeQL (javascript-typescript)
Additional context used
Code guidelines: 1
AGENTS.md — configured
Path-based instructions: 5
Review permission prompts, auto-allow logic, sandbox behavior, SDK permission schemas, shell/PowerShell execution, and background execution paths as security-sensitive.

CodeRabbit configuration file

Files:

  • src/components/permissions/rules/AddWorkspaceDirectory.tsx
  • src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx
  • src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
  • src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
  • src/components/permissions/rules/RecentDenialsTab.tsx
  • src/components/permissions/PermissionDecisionDebugInfo.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
  • src/components/permissions/rules/WorkspaceTab.tsx
Review skill/plugin/MCP behavior as a trust boundary.

CodeRabbit configuration file

Files:

  • src/services/mcp/MCPConnectionManager.tsx
Apply the OpenClaude maintainer review rubric from AGENTS.md.

CodeRabbit configuration file

Files:

  • src/hooks/notifs/usePluginInstallationStatus.tsx
  • src/screens/Doctor.tsx
  • src/components/permissions/rules/AddWorkspaceDirectory.tsx
  • src/components/tasks/BackgroundTaskStatus.tsx
  • src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx
  • src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
  • src/keybindings/KeybindingContext.tsx
  • src/components/wizard/WizardProvider.tsx
  • src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
  • src/components/permissions/rules/RecentDenialsTab.tsx
  • src/components/permissions/PermissionDecisionDebugInfo.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
  • src/components/tasks/InProcessTeammateDetailDialog.tsx
  • src/services/mcp/MCPConnectionManager.tsx
  • src/components/permissions/rules/WorkspaceTab.tsx
  • src/components/tasks/AsyncAgentDetailDialog.tsx
  • src/hooks/useTeleportResume.tsx
  • src/context/stats.tsx
  • src/context/mailbox.tsx
  • src/hooks/notifs/useRateLimitWarningNotification.tsx
  • src/hooks/useCanUseTool.tsx
  • src/ink/components/Button.tsx
  • src/hooks/usePromptsFromClaudeInChrome.tsx
  • src/hooks/notifs/useSettingsErrors.tsx
  • src/ink/components/TerminalFocusContext.tsx
Source excerpt: No hidden policy change: Verify that product, trust-model, routing-default, telemetry/network, and permission-policy changes are not hidden inside unrelated cleanup.

CodeRabbit inference engine (Custom checks)

Files:

  • src/hooks/notifs/usePluginInstallationStatus.tsx
  • src/screens/Doctor.tsx
  • src/components/permissions/rules/AddWorkspaceDirectory.tsx
  • src/components/tasks/BackgroundTaskStatus.tsx
  • src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx
  • src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
  • src/keybindings/KeybindingContext.tsx
  • src/components/wizard/WizardProvider.tsx
  • src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
  • src/components/permissions/rules/RecentDenialsTab.tsx
  • src/components/permissions/PermissionDecisionDebugInfo.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
  • src/components/tasks/InProcessTeammateDetailDialog.tsx
  • src/services/mcp/MCPConnectionManager.tsx
  • src/components/permissions/rules/WorkspaceTab.tsx
  • src/components/tasks/AsyncAgentDetailDialog.tsx
  • src/hooks/useTeleportResume.tsx
  • src/context/stats.tsx
  • src/context/mailbox.tsx
  • src/hooks/notifs/useRateLimitWarningNotification.tsx
  • src/hooks/useCanUseTool.tsx
  • src/ink/components/Button.tsx
  • src/hooks/usePromptsFromClaudeInChrome.tsx
  • src/hooks/notifs/useSettingsErrors.tsx
  • src/ink/components/TerminalFocusContext.tsx
Source excerpt: TypeScript with strict mode and ESM imports.

CodeRabbit inference engine (AGENTS.md)

Files:

  • src/hooks/notifs/usePluginInstallationStatus.tsx
  • src/screens/Doctor.tsx
  • src/components/permissions/rules/AddWorkspaceDirectory.tsx
  • src/components/tasks/BackgroundTaskStatus.tsx
  • src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx
  • src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
  • src/keybindings/KeybindingContext.tsx
  • src/components/wizard/WizardProvider.tsx
  • src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
  • src/components/permissions/rules/RecentDenialsTab.tsx
  • src/components/permissions/PermissionDecisionDebugInfo.tsx
  • src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
  • src/components/tasks/InProcessTeammateDetailDialog.tsx
  • src/services/mcp/MCPConnectionManager.tsx
  • src/components/permissions/rules/WorkspaceTab.tsx
  • src/components/tasks/AsyncAgentDetailDialog.tsx
  • src/hooks/useTeleportResume.tsx
  • src/context/stats.tsx
  • src/context/mailbox.tsx
  • src/hooks/notifs/useRateLimitWarningNotification.tsx
  • src/hooks/useCanUseTool.tsx
  • src/ink/components/Button.tsx
  • src/hooks/usePromptsFromClaudeInChrome.tsx
  • src/hooks/notifs/useSettingsErrors.tsx
  • src/ink/components/TerminalFocusContext.tsx
Additional comments: 25
src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx: 1

3-3: LGTM!

src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx: 1

3-3: LGTM!

src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx: 1

4-4: LGTM!

src/components/permissions/PermissionDecisionDebugInfo.tsx: 1

5-5: LGTM!

src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx: 1

3-3: LGTM!

src/components/permissions/rules/AddWorkspaceDirectory.tsx: 1

4-4: LGTM!

src/components/permissions/rules/RecentDenialsTab.tsx: 1

3-3: LGTM!

src/components/permissions/rules/WorkspaceTab.tsx: 1

4-4: LGTM!

src/components/tasks/AsyncAgentDetailDialog.tsx: 1

2-2: LGTM!

src/components/tasks/BackgroundTaskStatus.tsx: 1

4-4: LGTM!

src/components/tasks/InProcessTeammateDetailDialog.tsx: 1

2-2: LGTM!

src/components/wizard/WizardProvider.tsx: 1

2-2: LGTM!

src/context/mailbox.tsx: 1

2-2: LGTM!

src/context/stats.tsx: 1

2-2: LGTM!

src/hooks/notifs/usePluginInstallationStatus.tsx: 1

3-3: LGTM!

src/hooks/notifs/useRateLimitWarningNotification.tsx: 1

3-3: LGTM!

src/hooks/notifs/useSettingsErrors.tsx: 1

2-2: LGTM!

src/hooks/useCanUseTool.tsx: 1

5-5: LGTM!

src/hooks/usePromptsFromClaudeInChrome.tsx: 1

7-7: LGTM!

src/hooks/useTeleportResume.tsx: 1

2-2: LGTM!

src/ink/components/Button.tsx: 1

2-2: LGTM!

src/ink/components/TerminalFocusContext.tsx: 1

2-2: LGTM!

src/keybindings/KeybindingContext.tsx: 1

2-2: LGTM!

src/screens/Doctor.tsx: 1

4-4: LGTM!

src/services/mcp/MCPConnectionManager.tsx: 1

2-2: LGTM!

Walkthrough

The pull request removes unused React hooks and other imports from components, hooks, contexts, and service files. The summaries report no runtime behavior changes.

Changes: Unused import cleanup

Layer / File(s) Summary
Remove unused imports
src/components/permissions/*, src/components/shell/OutputLine.tsx, src/components/tasks/*, src/components/wizard/WizardProvider.tsx, src/context/*, src/hooks/*, src/ink/components/*, src/keybindings/KeybindingContext.tsx, src/main.tsx, src/screens/Doctor.tsx, src/services/analytics/config.ts, src/services/compact/microCompact.test.ts, src/services/mcp/MCPConnectionManager.tsx, src/setup.ts
Removed unused React hooks and other imports across these files. The summaries report no runtime behavior changes.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to f14e9

The cleanup is mergeable with no identified runtime or operational risk.

Pre-merge checks: Passed 6 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Risk Surface Disclosed Warning The PR changes permission components, background-task UI, MCP/Chrome hooks, plugin notifications, and startup files. The description calls out permissions and provider behavior, and says there are no … Update the PR review description with a risk section. List permissions, background execution, MCP/plugins and Chrome outbound behavior, and startup/config-home behavior. State for each that the import/schema removals do not change behavior …
Passed Passed checks: 6 passed
Check name Status Explanation
Title check Passed The title is concise, scoped, and accurately describes the removal of the next 40 unused-local-variable findings addressed by the diff.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
No Hidden Policy Change Passed PASS. The reviewed diff contains import-binding removals, one dead Chrome notification schema removal, and a test-only import/comment removal. No permission decisions, trust checks, routing defaults, …
Description check Passed The pull request description follows the repository template. It explains the change and reason, documents user-facing and maintainer impact, lists validation commands and results, identifies unrun or…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. 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 0 functions across 25 files.

Full details: No Hidden Policy Change

Explanation

PASS. The reviewed diff contains import-binding removals, one dead Chrome notification schema removal, and a test-only import/comment removal. No permission decisions, trust checks, routing defaults, product behavior, or network/telemetry logic changed. The Chrome permission-mode synchronization remains unchanged, and analytics policy functions remain unchanged.

Full details: Description check

Explanation

The pull request description follows the repository template. It explains the change and reason, documents user-facing and maintainer impact, lists validation commands and results, identifies unrun or inapplicable checks, reports CI and CodeRabbit status, and includes relevant notes.

Full details: Risk Surface Disclosed

Explanation

The PR changes permission components, background-task UI, MCP/Chrome hooks, plugin notifications, and startup files. The description calls out permissions and provider behavior, and says there are no runtime changes or local blockers. It does not explicitly disclose the background execution, MCP/plugin, startup/config-home, or outbound MCP/Chrome risk surfaces and their blocker status.

Resolution

Update the PR review description with a risk section. List permissions, background execution, MCP/plugins and Chrome outbound behavior, and startup/config-home behavior. State for each that the import/schema removals do not change behavior and introduce no blocker.

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.

@jatmn jatmn self-assigned this Oct 27, 2026
@jatmn
jatmn marked this pull request as ready for review October 27, 2026 16:38
@jatmn
jatmn merged commit f55f4df into Twigpine:main Oct 27, 2026
28 checks passed
@jatmn
jatmn deleted the fix/next-40-unused-locals branch October 27, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant