{"record":{"id":"45533a78c05f952c","repo":"datawhalechina/hello-agents","slug":"summary-not-found","errorCode":null,"errorMessage":"Summary not found","messagePattern":"Summary not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"info","filePath":"Co-creation-projects/tino-chen-HelloClaw/src/api/session.py","lineNumber":327,"sourceCode":"        )\n        for s in summaries\n    ])\n\n\n@router.get(\"/summaries/{filename}\")\nasync def get_session_summary(filename: str):\n    \"\"\"获取会话总结内容\n\n    Args:\n        filename: 总结文件名\n    \"\"\"\n    agent = get_agent()\n    if not agent:\n        raise HTTPException(status_code=500, detail=\"Agent not initialized\")\n\n    content = agent.workspace.load_session_summary(filename)\n    if content is None:\n        raise HTTPException(status_code=404, detail=\"Summary not found\")\n\n    return {\"filename\": filename, \"content\": content}\n","sourceCodeStart":309,"sourceCodeEnd":330,"githubUrl":"https://github.com/datawhalechina/hello-agents/blob/606a07d341a47be773fab7f4b71177f53f96b2c3/Co-creation-projects/tino-chen-HelloClaw/src/api/session.py#L309-L330","documentation":"Raised by GET /api/session/summaries/{filename} when agent.workspace.load_session_summary(filename) returns None — no summary file with that name exists in the workspace's summaries directory. Summaries are only produced when a session is closed with summarize enabled, so most filenames will legitimately 404.","triggerScenarios":"GET /api/session/summaries/<file> with a date that has no summary yet; wrong extension or exact filename mismatch; requesting a summary right after session creation before the summary was generated; summaries wiped by a reset.","commonSituations":"UI deep-links to a summary by guessing the filename pattern; race where the client requests the summary while the summarization LLM call is still running; filename taken from an old workspace.","solutions":["GET /api/session/summaries/list first and only open filenames it returns","After triggering summarization, wait for the completion signal before fetching the file","Treat 404 as 'not generated yet' with a friendly empty state"],"exampleFix":"// before\nconst c = await api.getSummary(`${date}.md`);\n// after\nconst list = await api.listSummaries();\nif (!list.some(f => f.filename === `${date}.md`)) return null; // not generated yet\nconst c = await api.getSummary(`${date}.md`);","handlingStrategy":"validation","validationCode":"const files = await listSummaries();\nconst target = files.find(f => f.filename === wanted);\nif (!target) return null; // summary not generated yet","typeGuard":null,"tryCatchPattern":"try { return await getSummary(name); }\ncatch (e) { if (e.status === 404) return null; throw e; }","preventionTips":["Only open filenames returned by /summaries/list","Wait for the summarization-completion event before fetching the file"],"tags":["fastapi","session","summary","http-404"],"backgroundTag":null,"analyzedSha":"606a07d341a47be773fab7f4b71177f53f96b2c3","analyzedAt":"2026-08-14T22:57:27.446Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}