Skip to content

Fix primary agent model precedence#3428

Open
afafara wants to merge 1 commit into
code-yeongyu:devfrom
afafara:fix-primary-agent-model-precedence
Open

Fix primary agent model precedence#3428
afafara wants to merge 1 commit into
code-yeongyu:devfrom
afafara:fix-primary-agent-model-precedence

Conversation

@afafara

@afafara afafara commented Apr 14, 2026

Copy link
Copy Markdown

Summary

  • let Atlas and Sisyphus keep the runtime-selected model when agent config or category overrides also define a model
  • restore the resolved model and variant after applying overrides so primary-agent model selection is not clobbered
  • add regression coverage for direct model overrides and category-based overrides in src/agents/utils.test.ts

Testing

  • bun test src/agents/utils.test.ts

Summary by cubic

Fix model precedence for primary agents so the UI-selected model always wins over agent and category overrides. Atlas and Sisyphus now keep the runtime-selected model and restore the resolved variant when applicable.

  • Bug Fixes
    • Preserve uiSelectedModel for atlas and sisyphus even when overrides specify a model or category.
    • After applying overrides, re-apply the resolved model and variant (if any) to prevent clobbering.
    • Add regression tests for direct model overrides and category-based overrides to lock precedence.

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

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@afafara

afafara commented Apr 14, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@afafara

afafara commented Apr 14, 2026

Copy link
Copy Markdown
Author

recheck

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

Copy link
Copy Markdown

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.

Requires human review: This PR deliberately flips model precedence logic, which is a functional change that alters existing behavior and breaks previous test expectations.

@kithawk

kithawk commented Apr 14, 2026

Copy link
Copy Markdown

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Apr 14, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-bot]

PR sweep first-pass triage on dev.

  • Author: afafara
  • Title: Fix primary agent model precedence
  • Closing issues: none detected
  • Review decision: none yet
  • Mergeable state: MERGEABLE
  • CI status: green / no failing checks

Awaiting a first-pass review.

Assigning code-yeongyu so the maintainer can prioritize a focused review of this PR. If the linked issue above has been triaged, the verdict there is the authoritative direction for this change.

@code-yeongyu code-yeongyu self-assigned this May 16, 2026
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-bot] Hi afafara. 🙏 Thanks for putting this together; I read through the entire patch and I want to be transparent about why I'm not landing it without a maintainer pass.

What the code does, accurately

  • atlas-agent.ts and sisyphus-agent.ts now always pass uiSelectedModel into applyModelResolution, capture the resolution result, and then re-apply model + variant onto orchestratorConfig / sisyphusConfig after applyOverrides, but only when normalizeModel(uiSelectedModel) is defined. The mechanical effect is "if the user actively selected a model in the UI, the UI model wins; otherwise the configured override wins".
  • The new test "uiSelectedModel takes priority over sisyphus category model override" pins the category-override branch in addition to the direct model-override branch.

Where I'd like maintainer input before this lands

This PR inverts the precedence that the existing tests on dev explicitly named:

  • dev currently has test("user config model takes priority over uiSelectedModel for sisyphus", ...) and the matching for atlas test, asserting that agents.sisyphus.model === "google/antigravity-claude-opus-4-5-thinking" when the user has both a UI selection and overrides.sisyphus.model. Those test names are themselves a deliberate contract.
  • This PR keeps the same test cases but flips the assertions to "openai/gpt-5.4", i.e. "UI wins". It also renames the tests to "uiSelectedModel takes priority over <agent> config model override".

That's a semantic change, not a bug fix. The existing behavior on dev was an intentional design decision (the test names spell it out), and reversing it changes behavior for every user who relied on agents.sisyphus.model / agents.atlas.model overrides in oh-my-opencode.jsonc. Until code-yeongyu confirms the intended precedence has changed, I want to leave this as a discussion rather than a merge.

Two things that would unblock

  1. A short confirmation from a maintainer that the new precedence ("UI selection wins over agent/category model overrides for primary agents") is the desired contract going forward.
  2. If yes, a doc / changelog blurb noting the behavior change so existing users can migrate or remove their override entries.

Smaller observations

  • The model string updates in the test (gpt-5.5gpt-5.4) probably need rebasing against current dev, where gpt-5.5 is the in-use model string.
  • The normalizeModel(uiSelectedModel) !== undefined check is a clean way to discriminate "UI explicitly set" from "no UI selection". I'd lean toward extracting that into a small named helper (hasExplicitUiSelection) since both atlas and sisyphus agents repeat the same pattern, but that's a follow-up, not a blocker.
  • The { variant: _ignoredVariant, ...configWithoutVariant } pattern reads cleanly; nice job avoiding a mutation.

Once the precedence direction is confirmed by a maintainer, I'm happy to come back and finish the review.

@code-yeongyu code-yeongyu force-pushed the dev branch 2 times, most recently from eb25d29 to 2bfad49 Compare May 23, 2026 16:00
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.

4 participants