{"record":{"id":"527194ff28006ea4","repo":"HKUDS/DeepTutor","slug":"unknown-mode-req-mode-r","errorCode":null,"errorMessage":"unknown mode {req.mode!r}","messagePattern":"unknown mode (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"deeptutor/api/routers/memory.py","lineNumber":305,"sourceCode":"                language=req.language,\n                iterations=req.iterations,\n                llm_selection=selection,\n                on_event=on_event,\n            )\n\n        return go\n    if req.mode == \"merge\":\n\n        async def go(on_event):\n            await run_merge(\n                req.layer,\n                req.key,\n                language=req.language,\n                on_event=on_event,\n            )\n\n        return go\n    raise HTTPException(status_code=400, detail=f\"unknown mode {req.mode!r}\")\n\n\n@router.post(\"/runs/start\")\nasync def start_run(req: RunStartRequest):\n    \"\"\"Start one consolidator mode and return a run handle.\n\n    The run survives client disconnects; reconnect via\n    ``GET /runs/{id}/events?since=N``.\n    \"\"\"\n    lyr = _validate_layer(req.layer)\n    _validate_doc_key(lyr, req.key)\n    if lyr == \"L3\" and req.key == \"preferences\" and req.mode not in (\"dedup\", \"merge\"):\n        raise HTTPException(\n            status_code=405,\n            detail=\"preferences is written by the write_memory tool, not consolidated\",\n        )\n    from deeptutor.services.memory.consolidator.runs import (\n        RunBusyError,","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/memory.py#L287-L323","documentation":"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.","triggerScenarios":"Thrown at deeptutor/api/routers/memory.py:305 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send one of the documented consolidator mode strings in the RunStartRequest","Restrict the mode picker in the workbench UI to the supported modes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","contentChangedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}