🤖 refactor: auto-cleanup#3589
Conversation
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
56eb58c to
be3ec5b
Compare
|
@codex review Behavior-preserving dedup: extracted the duplicated child-failure abort handling in |
|
To use Codex here, create a Codex account and connect to github. |
6d9c760 to
da799d5
Compare
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
da799d5 to
e7de27b
Compare
|
Failed job: Failing tests:
Root cause: Each failure is a Why it's unrelated to this PR: the cleanup only touches Local verification: the suite passes consistently — 8/8 across 5 consecutive runs on this branch. Recommendation: re-run the failed CI job. No automated fix is warranted since modifying the unrelated test would exceed the cleanup scope. If this test proves persistently flaky under coverage, consider hardening it separately (e.g., a higher |
|
Failing tests (
Why this is a flake, not a regression:
(The Recommendation: re-run the |
e7de27b to
7efa56e
Compare
|
@codex review This pass adds one behavior-preserving cleanup: |
|
To use Codex here, create a Codex account and connect to github. |
7efa56e to
dfafa92
Compare
|
@codex review This pass extracts a shared |
|
To use Codex here, create a Codex account and connect to github. |
dfafa92 to
e6b5f65
Compare
|
To use Codex here, create a Codex account and connect to github. |
|
Root cause: All 15 Windows failures originate in test scaffolding Why this is not caused by the cleanup commit:
Action: No code pushed (the |
|
Failed job: Root cause (environmental):
Why this is not caused by the cleanup commit:
Recommendation: Re-run the Generated with |
e6b5f65 to
0fab59f
Compare
|
@codex review Auto-cleanup pass: rebased onto latest |
|
To use Codex here, create a Codex account and connect to github. |
0fab59f to
a0a14eb
Compare
|
@codex review This pass: deduped the three private session-file path accessors in |
|
To use Codex here, create a Codex account and connect to github. |
Extract the thrice-repeated "Attachments cannot be added while editing a message." toast string into a module-level EDIT_MODE_ATTACHMENT_ERROR_MESSAGE const so the three guards surface identical copy and cannot drift. Behavior-preserving.
…itialize Extract the awaiting_report/running candidate filters used by the startup inactive-workflow-owner recovery pass into a single listStartupRecoveryCandidates closure, mirroring the existing listQueuedTasks pattern, so the initial computation and the post-interrupt refresh reuse the exact same status filters. Behavior-preserving cleanup of #3594.
The 'In the plan agent you may only spawn agentId: "explore" tasks.' error string was open-coded twice in task.ts — once in the workspace-turn guard and once in the per-launch agent-id guard. Both now reference a single module-level PLAN_AGENT_EXPLORE_ONLY_ERROR constant. Behavior-preserving (identical string).
a0a14eb to
b207808
Compare
|
@codex review Auto-cleanup pass: advanced checkpoint to |
|
To use Codex here, create a Codex account and connect to github. |
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 (#3559) merged intomain; this is its successor.Auto-cleanup checkpoint: 2af29df
This pass
Considered the one new
maincommit since the previous checkpoint — #3603 (feat: add built-in loop skill). That change adds the advertisedloopbuilt-in skill (src/node/builtinSkills/loop.md), regeneratesbuiltInSkillContent.generated.ts(generated — off-limits), and extends the agent-skills discovery test expectations. The skill-content/generated surface offers no safe hand-edit, so the cleanup was drawn from the production sibling of that area: the skill-discovery serviceagentSkillsService.ts.Landed one behavior-preserving cleanup in
agentSkillsService.ts:readSkillDescriptorFromDiropen-coded the same invalid-skill diagnostic push —options?.invalidSkills?.push({ directoryName, scope, displayPath: skillFilePath, message, hint })— at six failure sites (missing/unreadable SKILL.md, SKILL.md-is-a-directory, oversized file, read failure, invalid descriptor, parse failure). Those six sites share identical identity fields (directoryName/scope/displayPath) and differ only inmessage+hint. All six now delegate to a single function-localpushInvalidSkill(message, hint)closure that captures the function-constant identity fields. Behavior-preserving: the pushed object shape and every per-sitemessage/hintare unchanged, and the closure short-circuits onoptions?.invalidSkillsexactly as the inline calls did.Branch contents (net diff against
main)Cleanups carried by this PR (not yet merged)
agentSkillsService.ts— dedupe invalid-skill diagnostics. 🤖 feat: add built-in loop skill #3603's new built-in skill lives in the agent-skills discovery area;readSkillDescriptorFromDiropen-coded the sameoptions?.invalidSkills?.push({ directoryName, scope, displayPath: skillFilePath, message, hint })at six failure sites that share identical identity fields and differ only inmessage/hint. All six now delegate to a single function-localpushInvalidSkill(message, hint)closure. Behavior-preserving (identical pushed shape, messages, hints, andoptions?.invalidSkillsshort-circuit).workspaceGoalService.ts— dedupe session file path resolution. The three private accessorsgetFilePath/getHistoryFilePath/getBoardFilePatheach open-coded the sameassert(...non-empty workspaceId)guard andpath.join(getSessionDir(...), <FILE_CONST>). All three now delegate to a singleresolveSessionFilePath(workspaceId, fileName)helper. Behavior-preserving (identical guard + join; accessor names and callers unchanged).task.ts— dedupe plan-agent explore-only error. The plan-agent restriction errorIn the plan agent you may only spawn agentId: "explore" tasks.was open-coded twice (the workspace-turn guard and the per-launch agent-id guard). Both now reference a single module-levelPLAN_AGENT_EXPLORE_ONLY_ERRORconstant. Behavior-preserving (identical string output).task_await.ts— dedupe workspace-turn error fallback. 🤖 feat: add workspace turn task handles #3600's new workspace-turn await paths open-coded the fallback error message"Workspace turn failed"three times (<record>.error ?? "Workspace turn failed"). All three now reference a single module-levelWORKSPACE_TURN_DEFAULT_ERRORconstant. Behavior-preserving (identical string output).goalToolUtils.tsx/SetGoalToolCall.tsx— dedupe turn-count pluralization. 🤖 feat: add agent-facing goal setting #3595's new goal toolcards open-coded`${n} turn${n === 1 ? "" : "s"}`in bothformatGoalTurnsand the set_goal toolcard'sformatOptionalTurnCap. Both now call a sharedpluralizeTurns(count)helper. Behavior-preserving (identical string output).heartbeat.ts— dedupe heartbeat tool success result construction. 🤖 feat: add workspace heartbeat tool #3596's newheartbeattool open-coded the same{ success: true, action, configured, settings, summary }success object three times (get/set/unset), each re-callingsummarize({ action, settings }). All three now route through a singlebuildSuccessResult(action, settings)helper that derivesconfiguredfromsettings. Behavior-preserving: the per-branchconfiguredvalues (settings != null,false,true) all equalsettings != nullgiven the non-nullOkpayload type forset.taskService.ts— dedupe startup recovery candidate listing. 🤖 fix: prevent workflow task recovery after interrupts #3594'sTaskService.initializeopen-coded theawaiting_report/runningcandidate filters twice (initial computation and post-interrupt refresh). Both call sites now reuse a singlelistStartupRecoveryCandidates(sourceConfig)closure returning{ awaitingReportTasks, runningTasks }, matching the existinglistQueuedTaskspattern. Behavior-preserving.ChatPane.tsx— dedupe send-queued-immediately in-flight guard clear. 🤖 fix: send queued message with empty Enter #3592 introducedsendQueuedImmediatelyInFlightRefto block duplicate send-now attempts; releasing that guard ("clear it only if it still points at this attempt") was open-coded twice — once after a failed interrupt result and once in thecatcharm. Both call sites now invoke a single callback-local closureclearInFlightGuardIfCurrent(). Behavior-preserving: the failed-result site's combined!interruptResult.success && ref === idbecomesif (!interruptResult.success) clearInFlightGuardIfCurrent()(logically identical); thecatchsite is a verbatim substitution.WorkflowRunner.ts— dedupeparallelAgentschild-failure abort handling into a single batch-local closureapplyChildFailureToBatch(error), shared by the per-run task closure and the bulk-create path.ChatInput/index.tsx— dedupe edit-mode attachment toast string"Attachments cannot be added while editing a message."into a single module-level constantEDIT_MODE_ATTACHMENT_ERROR_MESSAGE, replacing three inline copies across the add-attachment / paste / drop guards.Prior passes (landed via #3559, merged)
WorkflowService.interruptRunOnAbortwith theisTerminalWorkflowRunStatushelper.workspaceId-only metadata JSON Schema repeated by three id-targeted host actions inworkspaceHostActions.tsintoWORKSPACE_ID_ONLY_INPUT_SCHEMA.BlockedBadgecomponent inWorkflowDefinitionToolCall.tsx.argsSchema.properties must be an objecterror string inworkflowArgs.ts.useModelsFromSettings.test.ts.toggleWorkflowExpandedwrapper inWorkflowRunToolCall.tsx.SAVE_AUTOMATION_ERROR_MESSAGE/REMOVE_AUTOMATION_ERROR_MESSAGEinAutomationModal.tsx."wfr_"literal inWorkflowRunner.tswithisWorkflowRunTaskId().Validation
make static-check— ESLint, bothtsgotypecheck configs, and Prettier all pass on the rebased tree. The only failing step isfmt-shell-check, which requiresshfmt(not installed in this environment); no shell scripts were touched, so CI (which hasshfmt) is unaffected.bun test src/node/services/agentSkills/agentSkillsService.test.ts— 20 pass, 0 fail (covers skill discovery + the invalid-skill diagnostics path this pass deduped);builtInLoopSkill.test.ts— 1 pass.Generated with
mux• Model:anthropic:claude-opus-4-8• Thinking:xhigh