Skip to content

🤖 refactor: auto-cleanup#3085

Merged
ethanndickson merged 24 commits intomainfrom
auto-cleanup
Apr 13, 2026
Merged

🤖 refactor: auto-cleanup#3085
ethanndickson merged 24 commits intomainfrom
auto-cleanup

Conversation

@mux-bot
Copy link
Copy Markdown
Contributor

@mux-bot mux-bot bot commented Mar 28, 2026

Auto-cleanup checkpoint: 02f56f0

@mux-bot
Copy link
Copy Markdown
Contributor Author

mux-bot bot commented Mar 28, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@mux-bot mux-bot bot force-pushed the auto-cleanup branch 17 times, most recently from c3877b1 to 9bb12da Compare April 3, 2026 20:13
@mux-bot
Copy link
Copy Markdown
Contributor Author

mux-bot bot commented Apr 3, 2026

⚠️ Auto-fixup: CI failure is a flaky E2E test — no fix needed.

The failed job Test / E2E (linux) (run 23960636680) has two failures:

  1. review.spec.ts (FAILED): setThinkingLevel(1) expected "LOW" but label stayed at "MED" — known intermittent issue where Linux CI drops paddle clicks during rapid mode transitions (the helper already has retry/fallback logic for this).
  2. reviewRefresh.spec.ts (FLAKY): Tutorial backdrop intercepted pointer events on the Stats tab click.

Why this is not caused by the cleanup:

  • No test files or UI components were modified in this branch.
  • The only CSS change (removing --color-scrollbar-* variables) is clean — no code references the removed variables.
  • 9 of 10 CI runs on this branch passed successfully.
  • A parallel run from the same commit (23960636663) also passed.

Action: Re-run the failed job or merge — this is a pre-existing E2E flake, not a regression from the cleanup.

@mux-bot mux-bot bot force-pushed the auto-cleanup branch 10 times, most recently from b2d7a68 to 37a0f60 Compare April 9, 2026 16:32
mux-bot bot added 22 commits April 12, 2026 20:06
Both getHeartbeatSettings and setHeartbeatSettings had nearly identical
object literals duplicated across two ternary branches, differing only
by the optional message field. Use conditional spread to build each
object once, removing the duplicated comment in setHeartbeatSettings.
After the HEARTBEAT_MAX_MESSAGE_LENGTH removal (5f002d8), normalizeHeartbeatMessageInput
became functionally identical to sanitizeHeartbeatMessage for its string | undefined input type.
The only distinguishing logic was the max-length assert which no longer exists.

Consolidate both callsites to use the single sanitizeHeartbeatMessage function, which
safely handles both user input and persisted config values.
The AddSectionButton component was removed from ProjectSidebar's
imports in #3099 but the component file and its test mock were left
behind. Remove both since nothing references them anymore.
…ppers

After the compaction handler refactor (710bda5), the production callers
were migrated to use the new *State methods directly. The old *Diffs
wrappers had zero remaining callers:

- discardPendingDiffs: no callers in production code or tests
- ackPendingDiffsConsumed: one caller in agentSession.ts, now updated
  to call ackPendingStateConsumed directly

peekPendingDiffs is retained as it's still used by tests as a
convenience accessor.
PR #3111 migrated scrollbar styling to use --color-surface-quaternary
and standard scrollbar-color, but left the old --color-scrollbar-track,
--color-scrollbar-thumb, and --color-scrollbar-thumb-hover variable
definitions in all four themes. These variables are no longer referenced
anywhere — remove the 12 dead lines.
…red utility

Extract identical number type guard functions that were duplicated across
compactionBoundary.ts, compactionHandler.ts, workspaceService.ts, and
historyService.ts into a shared src/common/utils/numbers.ts module.
…debar

Deduplicate the identical className string used by both the
multi-project section toggle button and per-project expand/collapse
buttons into a shared constant, following the existing pattern of
PROJECT_ITEM_BASE_CLASS.
…kspace list container

The vertical connector line was removed in #3124, leaving behind a
tombstone comment explaining the removal and a `relative` CSS class
that only existed to position the now-deleted absolute-positioned
connector element.  No absolute children remain in the container,
so both artifacts are dead code.
After the Chat with Mux removal (#3123), the conditional that
prepended the mux-chat workspace was deleted, leaving behind a
trivial `const workspaces = inputWorkspaces;` alias. Inline the
destructured name directly so the intermediate variable is gone.
expandTildeForSSH was imported twice from ./tildeExpansion: once as
expandHookPath and once directly. Since the function is already available
under its real name, the alias is unnecessary. Consolidate into a single
import line and use expandTildeForSSH at the one call site.
…atalog

isCopilotRoutableModel() unconditionally returns true since the Copilot
routing was opened to all models, making the guard in
isProviderModelAccessibleFromAuthoritativeCatalog() dead code that can
never take the early-return false branch. Remove the guard and its
now-unused import.
Deduplicate formatIntervalMinutes, parseIntervalMinutes, clampIntervalMinutes,
and the derived minute constants + assertions that were copy-pasted between
WorkspaceHeartbeatModal and HeartbeatSection into a single shared module at
src/browser/utils/heartbeatIntervalMinutes.ts.

Also adds intervalMinutesToMs() to replace the raw MS_PER_MINUTE multiplication
that appeared in both callers.
The LandingPage feature and its stories were entirely deleted in 6241d6d.
The MIGRATED_APP_STORIES entry that guarded against re-creating the old
App.landingPage.stories.tsx in src/browser/stories/ is now dead config —
there is no colocated version to protect anymore.
Extract the identical sleepWithAbort function from SSHRuntime,
sshConnectionPool, SSH2ConnectionPool, and codexOauthService into
src/node/utils/abort.ts (which already hosts AbortSignal helpers).

The four copies had trivial cosmetic differences (error message text,
optional vs required signal param) but identical behavior. The shared
version uses optional AbortSignal and 'Operation aborted' error text,
matching the convention used by the majority of callers.
This exported constant was never referenced anywhere in the codebase —
not imported, not used via its string value. It was superseded by
EDIT_FAILED_NOTE_PREFIX (which is actively used in file_edit_* tools)
but was never cleaned up.
…tils

computeBashOutputGroupInfo (singular) was exported from messageUtils.ts
but had zero production consumers — it was only used in tests as a
convenience wrapper around computeBashOutputGroupInfos(messages)[index].

Move the helper into the test file as a local function to reduce the
public API surface of messageUtils.
Deduplicate the identical `error instanceof Error ? error.message : ...`
expression used by both isEncryptedKeyError and isAuthFailure into a
shared file-local helper. Behavior-preserving; no logic change.
helpers.ts had a private streamToString with an improved chunk-based
implementation to avoid O(n²) ConsString rope issues. The shared
streamUtils.ts still used the old += pattern.

Upgrade streamUtils.ts to the chunk-based approach and remove the
duplicate from helpers.ts, replacing it with an import.
Remove two unnecessary variable aliases introduced with the advisor tool:
- `advisorToolConfig` was an alias for `cfg` (replaced 3 usages with `cfg`)
- `advisorEligible` was an alias for `advisorToolEligible` (replaced 3 usages)
The file src/browser/utils/tokenizer/rendererClient.ts exported three
functions (getTokenCountPromise, countTokensBatchRenderer,
clearRendererTokenizerCache) that were never imported anywhere in the
codebase. Remove the entire dead module.
Add missing isAdvisorPhaseEvent type guard to orpc/types.ts, matching
the existing isBashOutputEvent and isTaskCreatedEvent patterns.

Replace the inline 'data.type === "advisor-phase"' check + manual cast
in WorkspaceStore.handleChatMessage with the new guard, eliminating
the intermediate advisorPhase variable.
structuredClone is available in Electron 38 (Node 22+) and all
supported environments. Remove the JSON.parse/stringify fallback
branch and inline structuredClone at the two call sites.
@ethanndickson
Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson ethanndickson added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 9f45aba Apr 13, 2026
24 checks passed
@ethanndickson ethanndickson deleted the auto-cleanup branch April 13, 2026 03:05
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