From e9e5104a73ea25af0f9de69f5f7ac174736963c8 Mon Sep 17 00:00:00 2001 From: TheArchitectit Date: Sat, 25 Jul 2026 00:47:42 -0500 Subject: [PATCH] fix: model_token_limit catch-all returns None for unknown models Restores the fix from @Offwhite-Del that was lost during rebase. Unknown models now return None so preflight skips the context-window check and lets the API enforce its own limits. --- rust/crates/api/src/providers/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rust/crates/api/src/providers/mod.rs b/rust/crates/api/src/providers/mod.rs index 8f846cbe..002c9571 100644 --- a/rust/crates/api/src/providers/mod.rs +++ b/rust/crates/api/src/providers/mod.rs @@ -689,12 +689,9 @@ pub fn model_token_limit(model: &str) -> Option { max_output_tokens: 16_384, context_window_tokens: 200_000, }), - // Generic fallback for any model: assume 128K context, 8K output. - // This prevents the "unknown model → no limit check → context overflow" bug. - _ => Some(ModelTokenLimit { - max_output_tokens: 8_192, - context_window_tokens: 131_072, - }), + // Unknown models return None so preflight skips the context-window + // check and lets the API enforce its own limits. + _ => None, } }