{"record":{"id":"3918c7f50edf687d","repo":"zed-industries/zed","slug":"auto-compact-threshold-of-0-is-not-valid","errorCode":null,"errorMessage":"auto_compact threshold of 0 is not valid","messagePattern":"auto_compact threshold of 0 is not valid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_settings/src/agent_settings.rs","lineNumber":198,"sourceCode":"            .parse()\n            .with_context(|| format!(\"invalid auto_compact threshold percentage {raw:?}\"))?;\n        anyhow::ensure!(\n            value > 0.0 && value <= 100.0,\n            \"auto_compact threshold percentage must be between 0% and 100%, got {raw:?}\"\n        );\n        Ok(AutoCompactThreshold::Percentage(value / 100.0))\n    } else {\n        let tokens: i64 = trimmed.parse().with_context(|| {\n            format!(\n                \"invalid auto_compact threshold {raw:?}; \\\n                 expected a percentage like \\\"90%\\\" or an integer number of tokens\"\n            )\n        })?;\n        match tokens.cmp(&0) {\n            Greater => Ok(AutoCompactThreshold::TokensUsed(tokens as u64)),\n            Less => Ok(AutoCompactThreshold::TokensRemaining(tokens.unsigned_abs())),\n            Equal => {\n                anyhow::bail!(\"auto_compact threshold of 0 is not valid\")\n            }\n        }\n    }\n}\n\n#[derive(Clone, Debug, RegisterSetting)]\npub struct AgentSettings {\n    pub enabled: bool,\n    pub button: bool,\n    pub dock: DockPosition,\n    pub flexible: bool,\n    pub sidebar_side: SidebarDockPosition,\n    pub default_width: Pixels,\n    pub default_height: Pixels,\n    pub max_content_width: Option<Pixels>,\n    pub default_model: Option<LanguageModelSelection>,\n    pub subagent_model: Option<LanguageModelSelection>,\n    pub inline_assistant_model: Option<LanguageModelSelection>,","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_settings/src/agent_settings.rs#L180-L216","documentation":"Error \"auto_compact threshold of 0 is not valid\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_settings/src/agent_settings.rs:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}