datawhalechina/hello-agents · info · HTTPException

Summary not found

Error message

Summary not found

What it means

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.

Source

Thrown at Co-creation-projects/tino-chen-HelloClaw/src/api/session.py:327

        )
        for s in summaries
    ])


@router.get("/summaries/{filename}")
async def get_session_summary(filename: str):
    """获取会话总结内容

    Args:
        filename: 总结文件名
    """
    agent = get_agent()
    if not agent:
        raise HTTPException(status_code=500, detail="Agent not initialized")

    content = agent.workspace.load_session_summary(filename)
    if content is None:
        raise HTTPException(status_code=404, detail="Summary not found")

    return {"filename": filename, "content": content}

View on GitHub (pinned to 606a07d341)

Solutions

  1. GET /api/session/summaries/list first and only open filenames it returns
  2. After triggering summarization, wait for the completion signal before fetching the file
  3. Treat 404 as 'not generated yet' with a friendly empty state

Example fix

// before
const c = await api.getSummary(`${date}.md`);
// after
const list = await api.listSummaries();
if (!list.some(f => f.filename === `${date}.md`)) return null; // not generated yet
const c = await api.getSummary(`${date}.md`);
Defensive patterns

Strategy: validation

Validate before calling

const files = await listSummaries();
const target = files.find(f => f.filename === wanted);
if (!target) return null; // summary not generated yet

Try / catch

try { return await getSummary(name); }
catch (e) { if (e.status === 404) return null; throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of datawhalechina/hello-agents@606a07d341 (2026-08-14). Data as JSON: /api/errors/45533a78c05f952c. Report an issue: GitHub.