{"record":{"id":"ee80ee660427385e","repo":"Hmbown/CodeWhale","slug":"session-id-cannot-be-empty","errorCode":null,"errorMessage":"Session id cannot be empty","messagePattern":"Session id cannot be empty","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":912,"sourceCode":"        let durable = self.approval_receipt_store().load(&session.metadata.id)?;\n        if !durable.is_empty() {\n            session.approval_receipts = durable;\n        }\n        ApprovalReplay::from_receipts(&session.approval_receipts)\n            .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;\n        Ok(())\n    }\n\n    /// Reconstruct completed approvals and interrupted unmatched asks for one\n    /// session without consulting the model transcript.\n    pub(crate) fn replay_approvals(&self, session_id: &str) -> io::Result<ApprovalReplay> {\n        self.approval_receipt_store().replay(session_id)\n    }\n\n    fn validated_session_id<'a>(&self, id: &'a str) -> std::io::Result<&'a str> {\n        let trimmed = id.trim();\n        if trimmed.is_empty() {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                \"Session id cannot be empty\",\n            ));\n        }\n        if !trimmed\n            .chars()\n            .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')\n        {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                format!(\"Invalid session id '{id}'\"),\n            ));\n        }\n        if trimmed == SESSION_BOOT_OWNERS_STEM {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                format!(\"Session id '{trimmed}' collides with a reserved sessions file\"),\n            ));","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/session_manager.rs#L894-L930","documentation":"Guard in validated_session_id: the supplied session id was empty or whitespace after trimming. Session ids key the approval receipt store and transcript files; an empty id would collapse all sessions onto one storage slot, so replay/approval lookups fail fast with InvalidInput.","triggerScenarios":"Thrown at crates/tui/src/session_manager.rs:912 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a real, previously created session id.","Check upstream session creation/resolution for failures that yield empty ids."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}