{"record":{"id":"98715aab34c71f44","repo":"aaif-goose/goose","slug":"must-be-at-least-4096","errorCode":null,"errorMessage":"{} must be at least 4096","messagePattern":"(.+?) must be at least 4096","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/session/mod.rs","lineNumber":2717,"sourceCode":"            .expect(\"No provider configured. Run 'goose configure' first\")\n    };\n\n    // Try planner-specific model first, fall back to default model\n    let model = if let Ok(model) = config.get_param::<String>(\"GOOSE_PLANNER_MODEL\") {\n        model\n    } else {\n        println!(\"WARNING: GOOSE_PLANNER_MODEL not found. Using default model...\");\n        config\n            .get_goose_model()\n            .expect(\"No model configured. Run 'goose configure' first\")\n    };\n\n    let planner_context_limit = match env::var(GOOSE_PLANNER_CONTEXT_LIMIT)\n        .ok()\n        .map(|v| v.parse::<usize>())\n    {\n        Some(Ok(n)) if n >= 4096 => Some(n),\n        Some(Ok(_)) => anyhow::bail!(\"{} must be at least 4096\", GOOSE_PLANNER_CONTEXT_LIMIT),\n        Some(Err(e)) => anyhow::bail!(\"{}: {}\", GOOSE_PLANNER_CONTEXT_LIMIT, e),\n        None => None,\n    };\n\n    let model_config =\n        goose::model_config::model_config_from_user_config(&provider, model.as_str())?\n            .with_context_limit(planner_context_limit);\n    let extensions = goose::config::extensions::get_enabled_extensions_with_config(config);\n    let reasoner = create(&provider, extensions).await?;\n\n    Ok((reasoner, model_config))\n}\n\n/// Format elapsed time duration\n/// Shows seconds if less than 60, otherwise shows minutes:seconds\nfn format_elapsed_time(duration: std::time::Duration) -> String {\n    let total_secs = duration.as_secs();\n    if total_secs < 60 {","sourceCodeStart":2699,"sourceCodeEnd":2735,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/session/mod.rs#L2699-L2735","documentation":"GOOSE_PLANNER_CONTEXT_LIMIT, when set, must parse as usize and be at least 4096 tokens. Smaller values are rejected because the planner needs a floor of context to function; the env var name is interpolated into the message.","triggerScenarios":"Exporting GOOSE_PLANNER_CONTEXT_LIMIT=1024 (or any value below 4096) before any command that builds the planner, such as entering plan mode.","commonSituations":"Tuning copied from stale docs with a too-small number; leftover experimental values in a shell profile or .env.","solutions":["Set the variable to 4096 or higher (e.g. GOOSE_PLANNER_CONTEXT_LIMIT=8192)","Unset the variable to use the model's default context limit"],"exampleFix":"# before\nexport GOOSE_PLANNER_CONTEXT_LIMIT=1024\n# after\nexport GOOSE_PLANNER_CONTEXT_LIMIT=8192   # or: unset GOOSE_PLANNER_CONTEXT_LIMIT","handlingStrategy":"validation","validationCode":"const MIN: usize = 4096;\nif let Ok(v) = std::env::var(\"GOOSE_PLANNER_CONTEXT_LIMIT\") {\n    let n: usize = v.parse().expect(\"GOOSE_PLANNER_CONTEXT_LIMIT must be a number\");\n    assert!(n >= MIN, \"GOOSE_PLANNER_CONTEXT_LIMIT must be >= {}\", MIN);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the env var at script start, not after goose fails","Unset the variable when the default limit is acceptable","Remember 4096 is the hard floor for the planner"],"tags":["environment","config","planner","validation"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}