mirror of
https://github.com/block/buzz.git
synced 2026-10-30 14:01:37 +00:00
Fix Databricks V2 Unity Catalog Claude service routing without erasing verified model capabilities. - preserve exact provider-qualified record precedence for `data_workflow_tools.goose.goose-claude-opus-5-5`, including adaptive thinking, explicit `output_config.effort` (default medium), and signed native tool continuation - route other boundary-matched `claude-*` service components to Anthropic Messages while preserving the full FQN and advertising no unverified effort controls - keep GPT-5+ service components on OpenAI Responses and other uncurated FQNs on MLflow Chat Completions; catalog/schema text does not affect routing - keep Rust and TypeScript resolver precedence aligned and regenerate the 168-vector normative corpus Validation at `1204f1eacff17ebe05eb2bba06b5eee210e21c25`: - `cargo test -p buzz-agent` - `pnpm -C desktop test` — 6,628 passed - `pnpm -C desktop typecheck` - `cargo fmt --all -- --check` - `cargo clippy -p buzz-agent --all-targets -- -D warnings` - `just test-unit` — passed on isolated rerun - pre-push file-size, desktop check, desktop typecheck, desktop tests, and Tauri checks passed; the repository-wide Rust lane exited without identifying a failing test in two concurrent hook runs, while its isolated `just test-unit` rerun passed --------- Signed-off-by: Kalvin Chau <kalvin@block.xyz> Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
64 lines
2.2 KiB
Rust
64 lines
2.2 KiB
Rust
//! UC fallback routing preserves model identity; GPT routes retain neutral effort,
|
||
//! while uncurated Claude routes intentionally advertise no effort controls.
|
||
use buzz_agent::model_capabilities::{resolve, DatabricksV2Route};
|
||
|
||
#[test]
|
||
fn gpt_fqn_route_preserves_neutral_capabilities() {
|
||
let fallback = resolve("databricks_v2", "catalog.schema.unknown");
|
||
for model in [
|
||
"catalog.schema.goose-gpt-6-astra",
|
||
"catalog.schema.gpt-5",
|
||
"catalog.schema.goose-gpt-5-5",
|
||
"catalog.schema.gpt-10",
|
||
"catalog.schema.GOOSE-GPT-6-ASTRA",
|
||
"catalog.schema.team-gpt-6-astra",
|
||
] {
|
||
let got = resolve(" DATABRICKS-V2 ", model);
|
||
assert_eq!(
|
||
got.databricks_v2_wire_route,
|
||
DatabricksV2Route::OpenaiResponses,
|
||
"{model}"
|
||
);
|
||
assert_eq!(got.thinking_mode, fallback.thinking_mode, "{model}");
|
||
assert_eq!(got.supported_efforts, fallback.supported_efforts, "{model}");
|
||
assert_eq!(got.default_effort, fallback.default_effort, "{model}");
|
||
assert_eq!(
|
||
got.normalization_policy, fallback.normalization_policy,
|
||
"{model}"
|
||
);
|
||
assert_eq!(got.registry_label, None, "{model}");
|
||
}
|
||
}
|
||
|
||
#[test]
|
||
fn unrelated_fqns_do_not_select_family_routes() {
|
||
for model in [
|
||
"gpt-6.schema.other",
|
||
"catalog.gpt-5.other",
|
||
"catalog.schema.mygpt-6-astra",
|
||
"catalog.schema.gpt-4",
|
||
"catalog.schema.gpt-4o",
|
||
"catalog.schema.gpt-6x",
|
||
"catalog.schema.gpt-oss-120b",
|
||
"catalog.schema.gpt-",
|
||
"catalog.schema.gpt-6",
|
||
"catalog.schema.gpt-4294967296",
|
||
"catalog.schema.kimi-k3",
|
||
] {
|
||
assert_eq!(
|
||
resolve("databricks_v2", model).databricks_v2_wire_route,
|
||
DatabricksV2Route::MlflowChat,
|
||
"{model}"
|
||
);
|
||
}
|
||
// The new rule is not an endpoint-family or cross-provider capability change.
|
||
assert_eq!(
|
||
resolve("databricks_v2", "goose-gpt-6-astra").databricks_v2_wire_route,
|
||
DatabricksV2Route::MlflowChat
|
||
);
|
||
assert_eq!(
|
||
resolve("openai", "catalog.schema.goose-gpt-6-astra").databricks_v2_wire_route,
|
||
DatabricksV2Route::NotApplicable
|
||
);
|
||
}
|