HKUDS/DeepTutor · error · HTTPException

unknown mode {req.mode!r}

Error message

unknown mode {req.mode!r}

What it means

Error "unknown mode {req.mode!r}" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/api/routers/memory.py:305

                language=req.language,
                iterations=req.iterations,
                llm_selection=selection,
                on_event=on_event,
            )

        return go
    if req.mode == "merge":

        async def go(on_event):
            await run_merge(
                req.layer,
                req.key,
                language=req.language,
                on_event=on_event,
            )

        return go
    raise HTTPException(status_code=400, detail=f"unknown mode {req.mode!r}")


@router.post("/runs/start")
async def start_run(req: RunStartRequest):
    """Start one consolidator mode and return a run handle.

    The run survives client disconnects; reconnect via
    ``GET /runs/{id}/events?since=N``.
    """
    lyr = _validate_layer(req.layer)
    _validate_doc_key(lyr, req.key)
    if lyr == "L3" and req.key == "preferences" and req.mode not in ("dedup", "merge"):
        raise HTTPException(
            status_code=405,
            detail="preferences is written by the write_memory tool, not consolidated",
        )
    from deeptutor.services.memory.consolidator.runs import (
        RunBusyError,

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/api/routers/memory.py:305 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/527194ff28006ea4. Report an issue: GitHub.