Skip to content

🤖 fix: apply default budget for model goals#3628

Merged
ThomasK33 merged 1 commit into
mainfrom
config-db24
Jun 24, 2026
Merged

🤖 fix: apply default budget for model goals#3628
ThomasK33 merged 1 commit into
mainfrom
config-db24

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Model-created set_goal calls 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_goal tool description says omitted or null budget/turn fields use the effective workspace goal defaults. In practice, the model-specific resolver still respected alwaysRequireExplicitBudget: false like 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

  • Updated resolveModelGoalSetIntent so omitted/null model budgets always use the positive effective default budget when one exists.
  • Kept the safety guard for configurations whose effective defaults truly have no positive budget and no turn cap.
  • Clarified the guard error message and added coverage for the model-tool behavior.

Validation

  • bun test src/common/utils/goals/resolveGoalSetIntent.test.ts src/node/services/tools/goal.test.ts
  • make typecheck
  • MUX_ESLINT_CONCURRENCY=1 make static-check

Risks

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

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 6013bdd559

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit d3b835a Jun 24, 2026
24 checks passed
@ThomasK33 ThomasK33 deleted the config-db24 branch June 24, 2026 20:05
@mux-bot mux-bot Bot mentioned this pull request Jun 24, 2026
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>
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.

1 participant