feat(codex): support amazon_bedrock Model Provider Services that expose OpenAI-compatible models

Open Beginner friendly
#454 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, python
Domain
backend, cloud

Research direction

Start in src/ucode/databricks.py at _TOOL_PROVIDER_TYPES and the resolve_provider_service and service_usable_for_tool checks. Verify the existing provider-routing behavior, then confirm that codex accepts an amazon_bedrock service with OpenAI-compatible models while Claude routing still requires Claude targets.

Written by the indexing model from the issue text.

Description

Problem

ucode codex --provider <bedrock-mps> fails with:

ERROR Model provider service '<name>' is a 'amazon_bedrock' provider, which codex can't route to (supported: openai).

This happens even when the Bedrock MPS exposes OpenAI-compatible models, because _TOOL_PROVIDER_TYPES hardcodes codex to only ("openai",), and a secondary check in resolve_provider_service rejects any Bedrock service that doesn't declare Claude model targets.

Root cause

Two places in src/ucode/databricks.py prevent this from working:

  1. _TOOL_PROVIDER_TYPES (~line 2097) — "codex": ("openai",) never matches amazon_bedrock.
  2. Bedrock-Claude-targets guard in resolve_provider_service and service_usable_for_tool — rejects any Bedrock MPS without Claude targets, regardless of which tool is asking.

Codex uses the OpenAI-compatible endpoint. Bedrock exposes this same endpoint for non-Claude models (e.g. Titan, GPT-class models hosted on Bedrock). There's no reason to require Claude targets when codex is the active tool.

Fix

  • Add "amazon_bedrock" to codex's allowed types in _TOOL_PROVIDER_TYPES.
  • Gate the "exposes no Claude models" check on tool == "claude" in both resolve_provider_service and service_usable_for_tool.

PR forthcoming.

Dominant language
Python
Stars
97
Forks
75
Avg merge
1d 9h
Merged PRs (30d)
193

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/unity-gateway

All issues in databricks/unity-gateway

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.