{"record":{"id":"af87d1e18229c552","repo":"HKUDS/DeepTutor","slug":"unknown-run-id","errorCode":null,"errorMessage":"unknown run_id","messagePattern":"unknown run_id","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/memory.py","lineNumber":359,"sourceCode":"                \"budget\": req.budget,\n                \"iterations\": req.iterations,\n                \"language\": req.language,\n                \"llm_selection\": selection,\n            },\n            language=req.language,\n        )\n    except RunBusyError as exc:\n        raise HTTPException(status_code=409, detail=str(exc))\n    return run.to_dict()\n\n\n@router.get(\"/runs/{run_id}\")\nasync def get_run(run_id: str):\n    from deeptutor.services.memory.consolidator.runs import get_run_manager\n\n    run = get_run_manager().get(run_id)\n    if run is None:\n        raise HTTPException(status_code=404, detail=\"unknown run_id\")\n    return run.to_dict()\n\n\n@router.post(\"/runs/{run_id}/cancel\")\nasync def cancel_run(run_id: str):\n    from deeptutor.services.memory.consolidator.runs import get_run_manager\n\n    ok = await get_run_manager().cancel(run_id)\n    if not ok:\n        raise HTTPException(status_code=409, detail=\"not active\")\n    return {\"run_id\": run_id, \"cancelled\": True}\n\n\n@router.post(\"/runs/{run_id}/undo\")\nasync def undo_run_edit(run_id: str):\n    from deeptutor.services.memory.consolidator.runs import (\n        RunBusyError,\n        get_run_manager,","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/memory.py#L341-L377","documentation":"HTTP 404 returned by GET /memory/runs/{run_id} when the run manager has no run registered under the given run_id. Run records live in an in-process manager, so IDs are only resolvable in the process that created them.","triggerScenarios":"GET /runs/{run_id} with a typo'd ID, an ID from a previous server process (lost on restart), or a run that was completed and evicted from the manager's registry.","commonSituations":"Server restarts between starting a run and polling it, stale run IDs persisted in client state or logs, or URL-encoding issues mangling the ID in transit.","solutions":["Verify the run_id matches the value returned by the start endpoint exactly","Check whether the API server restarted — after a restart, list runs or start a new one instead of polling old IDs","If polling long-running runs across restarts matters, persist run metadata externally or re-issue the consolidation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await fetch(`/memory/runs/${runId}`);\nif (res.status === 404) { /* re-list runs or start a new one */ }","typeGuard":"function isRunId(id: string): boolean { return /^[A-Za-z0-9_-]+$/.test(id); }","tryCatchPattern":"try { const run = await getRun(id); } catch (e) { if (e.status === 404) handleStaleRun(id); else throw e; }","preventionTips":["Don't persist run IDs across server restarts","Store the run_id immediately from the start response","URL-encode the run_id path segment"],"tags":["memory","run-manager","http-404","not-found","run-id"],"backgroundTag":"resource-not-found","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}