🤖 refactor: auto-cleanup#3629
Merged
Merged
Conversation
Dedupe the three identical 'error instanceof Error && error.name === X' sentinel-error predicates (isForegroundWaitBackgroundedError, isAgentReportWaitTimeoutError, isWorkflowAgentHardTimeoutError) into a single isErrorWithName(error, name) helper. Behavior-preserving local refactor; each guard returns the same boolean as before.
Contributor
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
ThomasK33
approved these changes
Jun 25, 2026
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.Auto-cleanup checkpoint: d3b835a
This PR currently contains one cleanup against
main:src/node/services/workflows/WorkflowRunner.ts— extract the duplicatederror instanceof Error && error.name === ...sentinel-error guard into a sharedisErrorWithName(error, name)helper.This pass
This is the first pass of a fresh auto-cleanup PR (the prior one, #3606, merged at checkpoint
620c2a66). Considered the newmaincommits since that checkpoint:feat: add workflow agent graceful timeouts)fix: apply default budget for model goals)#3625 added agent graceful-timeout handling to
WorkflowRunner.ts, which introduced two new sentinel-error predicates —isAgentReportWaitTimeoutErrorandisWorkflowAgentHardTimeoutError— each re-spelling the identicalerror instanceof Error && error.name === "<name>"shape already used by the pre-existingisForegroundWaitBackgroundedError. With three byte-identical guards now in the file, extracted the shared check into a module-levelisErrorWithName(error, name)helper and delegated all three predicates to it.Behavior-preserving: each predicate still returns the same boolean as before (
isErrorWithNamereproduces the inline expression exactly). The otherinstanceof Errorchecks in the file testerror.messageinline rather thanerror.name, so they are intentionally left untouched.#3628 is a small, self-contained bug fix (default budget for model goals) with no low-risk dedup opportunity.
Validation
make static-checkis green for the touched code (ESLint,tsconfig+tsconfig.main.json, Prettier). (fmt-shell-checkis the only non-passing step, solely because theshfmtbinary is absent in this environment; no shell files are touched.)Risks
Minimal. The change is a pure local extraction of an identical boolean expression; no logic, types, or call semantics change.
Generated with
mux• Model:anthropic:claude-opus-4-8• Thinking:xhigh