You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rust/src/providers/chutes/mod.rs (extract_percent-style key scan) still applies an ambiguous fraction heuristic:
ifletSome(v) = map.get(key).and_then(Value::as_f64){returnSome(if v <= 1.0{ v *100.0}else{ v });}
The same bug class fixed in #247, upstream CodexBar steipete#3216, and #407: when the provider returns whole percentages, a real 1% satisfies v <= 1.0 and is rescaled to a false 100%, which surfaces as an exhausted/misleading quota state. The value 0.5 (a real half percent) is likewise ambiguous against a 0..1 fraction.
Acceptance
Determine the actual unit contract of the Chutes usage API fields (percent-style keys hit by the key scan at rust/src/providers/chutes/mod.rs).
If the API returns whole percentages in 0..=100, drop the v <= 1.0 { v * 100.0 } rescale and clamp to 0..=100 directly, mirroring the fix in fix(opencodego): keep API percent in 0..=100 units #407 (rust/src/providers/opencodego/usage_api.rs).
Add regression tests for 1 (stays 1%), 0.5 (stays 0.5), and 100.
If some Chutes fields genuinely are fractions, document the split explicitly at the parse site instead of the ambiguous heuristic.
Summary
rust/src/providers/chutes/mod.rs(extract_percent-style key scan) still applies an ambiguous fraction heuristic:The same bug class fixed in #247, upstream CodexBar steipete#3216, and #407: when the provider returns whole percentages, a real 1% satisfies
v <= 1.0and is rescaled to a false 100%, which surfaces as an exhausted/misleading quota state. The value0.5(a real half percent) is likewise ambiguous against a 0..1 fraction.Acceptance
percent-style keys hit by the key scan atrust/src/providers/chutes/mod.rs).0..=100, drop thev <= 1.0 { v * 100.0 }rescale and clamp to0..=100directly, mirroring the fix in fix(opencodego): keep API percent in 0..=100 units #407 (rust/src/providers/opencodego/usage_api.rs).1(stays 1%),0.5(stays 0.5), and100.References