Skip to content

🤖 refactor: auto-cleanup#3635

Open
mux-bot[bot] wants to merge 2 commits into
mainfrom
auto-cleanup
Open

🤖 refactor: auto-cleanup#3635
mux-bot[bot] wants to merge 2 commits into
mainfrom
auto-cleanup

Conversation

@mux-bot

@mux-bot mux-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This is the long-lived auto-cleanup PR. Each run, the auto-cleanup agent reviews new commits merged to main and applies at most one extremely low-risk, behavior-preserving cleanup.

This run de-duplicates the header-summary tone computation in WorkspaceLifecycleToolCall so the group → tone mapping lives in a single place.

Background

WorkspaceLifecycleToolCall (added in #3638) renders the task_workspace_lifecycle transcript card. Its collapsed header pill picks a "worst" tone for mixed batches with a ternary of hardcoded token names ("danger" / "warn" / "muted"). Those literals silently duplicate the existing GROUP_TONE record, which already maps each OutcomeGroup to its tone and is used right below for the per-group dot chips. Repeating the mapping risks the two drifting apart if GROUP_TONE ever changes.

Implementation

  • Compute the most severe non-empty OutcomeGroup (failedblockedsettled), then resolve its tone through GROUP_TONE instead of re-spelling the tone literals.
  • The mapping is now single-sourced: the header pill and the dot chips both read tones from GROUP_TONE.

This is behavior-preserving: GROUP_TONE.failed === "danger", GROUP_TONE.blocked === "warn", and GROUP_TONE.settled === "muted", so the selected tone is identical for every input.

Earlier cleanups in this PR
  • Remove unused streamToUint8Array helper (src/node/runtime/streamUtils.ts): the helper was introduced alongside the experimental image-editing tool (🤖 feat: add experimental image editing tool #3282) but had no remaining callers anywhere in the repo, so it was dead code.

Validation

  • make static-check passes (eslint, typecheck ×2, prettier, shfmt, ruff, shellcheck, hadolint, code-docs-links, eager-imports).
  • bun test src/browser/features/Tools/WorkspaceLifecycleToolCall.ui.test.tsx (18 tests) passes, covering the outcome-group classification the header pill depends on.

Risks

Negligible. Both changes are local and behavior-preserving — one removes a zero-reference symbol, the other re-routes a tone lookup through an equal-valued constant with no rendered-output change.


Auto-cleanup checkpoint: 7aaf5b5

Generated with mux • Model: anthropic:claude-opus-4-8 • Thinking: xhigh

@mux-bot

mux-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

The streamToUint8Array helper in src/node/runtime/streamUtils.ts had zero
references anywhere in the repository (verified via git grep across all
tracked files). It was orphaned after the experimental image-editing tool
work (#3282) that introduced it. Removing it is behavior-preserving: the
function uses only global APIs, so no imports needed cleanup, and the
file's other exports (shescape, streamToString) are unaffected.
@mux-bot mux-bot Bot force-pushed the auto-cleanup branch from 1390676 to 4c966ec Compare June 25, 2026 16:54
@mux-bot

mux-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Small follow-up cleanup: the WorkspaceLifecycleToolCall header pill now derives its "worst" tone from the existing GROUP_TONE map instead of duplicating the tone literals. Behavior-preserving; make static-check and the component's UI tests pass.

@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 from 4c966ec to 94e4987 Compare June 25, 2026 17:07
@mux-bot

mux-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Auto-fixup could not resolve CI failure: the only failing job was Test / E2E (macos), which timed out during environment setup — specifically the Playwright Chromium install step. The 159.6 MiB Chromium download reached 100%, then the job hung with no further output for ~10 minutes until GitHub Actions killed it (##[error]The action has timed out.). No test ever executed.

This is an infrastructure/flaky failure, not a code regression:

  • Test / E2E (linux) (same test suite) passed.
  • All other jobs passed: Static Checks, Test / Unit, Test / Storybook, Test / Integration, Test / Windows, Smoke / Server.
  • Required failed only because it aggregates the macOS E2E result.
  • This PR only touches src/browser/features/Tools/WorkspaceLifecycleToolCall.tsx and src/node/runtime/streamUtils.ts, neither of which can affect Playwright's browser download/install.

No code was pushed. A re-run of the Test / E2E (macos) job should clear this. Manual intervention (re-run) needed.

…Call

The header summary pill computed its tone with hardcoded "danger"/"warn"/"muted" literals that duplicated the existing GROUP_TONE mapping (already used for the dot chips just below). Pick the most severe non-empty OutcomeGroup and map it through GROUP_TONE so the group->tone relationship is single-sourced. Behavior-preserving: GROUP_TONE.failed/blocked/settled equal the prior literals.
@mux-bot mux-bot Bot force-pushed the auto-cleanup branch from 94e4987 to f698445 Compare June 25, 2026 17:15
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.

0 participants