Skip to content

Comments

🤖 refactor: auto-cleanup#2244

Open
github-actions[bot] wants to merge 22 commits intomainfrom
auto-cleanup
Open

🤖 refactor: auto-cleanup#2244
github-actions[bot] wants to merge 22 commits intomainfrom
auto-cleanup

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 7, 2026

Summary

Periodic auto-cleanup: remove dead code, fix stale config, deduplicate helpers, and tighten module exports.

Latest Change

  • Remove dead buildPendingFromContent and buildEditingStateFromContent: These helpers in chatEditing.ts were added in PR 🤖 feat: add /<model> one-shot model override syntax #2142 as symmetrical counterparts to the fromDisplayed variants, but the fromContent variant was never imported or called anywhere. Net -14 lines.
Previous changes
  • Deduplicate coerceAgentStatus into shared extensionMetadata utility: ExtensionMetadataService had private coerceAgentStatus and coerceStatusUrl methods near-identical to the module-level functions in extensionMetadata.ts (added in PR 🤖 fix: propagate status_set via workspace activity snapshots #2532). Export both from the shared utility and import in the service. Net -21 lines, identical behavior.

  • Extract hasRuntimeOverrides helper to deduplicate 3 identical checks: The runtime enablement feature (PR 🤖 feat: add runtime enablement settings #2387) introduced the same 3-line boolean expression in ChatInput/index.tsx, RuntimesSection.tsx, and useDraftWorkspaceSettings.ts. Extracted into a shared hasRuntimeOverrides() function in src/common/types/project.ts. Net -6 lines, identical behavior.

  • Remove dead getSessionTimingKey storage constant: The function was introduced in PR 🤖 feat: add timing stats indicator in workspace sidebar #1177 (timing stats feature) but its functionality migrated to the file-based SessionTimingService. No code in the codebase imports or calls it. Net -9 lines.

  • Remove dead extractCommonPrefix from numstatParser.ts: The function was exported but never imported or referenced anywhere in production code or tests. Its JSDoc noted it was "used for display purposes only" but no display code used it. Net -34 lines.

  • Use coerceNonEmptyString for model resolution in dispatchAgentSwitch: The new switch_agent model-resolution cascade (from PR 🤖 fix: honor target agent settings in switch_agent follow-ups #2524) manually repeated the trim() + empty-check → undefined pattern three times. Replaced with the existing coerceNonEmptyString utility from taskUtils.ts. Net -8 lines, identical behavior.

  • Remove dead readExtensionMetadata function: This sync file-reading function was superseded by ExtensionMetadataService's async implementation. Zero imports outside the definition file. Also removes now-unused fs sync imports, isThinkingLevel, and log imports. Net -43 lines.

  • Fix missing blank line between functions in workspaceTitleGenerator.ts: The new cleanExtractedValue function added in c240bae was missing the blank line separator that every other function boundary in the file uses. Pure formatting fix.

  • Remove dead createManualRetryState function: This function was only used by the frontend RetryBarrier component's manual retry flow. PR 🤖 refactor: move auto-compaction & auto-retry from frontend to backend #2469 moved retry management to the backend RetryManager, which uses createFreshRetryState and createFailedRetryState instead. The function definition and its 7 tests were left behind as dead code. Net -96 lines.

  • Use shared UpdateChannel type in AboutDialog: Replace inline "stable" | "nightly" type annotations with the shared UpdateChannel type from src/common/types/project.ts, eliminating type duplication.

  • Remove dead timing stats types from WorkspaceStore: Remove StreamTimingStats, ModelTimingStats, and SessionTimingStats interfaces that were defined but never referenced. The authoritative versions live in src/common/orpc/schemas/workspaceStats.ts. Net -74 lines.

  • Remove dead code and narrow exports in agentTools: Remove collectToolConfigsFromDefinitionGraph (exported but never imported anywhere) and its supporting AgentToolsLike interface. Also make isToolEnabledByConfigs and isToolEnabledInResolvedChain module-private since they are only called within the same file. Net -51 lines.

  • Deduplicate onboarding wizard splash ID constant.

  • Deduplicate MessageWindow blocks in UserMessage.

  • Inline single-use resolveForkRuntimeConfigs into its only caller.

  • Remove dead fuzzy-search helpers from fuzzySearch.ts.

  • Deduplicate ConnectionHealth interface from SSH2ConnectionPool.ts.

  • Delete src/common/utils/tools/taskToolTypeGuards.ts: Dead module with zero imports.

  • Delete src/common/utils/ai/providerFactory.ts: Dead since folder restructure.

  • Fix stale ESLint dynamic-import override paths.

  • Remove dead isStreamingPart type guard from messageUtils.ts.

  • Deduplicate formatDuration into shared utility.

  • Remove dead formatNewCommand, ThemeToggleButton, canonicalModelId, hasSubtitle prop.

  • Deduplicate compaction type guards into shared module.

  • Remove dead re-exports from RightSidebar.tsx.

  • Rename partialService.test.tshistoryService.partial.test.ts.

  • Fix orphaned JSDoc comment on UpdaterService.getStatus().

  • Deduplicate normalizeAgentId, getProviderDisplayName, getCustomModels/getAllCustomModels.

  • Remove dead backward-compat aliases in codexOauthAuth.ts and re-exports.

  • Unexport file-private helpers in modelEntries.ts.

  • Remove dead pendingReplayReset field from WorkspaceStore.ts.

  • Remove dead onLogEntry, formatPendingCommand, parseGitShowBranchForStatus, path helpers.

  • Remove dead ChatInputProps barrel re-export.

  • Unexport file-private isBashOutputTool.

  • Remove dead code in chatEditing.ts.

Validation

  • make typecheck passes
  • make lint passes
  • make fmt-check passes (excluding shfmt not available in CI env)
  • Related tests pass (16/16 in useDraftWorkspaceSettings.test.tsx and useCreationWorkspace.test.tsx)

Auto-cleanup checkpoint: 60c63c8


Generated with mux · Model: anthropic:claude-opus-4-6 · Thinking: xhigh

@github-actions github-actions bot force-pushed the auto-cleanup branch 3 times, most recently from 554bc3a to 688ccae Compare February 22, 2026 16:10
Mux Auto-Cleanup and others added 22 commits February 23, 2026 00:07
ConnectionStatus and ConnectionHealth were identically defined in both
sshConnectionPool.ts and SSH2ConnectionPool.ts. Since SSH2ConnectionPool
already imports SSHConnectionConfig from sshConnectionPool, extend the
import to include ConnectionHealth (ConnectionStatus is used transitively
through ConnectionHealth, so no direct import needed).
…teRanking

After PR #2492 introduced commandPaletteRanking.ts, the higher-level
wrappers fuzzySubsequenceMatch, matchesAllTerms, scoreAllTerms (and the
private fuzzySubsequenceMatchNormalized) lost all production callers.

Remove the dead functions and their corresponding tests. The low-level
primitives (normalizeFuzzyText, splitQueryIntoTerms, scoreSingleTermNormalized)
remain — they are actively used by commandPaletteRanking.ts.
… interface

execFileAsync and its ExecFileAsyncOptions interface were exported from
disposableExec.ts but never imported anywhere in the codebase. This also
removes the now-unused 'spawn' import from child_process.
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
The string "onboarding-wizard-v1" was duplicated in both index.ts (registry)
and SplashScreenProvider.tsx (pause logic). Export a single
ONBOARDING_WIZARD_SPLASH_ID constant from index.ts and import it in
SplashScreenProvider.tsx.
- Remove `collectToolConfigsFromDefinitionGraph`: exported function never
  imported anywhere (dead code).
- Remove `AgentToolsLike` interface: only used by the removed dead function.
- Make `isToolEnabledByConfigs` and `isToolEnabledInResolvedChain` module-
  private: both are only called within agentTools.ts itself.

Net: -51 lines, cleaner public API surface for the module.
The function was exported from tokenMeterUtils.ts but never imported
anywhere in the codebase. Removing dead code.
The escapeRegexForHighlight function in HunkViewer.tsx was an exact
duplicate of escapeRegex in highlightSearchTerms.ts (both introduced
across separate PRs). Export the existing escapeRegex and import it
in HunkViewer, removing the duplicate.
Remove StreamTimingStats, ModelTimingStats, and SessionTimingStats
interfaces that are defined but never used. The authoritative versions
of ModelTimingStats and SessionTimingStats live in
src/common/orpc/schemas/workspaceStats.ts (inferred from Zod schemas).
StreamTimingStats has no equivalent anywhere — purely dead code.
Replace inline "stable" | "nightly" type annotations with the shared
UpdateChannel type from src/common/types/project.ts. Reduces type
duplication and ensures the dialog stays in sync with the canonical
type definition.
This function was only used by the frontend RetryBarrier component's
manual retry flow. PR #2469 moved retry management to the backend
RetryManager, which uses createFreshRetryState and createFailedRetryState
instead. The function definition and its tests were left behind as dead
code.
…leanExtractedValue

The new functions added in c240bae were missing the blank line separator
that every other function boundary in the file uses.
The readExtensionMetadata() function was superseded by
ExtensionMetadataService's own async file reading. Zero imports
outside its definition file. Also removes now-unused fs sync imports,
isThinkingLevel, and log imports. Net -40 lines.
…entSwitch

Replace manual trim()+empty-check pattern with the existing
coerceNonEmptyString utility in the switch_agent model resolution
cascade. Reduces 14 lines to 4 with identical behavior.
The function was exported but never imported or referenced anywhere in
production code or tests. Net -34 lines of dead code.
The previous cleanup incorrectly removed this function, but it is still
imported by vscode/src/muxConfig.ts. Added a comment noting the VS Code
dependency to prevent future accidental removal.
The function was introduced in PR #1177 (timing stats feature) but its
functionality migrated to the file-based SessionTimingService. The
localStorage key function remained unused — no code in the codebase
imports or calls it.
…al checks

The runtime enablement feature (PR #2387) introduced the same 3-line
boolean expression in three files to check whether a ProjectConfig has
runtime overrides. Extract it into a shared hasRuntimeOverrides() helper
in src/common/types/project.ts. Net -6 lines, identical behavior.
… utility

ExtensionMetadataService had private coerceAgentStatus and coerceStatusUrl
methods that were near-identical to the module-level coerceAgentStatus in
extensionMetadata.ts. Export both functions from the shared utility and
import them in the service, removing the duplicate private methods.

Net -21 lines, identical behavior.
…lSchema

Replace hardcoded z.enum(["off", "low", ...]) with the canonical
THINKING_LEVELS constant from src/common/types/thinking.ts, matching
the pattern already used in src/common/orpc/schemas/stream.ts.
…omContent

These helpers were added in PR #2142 as symmetrical counterparts to the
'fromDisplayed' variants, but the 'fromContent' variant was never used.
Zero imports or call sites outside the definition. Net -14 lines.
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