Skip to content

Fix model selection for multi-agent configuration#161

Open
AnPod wants to merge 1 commit into
databricks:mainfrom
AnPod:fix/issue-59-model-selection
Open

Fix model selection for multi-agent configuration#161
AnPod wants to merge 1 commit into
databricks:mainfrom
AnPod:fix/issue-59-model-selection

Conversation

@AnPod

@AnPod AnPod commented Jun 15, 2026

Copy link
Copy Markdown

Fixes #59

Summary

  • Adds per-agent model selection from discovered Databricks Gateway models.
  • Preserves full Claude model options while keeping family defaults for compatibility.
  • Filters Codex availability to GPT-parseable models.
  • Updates Pi/OpenCode/Copilot model wiring and status output.
  • Updates CLI help and README wording for non-interactive agent/workspace selection.

Validation

  • git diff --check
  • uv run ruff check .
  • uv run ruff format --check src/ tests/
  • uv run pytest

Result: 780 passed, 30 skipped.

Copilot AI review requested due to automatic review settings June 15, 2026 17:48

Copilot AI 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.

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 thread src/ucode/databricks.py
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)
Comment thread src/ucode/databricks.py


def discover_model_services(
_CLAUDE_FAMILY_ORDER = ("opus", "sonnet", "haiku")
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.

No model picker during ucode configure — defaults to first discovered model

2 participants