{"record":{"id":"794addda0d61cc0e","repo":"affaan-m/ECC","slug":"session-not-found-value","errorCode":null,"errorMessage":"Session not found: {value}","messagePattern":"Session not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":2918,"sourceCode":"        }) => {\n            session::manager::run_session(&cfg, &session_id, &task, &agent, &cwd).await?;\n        }\n    }\n\n    Ok(())\n}\n\nfn resolve_session_id(db: &session::store::StateStore, value: &str) -> Result<String> {\n    if value == \"latest\" {\n        return db\n            .get_latest_session()?\n            .map(|session| session.id)\n            .ok_or_else(|| anyhow::anyhow!(\"No sessions found\"));\n    }\n\n    db.get_session(value)?\n        .map(|session| session.id)\n        .ok_or_else(|| anyhow::anyhow!(\"Session not found: {value}\"))\n}\n\nfn sync_runtime_session_metrics(\n    db: &session::store::StateStore,\n    cfg: &config::Config,\n) -> Result<()> {\n    db.refresh_session_durations()?;\n    db.sync_cost_tracker_metrics(&cfg.cost_metrics_path())?;\n    db.sync_tool_activity_metrics(&cfg.tool_activity_metrics_path())?;\n    let _ = session::manager::enforce_session_heartbeats(db, cfg)?;\n    let _ = session::manager::enforce_budget_hard_limits(db, cfg)?;\n    Ok(())\n}\n\nfn sync_memory_connector(\n    db: &session::store::StateStore,\n    cfg: &config::Config,\n    name: &str,","sourceCodeStart":2900,"sourceCodeEnd":2936,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/ecc2/src/main.rs#L2900-L2936","documentation":"Raised inside `resolve_session_id` for any value other than `\"latest\"`: `db.get_session(value)?` returned `None`, so no session row matches the supplied ID. This is the explicit-lookup counterpart to error 647 and is the error users see when they pass a concrete session ID that does not exist. The formatted message echoes the offending value.","triggerScenarios":"Passing a session ID that was never created, was deleted, or belongs to a different state store. Typos in a copied ID. Truncation of a long UUID when copied from truncated log output. Using a session ID from a previous workspace.","commonSituations":"Wrong workspace / state DB. Stale references in scripts after a reset. ID format mismatch (e.g. integer vs UUID). Copy-paste errors from human-readable output that abbreviated the ID.","solutions":["List sessions to confirm valid IDs (e.g. `ecc sessions list`).","Verify the state store path in config matches the workspace that owns the session.","If you only need the most recent session, use the literal `latest` instead of an explicit ID."],"exampleFix":"// before\necc decisions abc123\n\n// after\necc sessions list            # find the real id\necc decisions <valid-id>","handlingStrategy":"validation","validationCode":"// Validate explicit session id before use\nfn session_exists(db: &StateStore, id: &str) -> Result<bool> {\n    Ok(db.get_session(id)?.is_some())\n}\n\nif !session_exists(&db, value)? {\n    eprintln!(\"session not found: {value}; listing:\");\n    print_sessions(&db)?;\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match db.get_session(value) {\n    Ok(Some(s)) => s.id,\n    Ok(None) => { eprintln!(\"Session not found: {value}\"); std::process::exit(1); }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Copy full session IDs from `sessions list` output, not from truncated log lines.","Confirm the state store path matches the workspace that owns the session.","Prefer `latest` when you only need the most recent session."],"tags":["session","database","resolve","cli"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}