Commit df27b52
authored
Add Model Provider Service routing for claude and codex (#174)
* Add Model Provider Service routing for claude and codex
Route claude/codex through a Unity Catalog Model Provider Service (external
Anthropic/OpenAI provider) via the Databricks-Model-Provider-Service header
instead of pinning a Databricks model.
- `ucode claude/codex --provider <catalog.schema.name>` routes per-invocation;
verifies the MPS feature is enabled and fails with a clear message if not.
- `ucode configure --model-provider` opt-in: lists matching services (anthropic
for claude, openai for codex), persists the choice per tool; launches then use
it automatically. Default configure path is unchanged.
- Provider mode pins no Databricks model (the agent's own canonical names route
through the header) and skips the heavy model discovery, fetching only a
web-search model.
- Friendlier USE CONNECTION permission error naming the service.
Co-authored-by: Isaac
* Trigger CI re-run after granting trace-table write access
Co-authored-by: Isaac
* Re-trigger CI after granting github-actions-sp UC schema access
Co-authored-by: Isaac
* Drop --model-provider flag; gate picker on interactive configure
Show the Model Provider Service picker only on the fully interactive
`ucode configure` path (no --agent/--agents). Naming agents signals
the non-interactive flow and stays on Databricks. Also fall back to
Databricks silently when the MPS feature isn't enabled on the workspace,
instead of printing a per-tool note.
* Rename provider picker options to Databricks Hosted / External Models
* CI: dump Claude tracing hook log on e2e tracing failure
* Force synchronous MLflow trace export in tracing hook
The Claude Stop hook (mlflow autolog claude stop-hook) is a short-lived
one-shot process. With MLflow's default async trace logging, the root
claude_code_conversation span is queued and the hook's best-effort flush
can lose it before the process exits — observed on CI runners, leaving an
orphaned llm span and no queryable trace (e2e tracing test failure).
Set MLFLOW_ENABLE_ASYNC_TRACE_LOGGING=false so export is synchronous.
* CI: probe MLflow span export on tracing failure
* CI: probe span export under mlflow 3.11.1 vs 3.12.0
* Add Amazon Bedrock model provider routing for claude
Bedrock-backed Model Provider Services expose Claude under provider-side
model ids (e.g. us.anthropic.claude-sonnet-4-6) rather than Claude Code's
canonical names, so ucode pins them explicitly via the ANTHROPIC_DEFAULT_*
env vars. Maps service targets to opus/sonnet/haiku families, preferring the
highest version and broadest-routing region profile, and validates that a
Bedrock service exposes at least one Claude model before routing to it.
Co-authored-by: Isaac
* Revert diagnostic CI probes in ci.yml
Co-authored-by: Isaac1 parent 1051b1a commit df27b52
16 files changed
Lines changed: 1240 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | | - | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
257 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
258 | 291 | | |
259 | 292 | | |
260 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
261 | 302 | | |
| 303 | + | |
262 | 304 | | |
263 | 305 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 306 | + | |
267 | 307 | | |
268 | 308 | | |
269 | 309 | | |
| |||
325 | 365 | | |
326 | 366 | | |
327 | 367 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
340 | 380 | | |
341 | 381 | | |
342 | 382 | | |
343 | 383 | | |
344 | 384 | | |
345 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
346 | 399 | | |
347 | 400 | | |
348 | 401 | | |
| |||
352 | 405 | | |
353 | 406 | | |
354 | 407 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 408 | + | |
360 | 409 | | |
361 | 410 | | |
362 | 411 | | |
| |||
440 | 489 | | |
441 | 490 | | |
442 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
443 | 507 | | |
444 | 508 | | |
445 | 509 | | |
| |||
470 | 534 | | |
471 | 535 | | |
472 | 536 | | |
473 | | - | |
| 537 | + | |
474 | 538 | | |
475 | 539 | | |
476 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
138 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
163 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
164 | 189 | | |
165 | 190 | | |
166 | 191 | | |
| |||
244 | 269 | | |
245 | 270 | | |
246 | 271 | | |
247 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
248 | 278 | | |
249 | 279 | | |
250 | 280 | | |
| |||
254 | 284 | | |
255 | 285 | | |
256 | 286 | | |
| 287 | + | |
| 288 | + | |
257 | 289 | | |
258 | 290 | | |
259 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| |||
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
136 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
| |||
143 | 156 | | |
144 | 157 | | |
145 | 158 | | |
| 159 | + | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| |||
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
159 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
293 | 309 | | |
294 | 310 | | |
295 | 311 | | |
296 | | - | |
| 312 | + | |
297 | 313 | | |
298 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
299 | 318 | | |
300 | 319 | | |
301 | 320 | | |
| |||
305 | 324 | | |
306 | 325 | | |
307 | 326 | | |
308 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
309 | 332 | | |
310 | 333 | | |
311 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
312 | 341 | | |
313 | 342 | | |
314 | 343 | | |
| |||
317 | 346 | | |
318 | 347 | | |
319 | 348 | | |
320 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
321 | 354 | | |
322 | 355 | | |
323 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
324 | 361 | | |
325 | 362 | | |
326 | 363 | | |
| |||
0 commit comments