🤖 refactor: auto-cleanup#3606
Open
mux-bot[bot] wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
#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.
e035f24 to
893fadc
Compare
Contributor
Author
|
@codex review This pass adds one behavior-preserving cleanup: in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainactivity, then advances the checkpoint below. The prior long-lived PR (#3589) merged intomain; this is its successor on a freshauto-cleanupbranch.Auto-cleanup checkpoint: 36d84bb
This PR currently contains two accumulated cleanups against
main:src/node/services/taskService.ts— dedupe queued-message foreground backgrounding into a private helper.src/node/services/workflows/workflowScriptResolver.ts— reuse theSKILL_SCRIPT_PATH_PREFIXconstant for canonical-path construction.This pass
Considered the one new product commit on
mainsince 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 addedworkflowScriptResolver.ts.In that new file, the
skill://prefix is named by the module-level constantSKILL_SCRIPT_PATH_PREFIXand used when parsing incomingskill://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
resolveSkillWorkflowScriptnow 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_PREFIXis exactly"skill://", so`${SKILL_SCRIPT_PATH_PREFIX}${name}/${rel}`produces a byte-identical string to the previous`skill://${name}/${rel}`.Prior pass — taskService queued-message dedup
Considered #3605 (
fix: background foreground waits for prequeued messages), which open-coded the same queued-message guard at twoTaskServicewait-registration sites (waitForWorkspaceTurnand the task-await path). Both sites now delegate to a single private helperbackgroundForegroundWaitIfQueued(shouldBackgroundOnQueuedMessage, requestingWorkspaceId)placed next tobackgroundForegroundWaitsForWorkspace. Behavior-preserving: the helper folds in therequestingWorkspaceIdtruthiness 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-checkpasses locally for the touched code: ESLint, both TypeScript configs (tsconfig+tsconfig.main.json), and Prettier are green. The only non-passing step isfmt-shell-check, which fails solely because theshfmtbinary 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