{"record":{"id":"80bebbae91d88d8d","repo":"HKUDS/DeepTutor","slug":"oserror-message","errorCode":null,"errorMessage":"{OSError message}","messagePattern":"\\{OSError message\\}","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"deeptutor/api/routers/memory.py","lineNumber":721,"sourceCode":"        except OSError:\n            continue\n    return {\"surface\": surf, \"removed_files\": removed}\n\n\n@router.delete(\"/trace/{surface}/day/{day}\")\nasync def clear_trace_day(surface: str, day: str):\n    surf = _validate_surface(surface)\n    try:\n        parsed = date_cls.fromisoformat(day)\n    except ValueError:\n        raise HTTPException(status_code=400, detail=\"day must be YYYY-MM-DD\")\n    path = paths.trace_file(surf, parsed)\n    if not path.exists():\n        raise HTTPException(status_code=404, detail=\"no trace for that day\")\n    try:\n        path.unlink()\n    except OSError as exc:\n        raise HTTPException(status_code=500, detail=str(exc))\n    return {\"surface\": surf, \"day\": day, \"deleted\": True}\n\n\n# ── Snapshot (L1 workspace mirror) ───────────────────────────────────────\n\n\n@router.get(\"/snapshot/{surface}\")\nasync def get_snapshot(surface: str):\n    \"\"\"Return the current entity list for ``surface`` from workspace.\n\n    Snapshot is always derived live from workspace at call time. The response\n    also includes ``pending_changes`` — the diff vs the last persisted state.\n    Refresh commits these pending changes into ``changes.jsonl``.\n    \"\"\"\n    surf = _validate_surface(surface)\n    from deeptutor.services.memory import snapshot as snap\n\n    entities = snap.read_snapshot(surf)","sourceCodeStart":703,"sourceCodeEnd":739,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/memory.py#L703-L739","documentation":"Error \"{OSError message}\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/memory.py:721 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":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}