Skip to content

fix(agents): preserve uiSelectedModel when agent override has no model (fixes #2351)#2788

Merged
code-yeongyu merged 1 commit intodevfrom
fix/2670-uiSelectedModel-nullification
Mar 24, 2026
Merged

fix(agents): preserve uiSelectedModel when agent override has no model (fixes #2351)#2788
code-yeongyu merged 1 commit intodevfrom
fix/2670-uiSelectedModel-nullification

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Mar 24, 2026

Fixes the second root cause from #2351 that PR #2670 missed.

Three agent builders used falsy checks that nullified uiSelectedModel:

  • sisyphusOverride?.model ?sisyphusOverride?.model !== undefined ?
  • orchestratorOverride?.model ?orchestratorOverride?.model !== undefined ?
  • !override?.modeloverride?.model === undefined

Supersedes #2670.


Summary by cubic

Preserves uiSelectedModel when an agent override exists without a model, preventing unwanted resets to default models. Replaces falsy checks with explicit undefined checks in the atlas, sisyphus, and general agent builders, fixing #2351.

Written for commit d8fe611. Summary will update on new commits.

Three agent builder files used falsy checks that incorrectly nullified
uiSelectedModel when override objects existed but had no model set:

- sisyphus-agent.ts: `?.model ?` → `?.model !== undefined ?`
- atlas-agent.ts: `?.model ?` → `?.model !== undefined ?`
- general-agents.ts: `!override?.model` → `override?.model === undefined`

This caused user model selection in web mode to revert to defaults.

Fixes #2351
@code-yeongyu code-yeongyu merged commit ee8735c into dev Mar 24, 2026
5 checks passed
@code-yeongyu code-yeongyu deleted the fix/2670-uiSelectedModel-nullification branch March 24, 2026 07:22
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Fixes truthiness bug by explicitly checking for undefined. This prevents empty strings or other falsy values in overrides from incorrectly triggering fallback logic.

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