HKUDS/DeepTutor · error · HTTPException
preferences is written by the write_memory tool, not…
Error message
preferences is written by the write_memory tool, not consolidated
What it means
Policy guard in start_run: the L3 'preferences' slot is maintained exclusively by the write_memory tool, so starting a consolidator run on it is only allowed for maintenance modes (dedup/merge); any other mode for this key is rejected upfront.
Solutions
- Do not run consolidation modes other than dedup/merge against L3 preferences
- Write preference entries via the write_memory tool instead of a consolidator run
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at deeptutor/api/routers/memory.py:318 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/1770940ca4e1fa8a.
Report an issue: GitHub.
Appendix: source
Thrown at deeptutor/api/routers/memory.py:318
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,
get_run_manager,
)
manager = get_run_manager()
runner = _runner_for(req)
selection = (
{"profile_id": req.llm_selection.profile_id, "model_id": req.llm_selection.model_id}
if req.llm_selection
else None
)
try:
run = await manager.start(
layer=lyr,View on GitHub (pinned to 3e82f13042)