1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Provenance of a route's `tool_mode_parity` verdict (#5885).
use super::model::ToolModeParitySource;
use super::{clear_user_overrides, lookup};
/// #5885: a route whose parity verdict nobody wrote down must say so.
///
/// `text_only` used to arrive identically whether a capability row stated
/// it or the `native_tools = false` fallback computed it, so a consumer
/// gating on the verdict could not tell a finding from a default. Both of
/// these resolve to `text_only`; only one of them is anybody's claim.
#[test]
fn tool_mode_parity_reports_whether_anyone_declared_it() {
clear_user_overrides();
// Reported in #5885. No row states a parity verdict for it.
let derived = lookup("fireworks", "accounts/fireworks/models/gpt-oss-120b");
assert_eq!(derived.tool_mode_parity.as_deref(), Some("text_only"));
assert_eq!(
derived.tool_mode_parity_source,
Some(ToolModeParitySource::Derived)
);
// Same verdict, but authored on the row rather than computed.
let declared = lookup("llamacpp", "qwen3.6-35b-a3b");
assert_eq!(declared.tool_mode_parity.as_deref(), Some("text_only"));
assert_eq!(
declared.tool_mode_parity_source,
Some(ToolModeParitySource::Declared)
);
// An unmatched route has no verdict at all, so it has no provenance
// either -- distinct from "derived", which is a computed answer.
let unmatched = lookup("no-such-provider", "no-such-model");
assert_eq!(unmatched.tool_mode_parity, None);
assert_eq!(unmatched.tool_mode_parity_source, None);
}