Skip to content

🤖 refactor: auto-cleanup#3606

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

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

Conversation

@mux-bot

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

Copy link
Copy Markdown
Contributor

Summary

Long-lived auto-cleanup PR maintained by the Auto-Cleanup Agent. Each pass lands at most one extremely low-risk, behavior-preserving cleanup drawn from recently merged main activity, then advances the checkpoint below. The prior long-lived PR (#3589) merged into main; this is its successor on a fresh auto-cleanup branch.

Auto-cleanup checkpoint: 36d84bb

This PR currently contains two accumulated cleanups against main:

  1. src/node/services/taskService.ts — dedupe queued-message foreground backgrounding into a private helper.
  2. src/node/services/workflows/workflowScriptResolver.ts — reuse the SKILL_SCRIPT_PATH_PREFIX constant for canonical-path construction.

This pass

Considered the one new product commit on main since the prior checkpoint — #3604 (refactor: simplify workflow script execution), a large refactor that replaced the named workflow-definition system with explicit script-path workflow execution and added workflowScriptResolver.ts.

In that new file, the skill:// prefix is named by the module-level constant SKILL_SCRIPT_PATH_PREFIX and used when parsing incoming skill:// paths (startsWith / slice), but the two canonical-path builders re-spelled the literal `skill://${...}` instead of reusing the constant.

Landed one behavior-preserving dedup: both canonical-path builders in resolveSkillWorkflowScript now interpolate ${SKILL_SCRIPT_PATH_PREFIX} so the prefix has a single source of truth and cannot drift between the parsing and construction sites.

Behavior-preserving:

  • SKILL_SCRIPT_PATH_PREFIX is exactly "skill://", so `${SKILL_SCRIPT_PATH_PREFIX}${name}/${rel}` produces a byte-identical string to the previous `skill://${name}/${rel}`.
  • No types, control flow, or call semantics change; only the two interpolations were touched.
Prior pass — taskService queued-message dedup

Considered #3605 (fix: background foreground waits for prequeued messages), which open-coded the same queued-message guard at two TaskService wait-registration sites (waitForWorkspaceTurn and the task-await path). Both sites now delegate to a single private helper backgroundForegroundWaitIfQueued(shouldBackgroundOnQueuedMessage, requestingWorkspaceId) placed next to backgroundForegroundWaitsForWorkspace. Behavior-preserving: the helper folds in the requestingWorkspaceId truthiness guard (always true at the workspace-turn site; a verbatim match at the task-await site), and the pushed call is unchanged.

Validation

  • make static-check passes locally for the touched code: ESLint, both TypeScript configs (tsconfig + tsconfig.main.json), and Prettier are green. The only non-passing step is fmt-shell-check, which fails solely because the shfmt binary is not installed in this environment; no shell files are touched by either change.

Risks

Minimal. Both changes are pure local extractions/constant reuse within a single file each; no logic, types, or call semantics change.


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

@mux-bot

mux-bot Bot commented Jun 23, 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.

mux-bot Bot added 2 commits June 23, 2026 12:51
#3605 introduced two near-identical guard blocks that background registered
foreground waits when a tool-end message is already queued (one in the
workspace-turn wait path, one in the task-await path). Extract a single
private helper backgroundForegroundWaitIfQueued() shared by both sites.

Behavior-preserving: the helper folds in the requestingWorkspaceId truthiness
guard, which is always true at the workspace-turn site (asserted non-empty)
and already implied by shouldBackgroundOnQueuedMessage at the task-await site.
The skill:// prefix is already named by SKILL_SCRIPT_PATH_PREFIX and used
for parsing; reuse it in the two canonical-path builders instead of
re-spelling the literal, so the prefix cannot drift. Behavior-preserving:
the constant value is identical to the literal it replaces.
@mux-bot mux-bot Bot force-pushed the auto-cleanup branch from e035f24 to 893fadc Compare June 23, 2026 12:57
@mux-bot

mux-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

This pass adds one behavior-preserving cleanup: in workflowScriptResolver.ts, the two canonical-path builders now reuse the existing SKILL_SCRIPT_PATH_PREFIX constant instead of re-spelling the skill:// literal. The constant value is identical, so the constructed strings are byte-identical. No logic, type, or call-semantics changes.

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