refactor(relay): collapse the duplicated FrameDecoder into one shared module - #12078
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe relay frame decoder now extends the shared decoder and forwards callbacks and options to it. Relay-specific constants, contracts, and buffer exports now reference shared modules. Relay protocol runtime imports and type exports now use the shared decoder module. Missing error handlers continue to write errors to stderr. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
b4108c1 to
ddae63a
Compare
Greptile SummaryThis PR collapses two nearly identical 264-line
Confidence Score: 5/5Safe to merge — pure refactor with no logic changes on either the relay or SSH decode path. All 264 lines of decoding logic are unchanged; only the file location and import paths moved. The one behavioral difference between the two sides (relay writes to stderr on missing handler, SSH stays silent) is correctly preserved through the thin subclass. The relay bundle gains no new runtime dependencies, and the re-exports in both files keep the public API identical for existing callers. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/relay-frame-decoder.ts | Former SSH-side implementation moved to shared; only import paths changed (relative → same-directory). Logic, constants, and types are identical to the original. |
| src/relay/relay-frame-decoder.ts | Reduced from 264 lines to a 32-line thin subclass; extends the shared decoder and supplies the relay’s stderr error default. All constants and types are re-exported to preserve the existing public API. |
| src/main/ssh/relay-protocol.ts | Import paths updated from the deleted local relay-frame-decoder to the new shared location; no logic changes. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SharedFrameDecoder {
<<src/shared/relay-frame-decoder.ts>>
-buffer: RelayFrameBuffer
-onError: ((err: Error) => void) | null
-onFrame: (frame: DecodedFrame) => void
+constructor(onFrame, onError?, options?)
+feed(chunk: Buffer | Uint8Array): void
+reset(): void
+drain(): Buffer
-drainTurn(): void
-scheduleContinuation(): void
}
class RelayFrameDecoder {
<<src/relay/relay-frame-decoder.ts>>
+constructor(onFrame, onError?, options?)
}
class SshRelayProtocol {
<<src/main/ssh/relay-protocol.ts>>
}
SharedFrameDecoder <|-- RelayFrameDecoder : extends (adds stderr default)
SshRelayProtocol ..> SharedFrameDecoder : imports & re-exports
Reviews (2): Last reviewed commit: "refactor(relay): collapse the duplicated..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
config/knip.json (1)
39-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winFail the audit on stale configuration hints.
The explicit
entryandprojectglobs can become stale after a path rename. Knip reports no-match and redundant patterns as warnings by default. WithouttreatConfigHintsAsErrors, the audit can succeed after its analysis scope has narrowed. (knip.dev)Proposed fix
- "includeEntryExports": false + "includeEntryExports": false, + "treatConfigHintsAsErrors": truepackage.json (1)
19-19: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin one Knip patch across the schema and audit command.
Both files use the moving
@5tag.pnpm dlxfetches the package from the registry at invocation, so the audit implementation and schema can drift. Pin one reviewed patch in the lockfile and use it in both locations. (pnpm.io)
package.json#L19-L19: replacepnpm dlx knip@5with a local exact-versionknipinvocation.config/knip.json#L2-L2: point$schemaat the same exact Knip patch.src/main/ssh/relay-protocol.ts (1)
14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAlign the type contract imports to reduce drift risk.
relay-protocol.tsimportsDecodedFrameandFrameDecoderOptionsfrom../../shared/relay-frame-decoder, whilesrc/relay/relay-frame-decoder.tsimports them from../shared/relay-frame-decoder-contract. Consolidate the contract imports, checkingsrc/shared/relay-frame-decoder.tsat lines 6 and 17-20 to see whether it re-exports the shared contract types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e4679e43-1b78-4bbf-9489-7803da119470
📒 Files selected for processing (148)
config/knip.jsonpackage.jsonsrc/cli/runtime/environments.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-protocol.tssrc/main/claude-usage/scanner.tssrc/main/codex-usage/scanner.tssrc/main/computer/macos-native-provider-paths.tssrc/main/daemon/terminal-private-mode-tracker.tssrc/main/emulator/android/android-input-mapping.tssrc/main/emulator/emulator-types.tssrc/main/git/git-username.tssrc/main/git/repo.tssrc/main/github/github-api-repository.tssrc/main/github/github-enterprise-repository.tssrc/main/github/project-view.tssrc/main/github/project-view/internals.tssrc/main/gitlab/gl-utils.tssrc/main/ipc/feedback-image-attachments.tssrc/main/ipc/parcel-watcher-host-subscriptions.tssrc/main/ipc/parcel-watcher-process.tssrc/main/ipc/runtime-environment-request-connections.tssrc/main/ipc/worktree-change-invalidators.tssrc/main/observability/index.tssrc/main/observability/instrumentation.tssrc/main/observability/redactor.tssrc/main/pi/prefill-extension-source.tssrc/main/pi/titlebar-extension-service.tssrc/main/plugins/plugin-enablement.tssrc/main/providers/pty-process-list-admission.tssrc/main/providers/types.tssrc/main/rate-limits/grok-auth.tssrc/main/runtime/orca-runtime-emulator.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/groups.tssrc/main/runtime/rpc/schemas.tssrc/main/shell-ready-marker-scanner.tssrc/main/ssh/relay-protocol.tssrc/main/ssh/sftp-namespace-resolution.tssrc/main/ssh/sftp-upload.tssrc/main/ssh/ssh-pty-consumer-session.tssrc/main/ssh/ssh-relay-session-managed-hooks.test.tssrc/main/ssh/ssh-relay-session.test.tssrc/main/system-fonts.tssrc/main/telemetry/client.tssrc/relay/fs-handler-file-read.tssrc/relay/relay-frame-decoder.tssrc/renderer/src/components/automations/automation-page-parts.tsxsrc/renderer/src/components/browser-pane/browser-automation-visibility.tssrc/renderer/src/components/browser-pane/browser-page-zoom.tssrc/renderer/src/components/dashboard/useDashboardData.tssrc/renderer/src/components/editor/NotesSendMenu.test.tsxsrc/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsxsrc/renderer/src/components/editor/markdown-round-trip.tssrc/renderer/src/components/emulator-pane/emulator-keyboard-paste.tssrc/renderer/src/components/emulator-pane/emulator-pane-types.tssrc/renderer/src/components/github-project/column-widths.tssrc/renderer/src/components/github/github-issue-comment-helpers.tssrc/renderer/src/components/linear-issue-workspace-text.tssrc/renderer/src/components/native-chat/native-chat-composer-state.tssrc/renderer/src/components/onboarding/use-onboarding-flow.tssrc/renderer/src/components/repo/repo-icon.tsxsrc/renderer/src/components/right-sidebar/CreateHostedReviewComposer.tsxsrc/renderer/src/components/right-sidebar/commit-failure-dialog-state.tssrc/renderer/src/components/right-sidebar/file-explorer-operation-owner.tssrc/renderer/src/components/right-sidebar/file-explorer-runtime-owner-boundary.test.tssrc/renderer/src/components/right-sidebar/push-failure-summary.tssrc/renderer/src/components/right-sidebar/source-control-active-open-file-keys.tssrc/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.test.tssrc/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.tssrc/renderer/src/components/right-sidebar/source-control-ai-push-failure-launch.tssrc/renderer/src/components/right-sidebar/source-control-create-pr-intent-state.tssrc/renderer/src/components/right-sidebar/source-control-primary-action-types.tssrc/renderer/src/components/settings/SettingsConstants.tssrc/renderer/src/components/settings/general-search.tssrc/renderer/src/components/settings/terminal-windows-search.tssrc/renderer/src/components/sidebar/WorktreeCardHelpers.tsxsrc/renderer/src/components/sidebar/WorktreeCardPorts.tsxsrc/renderer/src/components/sidebar/create-project-defaults.tssrc/renderer/src/components/sidebar/project-header-drop.tssrc/renderer/src/components/sidebar/sidebar-host-options.tssrc/renderer/src/components/sidebar/sidebar-nav-controls.tsxsrc/renderer/src/components/sidebar/workspace-kanban-card-drag-preview-dom.tssrc/renderer/src/components/tab-bar/shell-icons.tsxsrc/renderer/src/components/tab-bar/tab-create-entry-path-validation.tssrc/renderer/src/components/tab-group/tab-drag-context.tsxsrc/renderer/src/components/terminal-pane/pty-delivery-interest.tssrc/renderer/src/components/terminal-pane/pty-pre-handler-buffer.tssrc/renderer/src/components/terminal-pane/terminal-hidden-delivery-gate.tssrc/renderer/src/components/terminal/terminal-tab-actions.tssrc/renderer/src/constants/terminal.tssrc/renderer/src/hooks/useAutomationDispatchEvents.test.tssrc/renderer/src/hooks/useIssueMetadata.tssrc/renderer/src/hooks/useShortcutLabel.tssrc/renderer/src/lib/active-agent-note-send.tssrc/renderer/src/lib/active-agent-note-target.tssrc/renderer/src/lib/agent-hibernation-coordinator.tssrc/renderer/src/lib/agent-paste-draft.tssrc/renderer/src/lib/crash-diagnostics.test.tssrc/renderer/src/lib/crash-diagnostics.tssrc/renderer/src/lib/ensure-simulator-tab.tssrc/renderer/src/lib/keyboard-layout/input-source-id.tssrc/renderer/src/lib/keyboard-layout/option-as-alt-probe.tssrc/renderer/src/lib/open-mobile-emulator-tab.test.tssrc/renderer/src/lib/repo-slug-index.tssrc/renderer/src/lib/setup-script-status.tssrc/renderer/src/lib/workspace-port-actions.tssrc/renderer/src/store/slices/runtime-detected-agents.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog.tssrc/shared/commit-message-generation.tssrc/shared/custom-pet-media-limits.tssrc/shared/daemon-audit-eligibility.tssrc/shared/daemon-lifecycle-telemetry.tssrc/shared/ephemeral-vm-recipes.tssrc/shared/ephemeral-vm-runtimes.tssrc/shared/folder-workspaces.tssrc/shared/hermes-run-output-limits.tssrc/shared/hermes-run-ref-retention.tssrc/shared/hosted-review.tssrc/shared/html-to-pdf-memory-limit.tssrc/shared/left-sidebar-appearance.tssrc/shared/linear-agent-access.tssrc/shared/linux-proc-port-scan-limits.tssrc/shared/native-file-drop.tssrc/shared/persisted-state-file-bounds.tssrc/shared/pr-refresh-memory-limits.tssrc/shared/pty-source-credit-contract.tssrc/shared/relay-frame-decoder.tssrc/shared/relay-json-admission.tssrc/shared/remote-runtime-memory-limits.tssrc/shared/remote-runtime-shared-control-state.tssrc/shared/remote-workspace-types.tssrc/shared/runtime-bootstrap.tssrc/shared/runtime-environments.tssrc/shared/runtime-types.tssrc/shared/serve-update-handoff.tssrc/shared/source-control-create-review-intent.tssrc/shared/ssh-retained-payload-admission.tssrc/shared/task-source-context.tssrc/shared/telemetry-events.tssrc/shared/terminal-custom-themes.tssrc/shared/terminal-scrollback-policy.tssrc/shared/terminal-size-limits.tssrc/shared/terminal-title-display.tssrc/shared/terminal-title-status.tssrc/shared/work-items.tssrc/shared/workspace-scope.tssrc/shared/wsl-hook-relay-contract.ts
💤 Files with no reviewable changes (123)
- src/main/gitlab/gl-utils.ts
- src/renderer/src/components/settings/SettingsConstants.ts
- src/renderer/src/lib/keyboard-layout/input-source-id.ts
- src/shared/workspace-scope.ts
- src/renderer/src/components/tab-group/tab-drag-context.tsx
- src/shared/html-to-pdf-memory-limit.ts
- src/renderer/src/lib/agent-hibernation-coordinator.ts
- src/renderer/src/components/sidebar/project-header-drop.ts
- src/main/ipc/worktree-change-invalidators.ts
- src/renderer/src/components/terminal-pane/terminal-hidden-delivery-gate.ts
- src/shared/relay-json-admission.ts
- src/main/ipc/feedback-image-attachments.ts
- src/main/codex-usage/scanner.ts
- src/cli/runtime/environments.ts
- src/main/telemetry/client.ts
- src/main/github/project-view/internals.ts
- src/renderer/src/lib/active-agent-note-send.ts
- src/main/observability/index.ts
- src/renderer/src/lib/workspace-port-actions.ts
- src/renderer/src/lib/crash-diagnostics.ts
- src/shared/pr-refresh-memory-limits.ts
- src/renderer/src/constants/terminal.ts
- src/main/github/github-api-repository.ts
- src/renderer/src/components/settings/general-search.ts
- src/main/git/git-username.ts
- src/renderer/src/components/right-sidebar/commit-failure-dialog-state.ts
- src/main/ssh/sftp-upload.ts
- src/shared/terminal-custom-themes.ts
- src/renderer/src/lib/keyboard-layout/option-as-alt-probe.ts
- src/main/runtime/rpc/schemas.ts
- src/renderer/src/components/sidebar/create-project-defaults.ts
- src/main/runtime/orchestration/groups.ts
- src/renderer/src/components/github-project/column-widths.ts
- src/renderer/src/components/settings/terminal-windows-search.ts
- src/renderer/src/components/right-sidebar/source-control-active-open-file-keys.ts
- src/renderer/src/components/native-chat/native-chat-composer-state.ts
- src/shared/terminal-title-display.ts
- src/renderer/src/components/right-sidebar/file-explorer-operation-owner.ts
- src/shared/ssh-retained-payload-admission.ts
- src/renderer/src/components/repo/repo-icon.tsx
- src/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.ts
- src/main/daemon/terminal-private-mode-tracker.ts
- src/main/rate-limits/grok-auth.ts
- src/renderer/src/components/terminal-pane/pty-pre-handler-buffer.ts
- src/main/pi/titlebar-extension-service.ts
- src/shared/remote-runtime-memory-limits.ts
- src/shared/pty-source-credit-contract.ts
- src/shared/remote-runtime-shared-control-state.ts
- src/shared/agent-session-host-authority.ts
- src/renderer/src/components/terminal-pane/pty-delivery-interest.ts
- src/shared/linux-proc-port-scan-limits.ts
- src/renderer/src/components/emulator-pane/emulator-pane-types.ts
- src/shared/agent-session-option-catalog.ts
- src/main/ipc/parcel-watcher-host-subscriptions.ts
- src/shared/wsl-hook-relay-contract.ts
- src/main/emulator/emulator-types.ts
- src/main/github/github-enterprise-repository.ts
- src/main/ssh/ssh-pty-consumer-session.ts
- src/renderer/src/store/slices/runtime-detected-agents.ts
- src/main/ssh/ssh-relay-session.test.ts
- src/shared/remote-workspace-types.ts
- src/shared/terminal-title-status.ts
- src/main/shell-ready-marker-scanner.ts
- src/renderer/src/components/browser-pane/browser-page-zoom.ts
- src/main/plugins/plugin-enablement.ts
- src/shared/commit-message-generation.ts
- src/main/observability/instrumentation.ts
- src/main/providers/pty-process-list-admission.ts
- src/renderer/src/components/right-sidebar/source-control-ai-push-failure-launch.ts
- src/main/runtime/orca-runtime-emulator.ts
- src/renderer/src/components/right-sidebar/CreateHostedReviewComposer.tsx
- src/shared/runtime-environments.ts
- src/shared/ephemeral-vm-runtimes.ts
- src/shared/custom-pet-media-limits.ts
- src/shared/terminal-size-limits.ts
- src/main/observability/redactor.ts
- src/shared/left-sidebar-appearance.ts
- src/main/ssh/ssh-relay-session-managed-hooks.test.ts
- src/renderer/src/components/github/github-issue-comment-helpers.ts
- src/shared/linear-agent-access.ts
- src/renderer/src/components/sidebar/workspace-kanban-card-drag-preview-dom.ts
- src/renderer/src/hooks/useShortcutLabel.ts
- src/renderer/src/components/sidebar/sidebar-host-options.ts
- src/renderer/src/components/sidebar/sidebar-nav-controls.tsx
- src/shared/runtime-types.ts
- src/shared/native-file-drop.ts
- src/shared/hosted-review.ts
- src/renderer/src/components/browser-pane/browser-automation-visibility.ts
- src/main/pi/prefill-extension-source.ts
- src/renderer/src/components/tab-bar/tab-create-entry-path-validation.ts
- src/renderer/src/components/terminal/terminal-tab-actions.ts
- src/shared/daemon-lifecycle-telemetry.ts
- src/main/system-fonts.ts
- src/shared/hermes-run-ref-retention.ts
- src/renderer/src/components/onboarding/use-onboarding-flow.ts
- src/renderer/src/components/tab-bar/shell-icons.tsx
- src/main/computer/macos-native-provider-paths.ts
- src/renderer/src/components/emulator-pane/emulator-keyboard-paste.ts
- src/shared/task-source-context.ts
- src/renderer/src/lib/ensure-simulator-tab.ts
- src/main/git/repo.ts
- src/renderer/src/hooks/useIssueMetadata.ts
- src/renderer/src/components/automations/automation-page-parts.tsx
- src/renderer/src/lib/agent-paste-draft.ts
- src/renderer/src/components/linear-issue-workspace-text.ts
- src/shared/runtime-bootstrap.ts
- src/renderer/src/lib/repo-slug-index.ts
- src/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.test.ts
- src/shared/hermes-run-output-limits.ts
- src/shared/source-control-create-review-intent.ts
- src/main/emulator/android/android-input-mapping.ts
- src/renderer/src/components/sidebar/WorktreeCardPorts.tsx
- src/shared/telemetry-events.ts
- src/renderer/src/lib/active-agent-note-target.ts
- src/main/claude-usage/scanner.ts
- src/renderer/src/components/right-sidebar/push-failure-summary.ts
- src/renderer/src/components/editor/markdown-round-trip.ts
- src/shared/terminal-scrollback-policy.ts
- src/main/ipc/runtime-environment-request-connections.ts
- src/shared/daemon-audit-eligibility.ts
- src/renderer/src/components/right-sidebar/source-control-primary-action-types.ts
- src/main/ipc/parcel-watcher-process.ts
- src/shared/serve-update-handoff.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 2
🧹 Nitpick comments (3)
config/knip.json (1)
39-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winFail the audit on stale configuration hints.
The explicit
entryandprojectglobs can become stale after a path rename. Knip reports no-match and redundant patterns as warnings by default. WithouttreatConfigHintsAsErrors, the audit can succeed after its analysis scope has narrowed. (knip.dev)Proposed fix
- "includeEntryExports": false + "includeEntryExports": false, + "treatConfigHintsAsErrors": truepackage.json (1)
19-19: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin one Knip patch across the schema and audit command.
Both files use the moving
@5tag.pnpm dlxfetches the package from the registry at invocation, so the audit implementation and schema can drift. Pin one reviewed patch in the lockfile and use it in both locations. (pnpm.io)
package.json#L19-L19: replacepnpm dlx knip@5with a local exact-versionknipinvocation.config/knip.json#L2-L2: point$schemaat the same exact Knip patch.src/main/ssh/relay-protocol.ts (1)
14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAlign the type contract imports to reduce drift risk.
relay-protocol.tsimportsDecodedFrameandFrameDecoderOptionsfrom../../shared/relay-frame-decoder, whilesrc/relay/relay-frame-decoder.tsimports them from../shared/relay-frame-decoder-contract. Consolidate the contract imports, checkingsrc/shared/relay-frame-decoder.tsat lines 6 and 17-20 to see whether it re-exports the shared contract types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e4679e43-1b78-4bbf-9489-7803da119470
📒 Files selected for processing (148)
config/knip.jsonpackage.jsonsrc/cli/runtime/environments.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-protocol.tssrc/main/claude-usage/scanner.tssrc/main/codex-usage/scanner.tssrc/main/computer/macos-native-provider-paths.tssrc/main/daemon/terminal-private-mode-tracker.tssrc/main/emulator/android/android-input-mapping.tssrc/main/emulator/emulator-types.tssrc/main/git/git-username.tssrc/main/git/repo.tssrc/main/github/github-api-repository.tssrc/main/github/github-enterprise-repository.tssrc/main/github/project-view.tssrc/main/github/project-view/internals.tssrc/main/gitlab/gl-utils.tssrc/main/ipc/feedback-image-attachments.tssrc/main/ipc/parcel-watcher-host-subscriptions.tssrc/main/ipc/parcel-watcher-process.tssrc/main/ipc/runtime-environment-request-connections.tssrc/main/ipc/worktree-change-invalidators.tssrc/main/observability/index.tssrc/main/observability/instrumentation.tssrc/main/observability/redactor.tssrc/main/pi/prefill-extension-source.tssrc/main/pi/titlebar-extension-service.tssrc/main/plugins/plugin-enablement.tssrc/main/providers/pty-process-list-admission.tssrc/main/providers/types.tssrc/main/rate-limits/grok-auth.tssrc/main/runtime/orca-runtime-emulator.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/groups.tssrc/main/runtime/rpc/schemas.tssrc/main/shell-ready-marker-scanner.tssrc/main/ssh/relay-protocol.tssrc/main/ssh/sftp-namespace-resolution.tssrc/main/ssh/sftp-upload.tssrc/main/ssh/ssh-pty-consumer-session.tssrc/main/ssh/ssh-relay-session-managed-hooks.test.tssrc/main/ssh/ssh-relay-session.test.tssrc/main/system-fonts.tssrc/main/telemetry/client.tssrc/relay/fs-handler-file-read.tssrc/relay/relay-frame-decoder.tssrc/renderer/src/components/automations/automation-page-parts.tsxsrc/renderer/src/components/browser-pane/browser-automation-visibility.tssrc/renderer/src/components/browser-pane/browser-page-zoom.tssrc/renderer/src/components/dashboard/useDashboardData.tssrc/renderer/src/components/editor/NotesSendMenu.test.tsxsrc/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsxsrc/renderer/src/components/editor/markdown-round-trip.tssrc/renderer/src/components/emulator-pane/emulator-keyboard-paste.tssrc/renderer/src/components/emulator-pane/emulator-pane-types.tssrc/renderer/src/components/github-project/column-widths.tssrc/renderer/src/components/github/github-issue-comment-helpers.tssrc/renderer/src/components/linear-issue-workspace-text.tssrc/renderer/src/components/native-chat/native-chat-composer-state.tssrc/renderer/src/components/onboarding/use-onboarding-flow.tssrc/renderer/src/components/repo/repo-icon.tsxsrc/renderer/src/components/right-sidebar/CreateHostedReviewComposer.tsxsrc/renderer/src/components/right-sidebar/commit-failure-dialog-state.tssrc/renderer/src/components/right-sidebar/file-explorer-operation-owner.tssrc/renderer/src/components/right-sidebar/file-explorer-runtime-owner-boundary.test.tssrc/renderer/src/components/right-sidebar/push-failure-summary.tssrc/renderer/src/components/right-sidebar/source-control-active-open-file-keys.tssrc/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.test.tssrc/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.tssrc/renderer/src/components/right-sidebar/source-control-ai-push-failure-launch.tssrc/renderer/src/components/right-sidebar/source-control-create-pr-intent-state.tssrc/renderer/src/components/right-sidebar/source-control-primary-action-types.tssrc/renderer/src/components/settings/SettingsConstants.tssrc/renderer/src/components/settings/general-search.tssrc/renderer/src/components/settings/terminal-windows-search.tssrc/renderer/src/components/sidebar/WorktreeCardHelpers.tsxsrc/renderer/src/components/sidebar/WorktreeCardPorts.tsxsrc/renderer/src/components/sidebar/create-project-defaults.tssrc/renderer/src/components/sidebar/project-header-drop.tssrc/renderer/src/components/sidebar/sidebar-host-options.tssrc/renderer/src/components/sidebar/sidebar-nav-controls.tsxsrc/renderer/src/components/sidebar/workspace-kanban-card-drag-preview-dom.tssrc/renderer/src/components/tab-bar/shell-icons.tsxsrc/renderer/src/components/tab-bar/tab-create-entry-path-validation.tssrc/renderer/src/components/tab-group/tab-drag-context.tsxsrc/renderer/src/components/terminal-pane/pty-delivery-interest.tssrc/renderer/src/components/terminal-pane/pty-pre-handler-buffer.tssrc/renderer/src/components/terminal-pane/terminal-hidden-delivery-gate.tssrc/renderer/src/components/terminal/terminal-tab-actions.tssrc/renderer/src/constants/terminal.tssrc/renderer/src/hooks/useAutomationDispatchEvents.test.tssrc/renderer/src/hooks/useIssueMetadata.tssrc/renderer/src/hooks/useShortcutLabel.tssrc/renderer/src/lib/active-agent-note-send.tssrc/renderer/src/lib/active-agent-note-target.tssrc/renderer/src/lib/agent-hibernation-coordinator.tssrc/renderer/src/lib/agent-paste-draft.tssrc/renderer/src/lib/crash-diagnostics.test.tssrc/renderer/src/lib/crash-diagnostics.tssrc/renderer/src/lib/ensure-simulator-tab.tssrc/renderer/src/lib/keyboard-layout/input-source-id.tssrc/renderer/src/lib/keyboard-layout/option-as-alt-probe.tssrc/renderer/src/lib/open-mobile-emulator-tab.test.tssrc/renderer/src/lib/repo-slug-index.tssrc/renderer/src/lib/setup-script-status.tssrc/renderer/src/lib/workspace-port-actions.tssrc/renderer/src/store/slices/runtime-detected-agents.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog.tssrc/shared/commit-message-generation.tssrc/shared/custom-pet-media-limits.tssrc/shared/daemon-audit-eligibility.tssrc/shared/daemon-lifecycle-telemetry.tssrc/shared/ephemeral-vm-recipes.tssrc/shared/ephemeral-vm-runtimes.tssrc/shared/folder-workspaces.tssrc/shared/hermes-run-output-limits.tssrc/shared/hermes-run-ref-retention.tssrc/shared/hosted-review.tssrc/shared/html-to-pdf-memory-limit.tssrc/shared/left-sidebar-appearance.tssrc/shared/linear-agent-access.tssrc/shared/linux-proc-port-scan-limits.tssrc/shared/native-file-drop.tssrc/shared/persisted-state-file-bounds.tssrc/shared/pr-refresh-memory-limits.tssrc/shared/pty-source-credit-contract.tssrc/shared/relay-frame-decoder.tssrc/shared/relay-json-admission.tssrc/shared/remote-runtime-memory-limits.tssrc/shared/remote-runtime-shared-control-state.tssrc/shared/remote-workspace-types.tssrc/shared/runtime-bootstrap.tssrc/shared/runtime-environments.tssrc/shared/runtime-types.tssrc/shared/serve-update-handoff.tssrc/shared/source-control-create-review-intent.tssrc/shared/ssh-retained-payload-admission.tssrc/shared/task-source-context.tssrc/shared/telemetry-events.tssrc/shared/terminal-custom-themes.tssrc/shared/terminal-scrollback-policy.tssrc/shared/terminal-size-limits.tssrc/shared/terminal-title-display.tssrc/shared/terminal-title-status.tssrc/shared/work-items.tssrc/shared/workspace-scope.tssrc/shared/wsl-hook-relay-contract.ts
💤 Files with no reviewable changes (123)
- src/main/gitlab/gl-utils.ts
- src/renderer/src/components/settings/SettingsConstants.ts
- src/renderer/src/lib/keyboard-layout/input-source-id.ts
- src/shared/workspace-scope.ts
- src/renderer/src/components/tab-group/tab-drag-context.tsx
- src/shared/html-to-pdf-memory-limit.ts
- src/renderer/src/lib/agent-hibernation-coordinator.ts
- src/renderer/src/components/sidebar/project-header-drop.ts
- src/main/ipc/worktree-change-invalidators.ts
- src/renderer/src/components/terminal-pane/terminal-hidden-delivery-gate.ts
- src/shared/relay-json-admission.ts
- src/main/ipc/feedback-image-attachments.ts
- src/main/codex-usage/scanner.ts
- src/cli/runtime/environments.ts
- src/main/telemetry/client.ts
- src/main/github/project-view/internals.ts
- src/renderer/src/lib/active-agent-note-send.ts
- src/main/observability/index.ts
- src/renderer/src/lib/workspace-port-actions.ts
- src/renderer/src/lib/crash-diagnostics.ts
- src/shared/pr-refresh-memory-limits.ts
- src/renderer/src/constants/terminal.ts
- src/main/github/github-api-repository.ts
- src/renderer/src/components/settings/general-search.ts
- src/main/git/git-username.ts
- src/renderer/src/components/right-sidebar/commit-failure-dialog-state.ts
- src/main/ssh/sftp-upload.ts
- src/shared/terminal-custom-themes.ts
- src/renderer/src/lib/keyboard-layout/option-as-alt-probe.ts
- src/main/runtime/rpc/schemas.ts
- src/renderer/src/components/sidebar/create-project-defaults.ts
- src/main/runtime/orchestration/groups.ts
- src/renderer/src/components/github-project/column-widths.ts
- src/renderer/src/components/settings/terminal-windows-search.ts
- src/renderer/src/components/right-sidebar/source-control-active-open-file-keys.ts
- src/renderer/src/components/native-chat/native-chat-composer-state.ts
- src/shared/terminal-title-display.ts
- src/renderer/src/components/right-sidebar/file-explorer-operation-owner.ts
- src/shared/ssh-retained-payload-admission.ts
- src/renderer/src/components/repo/repo-icon.tsx
- src/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.ts
- src/main/daemon/terminal-private-mode-tracker.ts
- src/main/rate-limits/grok-auth.ts
- src/renderer/src/components/terminal-pane/pty-pre-handler-buffer.ts
- src/main/pi/titlebar-extension-service.ts
- src/shared/remote-runtime-memory-limits.ts
- src/shared/pty-source-credit-contract.ts
- src/shared/remote-runtime-shared-control-state.ts
- src/shared/agent-session-host-authority.ts
- src/renderer/src/components/terminal-pane/pty-delivery-interest.ts
- src/shared/linux-proc-port-scan-limits.ts
- src/renderer/src/components/emulator-pane/emulator-pane-types.ts
- src/shared/agent-session-option-catalog.ts
- src/main/ipc/parcel-watcher-host-subscriptions.ts
- src/shared/wsl-hook-relay-contract.ts
- src/main/emulator/emulator-types.ts
- src/main/github/github-enterprise-repository.ts
- src/main/ssh/ssh-pty-consumer-session.ts
- src/renderer/src/store/slices/runtime-detected-agents.ts
- src/main/ssh/ssh-relay-session.test.ts
- src/shared/remote-workspace-types.ts
- src/shared/terminal-title-status.ts
- src/main/shell-ready-marker-scanner.ts
- src/renderer/src/components/browser-pane/browser-page-zoom.ts
- src/main/plugins/plugin-enablement.ts
- src/shared/commit-message-generation.ts
- src/main/observability/instrumentation.ts
- src/main/providers/pty-process-list-admission.ts
- src/renderer/src/components/right-sidebar/source-control-ai-push-failure-launch.ts
- src/main/runtime/orca-runtime-emulator.ts
- src/renderer/src/components/right-sidebar/CreateHostedReviewComposer.tsx
- src/shared/runtime-environments.ts
- src/shared/ephemeral-vm-runtimes.ts
- src/shared/custom-pet-media-limits.ts
- src/shared/terminal-size-limits.ts
- src/main/observability/redactor.ts
- src/shared/left-sidebar-appearance.ts
- src/main/ssh/ssh-relay-session-managed-hooks.test.ts
- src/renderer/src/components/github/github-issue-comment-helpers.ts
- src/shared/linear-agent-access.ts
- src/renderer/src/components/sidebar/workspace-kanban-card-drag-preview-dom.ts
- src/renderer/src/hooks/useShortcutLabel.ts
- src/renderer/src/components/sidebar/sidebar-host-options.ts
- src/renderer/src/components/sidebar/sidebar-nav-controls.tsx
- src/shared/runtime-types.ts
- src/shared/native-file-drop.ts
- src/shared/hosted-review.ts
- src/renderer/src/components/browser-pane/browser-automation-visibility.ts
- src/main/pi/prefill-extension-source.ts
- src/renderer/src/components/tab-bar/tab-create-entry-path-validation.ts
- src/renderer/src/components/terminal/terminal-tab-actions.ts
- src/shared/daemon-lifecycle-telemetry.ts
- src/main/system-fonts.ts
- src/shared/hermes-run-ref-retention.ts
- src/renderer/src/components/onboarding/use-onboarding-flow.ts
- src/renderer/src/components/tab-bar/shell-icons.tsx
- src/main/computer/macos-native-provider-paths.ts
- src/renderer/src/components/emulator-pane/emulator-keyboard-paste.ts
- src/shared/task-source-context.ts
- src/renderer/src/lib/ensure-simulator-tab.ts
- src/main/git/repo.ts
- src/renderer/src/hooks/useIssueMetadata.ts
- src/renderer/src/components/automations/automation-page-parts.tsx
- src/renderer/src/lib/agent-paste-draft.ts
- src/renderer/src/components/linear-issue-workspace-text.ts
- src/shared/runtime-bootstrap.ts
- src/renderer/src/lib/repo-slug-index.ts
- src/renderer/src/components/right-sidebar/source-control-ai-commit-failure-launch.test.ts
- src/shared/hermes-run-output-limits.ts
- src/shared/source-control-create-review-intent.ts
- src/main/emulator/android/android-input-mapping.ts
- src/renderer/src/components/sidebar/WorktreeCardPorts.tsx
- src/shared/telemetry-events.ts
- src/renderer/src/lib/active-agent-note-target.ts
- src/main/claude-usage/scanner.ts
- src/renderer/src/components/right-sidebar/push-failure-summary.ts
- src/renderer/src/components/editor/markdown-round-trip.ts
- src/shared/terminal-scrollback-policy.ts
- src/main/ipc/runtime-environment-request-connections.ts
- src/shared/daemon-audit-eligibility.ts
- src/renderer/src/components/right-sidebar/source-control-primary-action-types.ts
- src/main/ipc/parcel-watcher-process.ts
- src/shared/serve-update-handoff.ts
🛑 Comments failed to post (2)
config/knip.json (2)
38-38: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== config/knip.json ==" cat -n config/knip.json echo echo "== package.json and lockfile type deps ==" for f in package.json package-lock.json pnpm-lock.yaml yarn.lock bun.lockb; do if [ -f "$f" ]; then echo "-- $f lines 1-120 (if text) --" sed -n '1,120p' "$f" | cat -n fi done echo echo "== package manifests with `@types` packages ==" python3 - <<'PY' import json, pathlib for p in pathlib.Path('.').glob('**/package.json'): data=json.loads(p.read_text()) for k in ('dependencies','devDependencies','peerDependencies','optionalDependencies'): vals=data.get(k,{}) if any(k2.startswith('`@types/`') for k2 in vals): print(p) for kk,v in vals.items(): if kk.startswith('`@types/`'): print(f' {k}:{kk}={v}') PY echo echo "== Knip config settings relevant to type dependency detection ==" rg -n '"ignoreDependencies"|"directoryDependencies"|"ignoreBinaries"|"ignoreDependencies"' config/knip.json package.json || trueRepository: stablyai/orca
Length of output: 50370
🌐 Web query:
Knip reference configuration ignoreDependencies type-definition obsolete packages deprecated💡 Result:
In Knip, the ignoreDependencies configuration option allows you to exclude specific packages from the unused dependency report [1][2]. It is intended as a last-resort solution when Knip cannot automatically detect the usage of a dependency, such as in cases of complex dynamic imports or conditional dependencies [3][4]. Configuration details: The option accepts an array of package names or regular expressions [1][2]. It can be defined in your knip.json or dynamic configuration files (e.g., knip.ts) [1][2]. Example (knip.json): { "ignoreDependencies": ["hidden-package", "
@org/.+"] } Example (knip.ts): export default { ignoreDependencies: [/@org/.*/, /^lib-.+/], }; Regarding obsolete or deprecated type-definition packages: Knip has built-in support for identifying unused@types/packages [5][4]. It automatically checks the package.json of dependencies to see if they bundle their own type definitions (via the "types" or "typings" fields) [5]. When a package bundles its own types, any corresponding@types/package that you have installed is often redundant and can be reported as unused by Knip [6][5]. If Knip fails to flag an obsolete@types/package or incorrectly reports a dependency, it is recommended to: 1. Ensure your entry and project file patterns are correctly configured to provide full coverage of your codebase [3][4]. 2. Verify if a plugin is missing or if the current plugin requires an update [3][4]. 3. Only use ignoreDependencies as a final workaround after verifying these primary configurations [3][4].Citations:
- 1: https://knip.dev/reference/configuration
- 2: https://github.com/webpro-nl/knip/blob/e2943ed8/packages/knip/src/schema/configuration.ts
- 3: https://knip.dev/guides/handling-issues
- 4: https://github.com/webpro-nl/knip/blob/main/packages/docs/src/content/docs/guides/handling-issues.mdx
- 5: webpro-nl/knip#936
- 6: webpro-nl/knip#942
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== all package.json ignoreDependencies ==" rg -n '"ignoreDependencies"' package.json config/knip.json pnpm-lock.yaml --glob 'package.json' --glob 'knip.json' --glob 'pnpm-lock.yaml' || true echo echo "== root `@types` packages in lockfile ==" python3 - <<'PY' import yaml, json, pathlib p=pathlib.Path('pnpm-lock.yaml') if p.exists(): data=yaml.safe_load(p.read_text()) for sec in ('dependencies','devDependencies','peerDependencies','optionalDependencies'): imports=data.get('importers',{}).get('.',{}).get(sec,{}) for name, spec in sorted(imports.items()): if name.startswith('`@types/`'): print(f"{sec}:{name}={spec.get('version') or spec}") PY echo echo "== static probe: `@types/`* coverage with single ignore pattern ==" python3 - <<'PY' import json, re with open('config/knip.json') as f: cfg=json.load(f) with open('package.json') as f: pkg=json.load(f) root_types=[] for section in ('devDependencies','dependencies','peerDependencies','optionalDependencies'): root_types.extend(pkg.get(section,{}).keys) pattern=re.compile('^(`@types`|electron)(/.+)?$') # package entry-level shape equivalent to "electron" and "`@types/`*" matches=[p for p in root_types if pattern.match(p)] print(f"root package count: {len(root_types)}") print(f"root `@types/electron` packages matching ignoreDependencies in config/knip.json line 38:") print(sorted(matches)) PYRepository: stablyai/orca
Length of output: 420
🏁 Script executed:
#!/bin/bash set -euo pipefail python3 - <<'PY' import json, re from pathlib import Path p=Path('pnpm-lock.yaml') text=p.read_text() section=None root={} for line in text.splitlines(): if line.startswith(' ') or line.startswith(' '): continue if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): section=line.rstrip(':') continue if section and line.startswith(' `@types/`'): name=line.split(':',1)[0].strip() root[name]=(text=text) # placeholder placeholder PY echo "== root package names containing `@types/` ==" python3 - <<'PY' from pathlib import Path import re text=Path('pnpm-lock.yaml').read_text() root=[] section=None for line in text.splitlines(): if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): section=line.rstrip(':') elif section in ('dependencies','devDependencies','peerDependencies','optionalDependencies') and line.startswith(' ') and not line.startswith(' '): section=None elif section in ('dependencies','devDependencies','peerDependencies','optionalDependencies') and re.fullmatch(r' `@types/`.+', line): root.append(line.strip().rstrip(':')) print(text='root `@types` packages') PYRepository: stablyai/orca
Length of output: 280
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== root `@types` package names ==" python3 - <<'PY' import re from pathlib import Path text = Path('pnpm-lock.yaml').read_text() section = None root = [] for line in text.splitlines(): if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): section = line.rstrip(':') elif section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') \ and line.startswith(' ') and not line.startswith(' '): section = None elif section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') \ and re.fullmatch(r' `@types/`.+', line): root.append(line.strip().rstrip(':')) print(f"count: {len(root)}") for name in root: print(name) PY echo echo "== deterministic matcher for Knip ignoreDependencies ==" python3 - <<'PY' import json import re patterns = json.loads(Path('config/knip.json').read_text())['ignoreDependencies'] matches = [] for pkg in Path('pnpm-lock.yaml').read_text().splitlines(): if re.match(r' `@types/`.+', pkg): name = pkg.strip().rstrip(':') if any(re.fullmatch(p.replace('*', '.*'), name) for p in patterns): matches.append(name) print(f"config ignores {len(patterns)} patterns") print(f"root `@types` packages ignored by config/knip.json: {len(matches)}") for m in matches: print(m) PYRepository: stablyai/orca
Length of output: 360
🏁 Script executed:
#!/bin/bash set -euo pipefail python3 - <<'PY' from pathlib import Path import json, re text = Path('pnpm-lock.yaml').read_text() section = None root = [] for line in text.splitlines(): if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): section = line.rstrip(':') elif section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') \ and line.startswith(' ') and not line.startswith(' '): section = None elif section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') \ and re.fullmatch(r' `@types/`.+', line): root.append(line.strip().rstrip(':')) print(f"count: {len(root)}") for name in root: print(name) PYRepository: stablyai/orca
Length of output: 262
🏁 Script executed:
#!/bin/bash set -euo pipefail python3 - <<'PY' from pathlib import Path import json, re text = Path('pnpm-lock.yaml').read_text() section = None root = [] for line in text.splitlines(): if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): section = line.rstrip(':') elif ( section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') and line.startswith(' ') and not line.startswith(' ') ): section = None elif ( section in ('dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies') and re.fullmatch(r' `@types/`.+', line) ): root.append(line.strip().rstrip(':')) print(f"root `@types` package count: {len(root)}") for name in root: print(name) patterns = json.loads(Path('config/knip.json').read_text())['ignoreDependencies'] matches = [] for name in root: if any(re.fullmatch(p.replace('*', '.*'), name) for p in patterns): matches.append(name) print(f"\nroot `@types` packages ignored by config/knip.json: {len(matches)}") for m in matches: print(m) PYRepository: stablyai/orca
Length of output: 233
🏁 Script executed:
#!/bin/bash set -euo pipefail python3 - <<'PY' from pathlib import Path import re text = Path('pnpm-lock.yaml').read_text() root = set() impt = '' for line in text.splitlines(): if line in ('dependencies:', 'devDependencies:', 'peerDependencies:', 'optionalDependencies:'): impt = line.rstrip(':') continue if impt and line.startswith(' ') and not line.startswith(' '): impt = '' continue if impt and re.fullmatch(r' `@types/`.+', line): root.add(line.strip().rstrip(':')) print("root `@types` package count:", len(root)) print("\nroot `@types` package names:") for name in sorted(root): print(name) PYRepository: stablyai/orca
Length of output: 208
🌐 Web query:
Knip type definitions unused@typespackages documentation💡 Result:
Knip handles
@typespackages by analyzing your project for usage, but it can occasionally report them as unused if they are implicitly loaded or incorrectly classified. ### How Knip handles@typespackages Knip identifies unused@typespackages by tracking which types are loaded by your project's TypeScript configuration and source code [1][2]. 1. Bundled Types: If a package begins bundling its own type definitions (e.g., in package.json#types), the corresponding@typespackage becomes obsolete. Knip is designed to detect this and report the@typespackage as unused [1][3]. 2. Production vs. Development: In strict mode, Knip expects type-only imports to reside in devDependencies. However, if these types are part of a library's public API (exposed via emitted.d.ts files), they must be listed in dependencies to avoid breakage for consumers [1][4]. Recent updates allow Knip to analyze the public type graph from your declaration files to ensure these are correctly classified [4]. ### Common reasons for false positives If Knip reports an@typespackage as unused, but you believe it is necessary, consider these factors: - Ambient/Global Types: TypeScript automatically loads types from@typespackages if they are in the node_modules/@types folder or referenced in tsconfig.json. Because these are loaded globally rather than via explicit imports, Knip may not detect their usage [5][6]. - Missing Build Artifacts: Knip's analysis of public types relies on existing declaration output (.d.ts files). If your project is not built, it cannot verify which types are exposed [1][4]. - Configuration Gaps: Ensure your tsconfig.json and project entry points are correctly configured. Knip follows the graph defined by your configuration; if entry files are missing, dependencies may appear unused [1][2]. ### How to resolve issues - Remove Obsolete Packages: If a package now bundles its own types, simply remove the@typesdependency [1][3]. - Use ignoreDependencies: If an@typespackage is required globally or for reasons Knip cannot trace, add it to the ignoreDependencies list in your knip.json configuration [3]. - Check for Build Issues: If you are a library author, ensure your declaration files are generated so Knip can correctly identify production type requirements [4].Citations:
- 1: https://knip.dev/guides/handling-issues
- 2: https://knip.dev/typescript/unused-dependencies
- 3: https://github.com/webpro-nl/knip/blob/main/packages/docs/src/content/docs/guides/handling-issues.mdx
- 4: webpro-nl/knip#1912
- 5: webpro-nl/knip#753
- 6: webpro-nl/knip#938
Remove the
@types/*dependency ignore.
ignoreDependenciesshould only exclude packages that cannot be detected as unused. Knip is designed to handle@types/*packages, including obsolete sibling type definitions, so a wildcard ignore hides valid dependency findings. Remove the wildcard and only add verified exceptions if a specific package must be ignored.
40-40: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Files:" git ls-files | rg '(^|/)knip\.json$|package\.json$|tsconfig.*\.json$' || true echo if [ -f config/knip.json ]; then echo "config/knip.json:" cat -n config/knip.json fi echo echo "Package scripts/deps around knip:" if [ -f package.json ]; then node - <<'JS' const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json','utf8')); console.log(JSON.stringify({ scripts: pkg.scripts, devDependencies: pkg.devDependencies, dependencies: pkg.dependencies }, null, 2)); JS fi echo echo "Search for entry declarations / knip configuration:" rg -n '"entry"\s*:|includeEntryExports|knip' -S --glob '!node_modules' --glob '!dist' --glob '!build' .Repository: stablyai/orca
Length of output: 19864
🌐 Web query:
knip reference configuration includeEntryExports self-contained repositories entry exports💡 Result:
In Knip, includeEntryExports is a configuration option that controls whether unused exports should be reported in entry files [1][2]. By default, Knip does not report unused exports in entry files because they are considered the starting points of the codebase, and their exports are often intended to be consumed externally [1][3]. However, in self-contained repositories, private packages, or specific workspaces where you want to ensure that all exported members are actually consumed within the project, you can enable this behavior [1][2]. You can enable this feature using the following methods: Configuration File: Add "includeEntryExports": true to your knip.json (or other supported configuration formats) [1][2]. This can be set at the root level for global application or within individual workspace configurations [1][2]. CLI Argument: Use the --include-entry-exports flag when running the command [4]. Important Considerations: - Scope: When enabled, Knip reports unused exports in entry source files [1][2]. It does not, however, report unused exports in entry and configuration files handled by plugins (e.g., next.config.js, src/routes/+page.svelte) [1][2]. - Members: Enabling this option also instructs Knip to report unused members of exported enums and namespaces, which are otherwise ignored [1][3][2]. - False Positives: Because this setting can increase the number of reported issues, it is often recommended to use it selectively in workspaces where strict export usage is required [5].
Citations:
- 1: https://knip.dev/reference/configuration
- 2: https://github.com/webpro-nl/knip/blob/e2943ed8/packages/knip/src/schema/configuration.ts
- 3: https://knip.dev/guides/handling-issues
- 4: https://knip.dev/reference/cli
- 5: webpro-nl/knip#1442
Enable unused-export checks for entry files in the dead-code audit.
This repository is a self-contained application, and
audit:dead-coderuns Knip withentrydeclarations for multiple application roots and workers.includeEntryExports: falsesuppresses unused exports from those files. Set it totrueif the exports should be used within the project.Proposed fix
- "includeEntryExports": false + "includeEntryExports": true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."includeEntryExports": true
… module src/relay/relay-frame-decoder.ts and src/main/ssh/relay-frame-decoder.ts were 264 identical lines apart from one default: the relay logs decode faults to stderr when no handler is supplied, the SSH side stays silent. Two copies of framing logic is exactly where a wire-format fix lands in one and not the other. The decoder's contract and buffer already live in src/shared, so the class joins them there. The relay keeps a thin subclass that supplies its stderr default, preserving behaviour for the call sites that omit onError. The SSH copy is deleted and relay-protocol.ts points at shared directly. Verified: pnpm typecheck, 102 tests across the 9 framing/backpressure/ handshake suites, and `pnpm build:relay` for all six platform targets plus the WSL hook relay — the standalone bundle has no new dependencies.
ddae63a to
db0f74d
Compare
Stacked on #12077.
What
src/relay/relay-frame-decoder.tsandsrc/main/ssh/relay-frame-decoder.tswere 264 identical lines apart from a single default: the relay writes decode faults to stderr when no handler is supplied, the SSH side stays silent.Two copies of the wire-framing logic is exactly the shape where a protocol fix lands in one and silently not the other.
3 files changed, +23 / −255.
How
The decoder's contract (
relay-frame-decoder-contract.ts) and buffer (relay-frame-buffer.ts) already live insrc/shared/and are already consumed by both sides — only the class body had been copy-pasted. So the class joins them insrc/shared/relay-frame-decoder.ts.relay.ts,protocol-handshake.test.tsandrelay-handshake-roundtrip.test.tsall constructFrameDecoderwithout anonError, so collapsing to a singlenulldefault would have silently swallowed relay decode errors.src/main/ssh/relay-protocol.tsimports from shared directly.No behaviour change on either side.
Checks
pnpm typecheck— passespnpm build:relay— builds clean for all six platform targets (linux-x64/arm64, darwin-x64/arm64, win32-x64/arm64) plus the WSL hook relayThat last one is the real check here:
src/relay/protocol.tsis documented as "self-contained… no Electron dependencies. Deployed standalone to remote hosts." Pulling the class intosrc/sharedrespects that — esbuild already bundlessrc/sharedinto the relay, and the standalone bundle gains no new dependencies.Context
This was the largest clone
jscpdfound in the tree. Overall duplication measures 0.13%, so there is no broader copy-paste problem to chase — this one was just genuinely worth collapsing.Made with Orca 🐋