{"record":{"id":"e4ddda6691562825","repo":"odysseus-dev/odysseus","slug":"memory-item-memory-id-not-found","errorCode":null,"errorMessage":"Memory item {memory_id} not found","messagePattern":"Memory item (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/memory/memory_routes.py","lineNumber":513,"sourceCode":"            # numbering the model added so saved memories don't keep the prefix.\n            lines = [_strip_list_prefix(l.strip()) for l in raw.splitlines() if l.strip() and len(l.strip()) > 5]\n            return {\"suggestions\": [{\"text\": l, \"category\": \"fact\"} for l in lines[:20]], \"filename\": filename}\n        except Exception as e:\n            logger.error(f\"Memory import extraction failed: {e}\")\n            raise HTTPException(502, f\"LLM extraction failed: {str(e)}\")\n\n    @router.post(\"/{memory_id}/pin\")\n    def pin_memory(request: Request, memory_id: str, pinned: bool = Form(True)):\n        \"\"\"Pin or unpin a memory. Pinned memories are always included in context.\"\"\"\n        user = _owner(request)\n        all_mem = _load_for_update(memory_manager)\n        for i, memory in enumerate(all_mem):\n            if memory[\"id\"] == memory_id:\n                _verify_memory_owner(memory, user)\n                all_mem[i][\"pinned\"] = pinned\n                memory_manager.save(all_mem)\n                return {\"ok\": True, \"pinned\": pinned}\n        raise HTTPException(404, f\"Memory item {memory_id} not found\")\n\n    # Wildcard routes MUST come last — otherwise they swallow /import, /search, etc.\n    @router.get(\"/{memory_id}\")\n    def get_memory_item(request: Request, memory_id: str):\n        \"\"\"Get a specific memory item by ID.\"\"\"\n        user = _owner(request)\n        memories = memory_manager.load(owner=user)\n        for memory in memories:\n            if memory[\"id\"] == memory_id:\n                return {\"memory\": memory}\n\n        raise HTTPException(404, \"Memory not found\")\n\n    @router.put(\"/{memory_id}\")\n    def update_memory(request: Request, memory_id: str, text: str = Form(...), category: str = Form(None)):\n        \"\"\"Update an existing memory item with new text and optional category.\"\"\"\n        user = _owner(request)\n        all_mem = _load_for_update(memory_manager)","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/memory/memory_routes.py#L495-L531","documentation":"Error \"Memory item {memory_id} not found\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Refresh the memory list; the item may have been deleted.","Verify the memory id is correct."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}