Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies = [
# request, via the SDK's stdio server + streamable-HTTP client. Works against
# both mcp 1.x (httpx) and mcp 2.x (httpx2) — see mcp_proxy for the shared path.
"mcp>=1.28.0",
"pyyaml>=6.0.0",
"questionary>=2.0.0",
"tomlkit>=0.13.0",
"typer>=0.12.0",
Expand Down
23 changes: 19 additions & 4 deletions src/ucode/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
spinner,
)

from . import claude, codex, copilot, gemini, opencode, pi
from . import claude, codex, copilot, gemini, omp, opencode, pi
from .args import explicit_model_arg_value as explicit_model_arg_value

_MODULES = {
Expand All @@ -50,6 +50,7 @@
"opencode": opencode,
"copilot": copilot,
"pi": pi,
"omp": omp,
}

TOOL_SPECS: dict[str, ToolSpec] = {name: module.SPEC for name, module in _MODULES.items()}
Expand All @@ -68,13 +69,15 @@
"opencode": "opencode",
"copilot": "copilot",
"pi": "pi",
"omp": "omp",
"oh-my-pi": "omp",
}

DEFAULT_TOOL = "codex"
BUNDLE_VERSION = 1
_MANAGED_SETTINGS_TOOLS = {"claude", "codex"}

# ucode tool -> `databricks aitools` agent id. gemini/pi aren't supported.
# ucode tool -> `databricks aitools` agent id. gemini/pi/omp aren't supported.
AITOOLS_AGENT_TOKENS = {
"claude": "claude-code",
"codex": "codex",
Expand All @@ -86,7 +89,7 @@
def install_databricks_ai_tools_for_agents(tools: list[str], state: dict) -> None:
"""Install Databricks AI Tools for supported agents.

Gemini and Pi have no ``aitools`` support and are dropped.
Gemini, Pi, and Oh My Pi have no ``aitools`` support and are dropped.
"""
if state.get("databricks_ai_tools_enabled", True) is False:
return
Expand All @@ -100,7 +103,7 @@ def normalize_tool(tool: str) -> str:
normalized = TOOL_ALIASES.get(tool.strip().lower())
if not normalized:
raise RuntimeError(
f"Unsupported tool '{tool}'. Use one of: codex, claude, gemini, opencode, copilot, pi."
f"Unsupported tool '{tool}'. Use one of: codex, claude, gemini, opencode, copilot, pi, omp."
)
return normalized

Expand Down Expand Up @@ -439,6 +442,8 @@ def configure_tool(
result = copilot.write_tool_config(state, model)
elif tool == "pi":
result = pi.write_tool_config(state, model)
elif tool == "omp":
result = omp.write_tool_config(state, model)
else:
result = opencode.write_tool_config(state, model)
# gemini/opencode/copilot/pi return (state, token); codex/claude return state
Expand Down Expand Up @@ -469,6 +474,12 @@ def check_gateway_endpoint(state: dict, tool: str) -> bool:
or bool(state.get("codex_models"))
or bool(state.get("gemini_models"))
)
if tool == "omp":
return (
bool(state.get("claude_models"))
or bool(state.get("codex_models"))
or bool(state.get("gemini_models"))
)
return False


Expand All @@ -479,6 +490,7 @@ def check_gateway_endpoint(state: dict, tool: str) -> bool:
"gemini": ("gemini",),
"copilot": ("claude", "codex"),
"pi": ("claude", "codex", "gemini"),
"omp": ("claude", "codex", "gemini"),
}


Expand Down Expand Up @@ -667,6 +679,7 @@ def provider_permission_error(tool: str, state: dict, err: str) -> str:
def validate_all_tools(state: dict) -> None:
from rich.panel import Panel # local to avoid bumping module-level deps

from ucode.agents.omp import OMP_CONFIG_BACKUP_PATH, OMP_CONFIG_PATH
from ucode.agents.pi import PI_SETTINGS_BACKUP_PATH, PI_SETTINGS_PATH
from ucode.config_io import restore_file

Expand Down Expand Up @@ -700,6 +713,8 @@ def validate_all_tools(state: dict) -> None:
# Rollback settings.json for Pi
if tool == "pi":
restore_file(PI_SETTINGS_PATH, PI_SETTINGS_BACKUP_PATH, managed)
if tool == "omp":
restore_file(OMP_CONFIG_PATH, OMP_CONFIG_BACKUP_PATH, managed)
available_tools.remove(tool)
state["available_tools"] = available_tools
save_state(state)
Expand Down
Loading