HKUDS/DeepTutor · error · HTTPException
unknown mode
Error message
unknown mode {req.mode!r} What it means
HTTP 400 raised in deeptutor/api/routers/memory.py:305 by the run-mode dispatcher when RunStartRequest.mode is not one of the supported runner modes (e.g. not 'merge' and the preceding mode branches). No runner coroutine can be built for the unknown mode, so the start request is rejected.
Solutions
- Send one of the documented consolidator mode strings in the RunStartRequest
- Restrict the mode picker in the workbench UI to the supported modes
Defensive patterns
Strategy: validation
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.
Appendix: 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)