odysseus-dev/odysseus · error · HTTPException

Audit failed

Error message

Audit failed: {result['error']}

What it means

Wrapper error in api_audit_memories: the audit_memories call returned an error result with no 'before' payload, meaning the audit failed before producing any stats. Re-raised as 502 with the underlying error so the client knows the upstream LLM/audit step — not the request — failed.

Solutions

  1. Check the audit result error and server logs for details.
  2. Fix the underlying store issue reported, then rerun the audit.
Defensive patterns

Strategy: try-catch

When it happens

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

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/a9c43c253670fdc5. Report an issue: GitHub.

Appendix: source

Thrown at routes/memory/memory_routes.py:326

        endpoint_url, model, headers = resolve_task_endpoint(
            fallback_url, fallback_model, fallback_headers, owner=user
        )

        if not endpoint_url or not model:
            raise HTTPException(400, "No default model configured — set one in Settings")

        result = await audit_memories(
            memory_manager,
            memory_vector,
            endpoint_url,
            model,
            headers,
            owner=user,
        )

        if "error" in result and "before" not in result:
            raise HTTPException(502, f"Audit failed: {result['error']}")

        return {
            "ok": "error" not in result,
            "before": result.get("before", 0),
            "after": result.get("after", 0),
            "removed": result.get("before", 0) - result.get("after", 0),
            # True when the audit skipped the LLM because nothing changed
            # since the last tidy. Frontend already says "Already clean"
            # for removed==0, so this is here for future use / debugging.
            "already_tidy": bool(result.get("already_tidy")),
        }

    @router.post("/import")
    async def import_memories_from_file(
        request: Request,
        session: str | None = Form(None),
        file: UploadFile = File(...)
    ):

View on GitHub (pinned to f9235ebbf1)