Fix model selection for multi-agent configuration#161
Open
AnPod wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds per-agent model selection across configuration, state hydration, and tool defaults, with expanded discovery outputs to support a full Claude “selectable models” list.
Changes:
- Introduces shared model-selection helpers (availability + persisted selections) and integrates them into state hydration and agent default model resolution.
- Extends Databricks model discovery to return full selectable Claude options (UC model-services and legacy Anthropic listing).
- Updates CLI configuration/status flows and tests to prompt for/persist per-tool selected models and display selected model in
ucode status.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/ucode/model_selection.py |
New shared helpers for available/selected model resolution across tools |
src/ucode/databricks.py |
Adds “with_options” discovery APIs returning full Claude selectable lists |
src/ucode/cli.py |
Prompts/persists per-tool model selections; shows model in status |
src/ucode/state.py |
Uses shared selection helpers when building hydrated per-agent state |
src/ucode/ui.py |
Adds interactive prompt_for_model picker |
src/ucode/agents/* |
Default model functions now respect persisted selected_models |
tests/* |
Adds coverage for model selection behaviors and new discovery/CLI flows |
README.md |
Clarifies picker wording for non-interactive agent/workspace selection flags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
+79
| if tool == "copilot": | ||
| return _unique(claude_model_options(state) + _string_list(state.get("codex_models"))) | ||
| if tool == "pi": | ||
| return _unique( | ||
| claude_model_options(state) | ||
| + _string_list(state.get("codex_models")) | ||
| + _string_list(state.get("gemini_models")) | ||
| ) |
Comment on lines
+1167
to
+1173
| def _sort_claude_model_options(model_ids: list[str]) -> list[str]: | ||
| def _key(model_id: str) -> tuple: | ||
| family = _claude_family(model_id) | ||
| family_index = _CLAUDE_FAMILY_ORDER.index(family) if family else len(_CLAUDE_FAMILY_ORDER) | ||
| return (family_index, model_version_sort_key(model_id)) | ||
|
|
||
| return sorted([model_id for model_id in set(model_ids) if _claude_family(model_id)], key=_key) |
|
|
||
|
|
||
| def discover_model_services( | ||
| _CLAUDE_FAMILY_ORDER = ("opus", "sonnet", "haiku") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #59
Summary
Validation
Result: 780 passed, 30 skipped.