Skip to content

fix: prevent overwriting existing agent models#1494

Merged
tusharmath merged 7 commits into
mainfrom
custom-agent-model-selection
Sep 6, 2025
Merged

fix: prevent overwriting existing agent models#1494
tusharmath merged 7 commits into
mainfrom
custom-agent-model-selection

Conversation

@tusharmath

@tusharmath tusharmath commented Sep 6, 2025

Copy link
Copy Markdown
Collaborator

fixes #1440

@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label Sep 6, 2025
@openhands-ai

openhands-ai Bot commented Sep 6, 2025

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • autofix.ci
    • ci

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #1494 at branch `custom-agent-model-selection`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@tusharmath tusharmath changed the title fix: prevent overwriting existing agent models in set_model method fix: prevent overwriting existing agent models Sep 6, 2025
fn test_subscriptions_with_matching_agents() {
use pretty_assertions::assert_eq;

// Arrange

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There appears to be an inconsistency in the test assertion on line 785. The test comment on line 769 correctly states "Check that agent1's compact.model was not overridden to the workflow model", but the assertion for agent1.model still expects it to equal ModelId::new("workflow-model").

This contradicts the new behavior where existing models should be preserved. The assertion should verify that agent1.model maintains its original value (which appears to be "old-agent-model" based on the agent initialization), rather than being overwritten with the workflow model.

To align with the intended behavior change, this assertion should be updated to check that the agent's original model is preserved.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tusharmath
tusharmath merged commit f697afa into main Sep 6, 2025
9 checks passed
@tusharmath
tusharmath deleted the custom-agent-model-selection branch September 6, 2025 13:45
laststylebender14 pushed a commit that referenced this pull request Sep 11, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: the model config in custom agent does not work.

1 participant