🤖 fix: apply default budget for model goals#3628
Merged
Merged
Conversation
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
LeonidasZhak
pushed a commit
to LeonidasZhak/mux
that referenced
this pull request
Jun 30, 2026
## 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. Auto-cleanup checkpoint: d3b835a This PR currently contains one cleanup against `main`: 1. `src/node/services/workflows/WorkflowRunner.ts` — extract the duplicated `error instanceof Error && error.name === ...` sentinel-error guard into a shared `isErrorWithName(error, name)` helper. ## This pass This is the first pass of a fresh auto-cleanup PR (the prior one, coder#3606, merged at checkpoint `620c2a66`). Considered the new `main` commits since that checkpoint: - coder#3625 (`feat: add workflow agent graceful timeouts`) - coder#3628 (`fix: apply default budget for model goals`) coder#3625 added agent graceful-timeout handling to `WorkflowRunner.ts`, which introduced two new sentinel-error predicates — `isAgentReportWaitTimeoutError` and `isWorkflowAgentHardTimeoutError` — each re-spelling the identical `error instanceof Error && error.name === "<name>"` shape already used by the pre-existing `isForegroundWaitBackgroundedError`. With three byte-identical guards now in the file, extracted the shared check into a module-level `isErrorWithName(error, name)` helper and delegated all three predicates to it. Behavior-preserving: each predicate still returns the same boolean as before (`isErrorWithName` reproduces the inline expression exactly). The other `instanceof Error` checks in the file test `error.message` inline rather than `error.name`, so they are intentionally left untouched. coder#3628 is a small, self-contained bug fix (default budget for model goals) with no low-risk dedup opportunity. ## Validation - `make static-check` is green for the touched code (ESLint, `tsconfig` + `tsconfig.main.json`, Prettier). (`fmt-shell-check` is the only non-passing step, solely because the `shfmt` binary 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`_ <!-- mux-attribution: model=anthropic:claude-opus-4-8 thinking=xhigh --> Co-authored-by: mux-bot[bot] <264182336+mux-bot[bot]@users.noreply.github.com>
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
Model-created
set_goalcalls now inherit the effective positive default goal budget even when user-authored goal forms allow omitted budgets to mean “no budget”. This prevents an omitted model budget/turn cap from unexpectedly resolving to an unbounded goal and failing before the workspace/global defaults can apply.Background
The
set_goaltool description says omitted or null budget/turn fields use the effective workspace goal defaults. In practice, the model-specific resolver still respectedalwaysRequireExplicitBudget: falselike user-facing forms do, so a model call with omitted bounds could resolve to no budget and no turn cap and trip the safety guard.Implementation
resolveModelGoalSetIntentso omitted/null model budgets always use the positive effective default budget when one exists.Validation
bun test src/common/utils/goals/resolveGoalSetIntent.test.ts src/node/services/tools/goal.test.tsmake typecheckMUX_ESLINT_CONCURRENCY=1 make static-checkRisks
Low. This only changes model-authored goal default resolution; user-authored goal creation still uses the existing tri-state semantics where blank budget fields can mean no budget when that setting is configured.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$3.93