Add ucode run: recommend-model-driven session startup#228
Open
lilly-luo wants to merge 7 commits into
Open
Conversation
New top-level `ucode run` command that queries the AI Gateway's recommendModel endpoint for the caller's usage tier, then launches the matching harness pinned to the chosen model: - Discover all workspace models, POST them to /api/ai-gateway/v2/coding-agent-configs:recommendModel. - 1 model -> auto-launch (no prompt); 2+ -> interactive picker; empty -> guidance to use `ucode <harness>`; error -> exit non-zero. - Map model family -> harness: claude->claude, gpt->codex, kimi/glm->codex, gemini->gemini. - Extend codex to route OSS models (kimi/glm) via the MLflow chat-completions gateway (wire_api="chat") instead of the Responses route; GPT models unchanged. Adds recommend_coding_agent_models, is_oss_model, build_oss_base_url (databricks.py) and harness_for_model (agents/__init__.py), with unit tests for the endpoint, the harness map, codex OSS routing, and CLI routing. Co-authored-by: Isaac
When only one model is recommended, launch it silently instead of printing a note — the Model/Harness banner already shows what launched. Record the auto-launch in the debug log (UCODE_DEBUG=1) instead. Co-authored-by: Isaac
Co-authored-by: Isaac
lilly-luo
force-pushed
the
lilly/ucode-run-recommend-model
branch
from
July 21, 2026 16:45
12d5b25 to
d337c31
Compare
Codex CLI dropped support for `wire_api = "chat"` (openai/codex discussion 7782), so the OSS chat-completions route added for kimi/glm now fails to load with "`wire_api = "chat"` is no longer supported". Route every codex-harness model — including OSS families — through the Responses gateway, matching what all other codex models already use. Co-authored-by: Isaac
lilly-luo
force-pushed
the
lilly/ucode-run-recommend-model
branch
from
July 21, 2026 16:46
d337c31 to
ce764db
Compare
`ucode run` owns model selection via the recommendation flow, so a caller-supplied `--model` is rejected up front with actionable guidance. For the claude harness — which deliberately doesn't pin a model in its settings — prepend `--model <resolved_model>` to the launch argv so the session starts on the model the user picked instead of Claude Code's default. Co-authored-by: Isaac
…o constant `build_oss_base_url` lost its only shared caller when codex OSS routing was reverted, leaving a single-use indirection; inline it back into build_opencode_base_urls. Extract the recommendModel API path into a module constant. Co-authored-by: Isaac
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.
New top-level
ucode runcommand that queries the AI Gateway's recommendModel endpoint for the caller's usage tier, then launches the matching harness pinned to the chosen model:ucode <harness>; error -> exit non-zero.Adds recommend_coding_agent_models, is_oss_model, build_oss_base_url (databricks.py) and harness_for_model (agents/init.py), with unit tests for the endpoint, the harness map, codex OSS routing, and CLI routing.
Co-authored-by: Isaac
https://www.loom.com/share/bcd48dcbd1ba46968a9ad05dcf82ab74
prd: https://docs.google.com/document/d/1oYG1MidFTmvNa5Je2wf-iVDxzCxBuo4_8ve4ZdoTuBo/edit?tab=t.auf5j86b6558#bookmark=id.hx4w8nr9p91q
impl plan: https://docs.google.com/document/d/1xdcwvg1oGITsbYRmzPn9lE5vrdD8AhFqgbHNeYR09ZY/edit?tab=t.0