{"record":{"id":"edade8b0c8f45479","repo":"zeroclaw-labs/zeroclaw","slug":"provider-ref-no-context-window-set-will-use","errorCode":null,"errorMessage":"{$provider_ref}: no context_window set — will use {$fallback} token fallback when selected; likely far below this model's real limit; set context_window on this profile","messagePattern":"(.+?): no context_window set — will use (.+?) token fallback when selected; likely far below this model's real limit; set context_window on this profile","errorType":"console","errorClass":"DiagItem","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/doctor/mod.rs","lineNumber":1188,"sourceCode":"            match entry.context_window {\n                Some(0) => items.push(DiagItem::error(\n                    cat,\n                    crate::i18n::get_required_cli_string_with_args(\n                        \"cli-doctor-context-window-zero\",\n                        &[(\"provider_ref\", &label)],\n                    ),\n                )),\n                Some(context_window) => items.push(DiagItem::ok(\n                    cat,\n                    crate::i18n::get_required_cli_string_with_args(\n                        \"cli-doctor-context-window-ok\",\n                        &[\n                            (\"provider_ref\", &label),\n                            (\"context_window\", &context_window.to_string()),\n                        ],\n                    ),\n                )),\n                None => items.push(DiagItem::warn(\n                    cat,\n                    crate::i18n::get_required_cli_string_with_args(\n                        \"cli-doctor-context-window-unset\",\n                        &[\n                            (\"provider_ref\", &label),\n                            (\n                                \"fallback\",\n                                &UNCONFIGURED_CONTEXT_WINDOW_FALLBACK.to_string(),\n                            ),\n                        ],\n                    ),\n                )),\n            }\n\n            // Temperature range\n            match entry.temperature {\n                Some(temperature) if (0.0..=2.0).contains(&temperature) => {\n                    items.push(DiagItem::ok(","sourceCodeStart":1170,"sourceCodeEnd":1206,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/doctor/mod.rs#L1170-L1206","documentation":"Provider profiles without an explicit `context_window` fall back to a small built-in token budget when selected. Doctor warns that this fallback is likely far below the model's real limit, which silently shrinks usable context and the recovery budget. (An explicit zero is separately invalid; unset is this warning.)","triggerScenarios":"A providers entry omits `context_window`; doctor reports the fallback value that will apply when that profile is selected.","commonSituations":"New profiles copied without the field; models upgraded to larger-context versions without config updates; long-context workloads mysteriously truncating.","solutions":["Set `context_window` on the profile to the model's real token limit (e.g. 128000)","Check the model vendor's documentation for the exact limit","Re-run `zeroclaw doctor` and confirm the profile reports the explicit window"],"exampleFix":"# before\n[providers.openai]\nmodel = \"gpt-4o\"\n\n# after\n[providers.openai]\nmodel = \"gpt-4o\"\ncontext_window = 128000","handlingStrategy":"validation","validationCode":"import tomllib\n\ncfg = tomllib.load(open('zeroclaw.toml', 'rb'))\nfor name, p in cfg.get('providers', {}).items():\n    if 'context_window' not in p:\n        print(f'warn: {name} will use the small token fallback')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set context_window explicitly for every model you configure","Update context_window whenever you switch to a larger-context model"],"tags":["zeroclaw","doctor","config","context-window"],"backgroundTag":"context-window-unset","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}