{"record":{"id":"ae06c8f54ad08ee7","repo":"openai/codex","slug":"multiple-agents-found-for-canonical-path-agent-p","errorCode":null,"errorMessage":"multiple agents found for canonical path `{agent_path}`","messagePattern":"multiple agents found for canonical path `(.+?)`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/state/src/runtime/threads.rs","lineNumber":1179,"sourceCode":"        Ok(rows_affected)\n    }\n}\n\nfn one_thread_id_from_rows(\n    rows: Vec<sqlx::sqlite::SqliteRow>,\n    agent_path: &str,\n) -> anyhow::Result<Option<ThreadId>> {\n    let mut ids = rows\n        .into_iter()\n        .map(|row| {\n            let id: String = row.try_get(\"id\")?;\n            ThreadId::try_from(id).map_err(anyhow::Error::from)\n        })\n        .collect::<Result<Vec<_>, _>>()?;\n    match ids.len() {\n        0 => Ok(None),\n        1 => Ok(ids.pop()),\n        _ => Err(anyhow::anyhow!(\n            \"multiple agents found for canonical path `{agent_path}`\"\n        )),\n    }\n}\n\nfn push_list_threads_query(\n    builder: &mut QueryBuilder<Sqlite>,\n    filters: ThreadFilterOptions<'_>,\n    relation_filter: Option<crate::ThreadRelationFilter>,\n    limit: usize,\n) {\n    if let Some(crate::ThreadRelationFilter::DescendantsOf(ancestor_thread_id)) = relation_filter {\n        builder.push(\n            r#\"\nWITH RECURSIVE subtree(child_thread_id, parent_thread_id) AS (\n    SELECT child_thread_id, parent_thread_id\n    FROM thread_spawn_edges\n    WHERE parent_thread_id =","sourceCodeStart":1161,"sourceCodeEnd":1197,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/state/src/runtime/threads.rs#L1161-L1197","documentation":"Error \"multiple agents found for canonical path `{agent_path}`\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/state/src/runtime/threads.rs:1179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}