Skip to content

Feat: Align Pi and OpenCode model family options - #256

Open
anthonyivn2 wants to merge 3 commits into
databricks:mainfrom
anthonyivn2:feat/align-pi-opencode-model-option
Open

Feat: Align Pi and OpenCode model family options#256
anthonyivn2 wants to merge 3 commits into
databricks:mainfrom
anthonyivn2:feat/align-pi-opencode-model-option

Conversation

@anthonyivn2

@anthonyivn2 anthonyivn2 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose OpenAI/Codex models in OpenCode alongside Claude, Gemini, and OSS
  • expose OSS models in Pi alongside Claude, OpenAI/Codex, and Gemini
  • route Pi OSS models through the MLflow Responses API so GLM and Kimi complete with valid stream termination
  • exclude incompatible gpt-oss model services from Codex discovery instead of exposing options that fail in Pi and OpenCode
  • extend focused and end-to-end coverage for discovery, provider config, selectors, defaults, and live OSS launches

Testing

  • .venv/bin/ruff check .
  • .venv/bin/pytest tests/test_agent_pi.py tests/test_agent_opencode.py tests/test_agents_init.py tests/test_databricks.py tests/test_cli.py tests/test_lint.py -q (471 passed)
  • live validation with a Databricks profile across representative Claude, OpenAI/Codex, Gemini, GLM, and Kimi models in both clients
  • exhaustive live per-model E2E for OpenCode and Pi (2 passed in 239.58s)

@anthonyivn2 anthonyivn2 changed the title Align Pi and OpenCode model family options Feat: Align Pi and OpenCode model family options Aug 2, 2026
@anthonyivn2
anthonyivn2 marked this pull request as ready for review August 2, 2026 11:40
@anthonyivn2

Copy link
Copy Markdown
Contributor Author

@rohita5l can I get you or the team to OK this?

Comment thread src/ucode/agents/pi.py
# Old provider names earlier ucode versions wrote; cleaned up on each write so
# users don't end up with stale entries pointing at routes that 400.
LEGACY_PROVIDER_NAMES = ("databricks-anthropic", "databricks-codex", "databricks-oss")
LEGACY_PROVIDER_NAMES = ("databricks-anthropic", "databricks-codex", "databricks-kimi")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where did kimi come from? I dont see a old ucode version that supported kimi?

Comment thread src/ucode/databricks.py
claude_models[family] = candidates[0]

codex_models = [m for m in ids if "gpt-" in m]
codex_models = [m for m in ids if "gpt-" in m and "gpt-oss-" not in m]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The gpt-oss exclusion only covers the UC path. The filter is in discover_model_services, but cli.py:426-427 falls back to discover_codex_models when the UC listing comes back empty for codex, and that path (discover_endpoints_with_api_type(...,"openai/v1/responses")) has no gpt-oss filter. So on a workspace without UC model-services, gpt-oss still reaches Pi/OpenCode and still fails the same way. Probably wants to live one layer down, or in both places

Comment thread tests/test_agent_pi.py

written_providers = json.loads(config_file.read_text()).get("providers", {})
for legacy in ("databricks-anthropic", "databricks-codex", "databricks-oss"):
for legacy in ("databricks-anthropic", "databricks-codex", "databricks-kimi"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This swap means the databricks-oss cleanup is no longer tested. The old version of this test proved that a stale databricks-oss entry (on openai-completions) got stripped on upgrade; retargeting it to databricks-kimi drops that guard right as the PR removes databricks-oss from LEGACY_PROVIDER_NAMES. Could we keep a case for it — a stale databricks-oss entry with oss_models empty, asserting it's gone after the
write? That's the scenario I'm unsure about in my other comment.

Comment thread tests/test_databricks.py
"opus": "system.ai.claude-opus-4-8",
"sonnet": "system.ai.claude-sonnet-4-6",
}
# gpt-oss is not Responses-compatible with Pi/OpenCode and must not

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This covers the exclusion on the UC path, but discover_codex_models (the fallback at cli.py:426-427 when the UC listing is empty for codex) has no gpt-oss filter and isn't tested here. Worth a case on that path too — it's the one where gpt-oss can still reach Pi/OpenCode.

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.

2 participants