Skip to content

fix(plan): resolve model from agent config in plan tools#18161

Closed
filipeandre wants to merge 1 commit intoanomalyco:devfrom
filipeandre:fix/plan-agent-model
Closed

fix(plan): resolve model from agent config in plan tools#18161
filipeandre wants to merge 1 commit intoanomalyco:devfrom
filipeandre:fix/plan-agent-model

Conversation

@filipeandre
Copy link

Summary

  • PlanExitTool now resolves the model for the build agent using Agent.get("build") config, falling back to the last session model if none is configured
  • PlanEnterTool does the same for the plan agent
  • Renames the internal getLastModel helper to lastModel (style) and extracts a resolveModel helper
  • Adds tests covering both the configured-model path and the fallback path

Motivation

When a user configures a specific model for the build or plan agent (e.g. agent.build.model = "openai/gpt-4o"), the plan tools were ignoring that config and always using the last model seen in the session. This PR wires up Agent.get() so the configured model is respected.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 18, 2026
@github-actions
Copy link
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

This suggests PR #18163 may be a duplicate or related PR addressing the exact same issue. You should verify whether this is an alternate version of the same fix or if both PRs should exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant