{"record":{"id":"d92333e6df8e1119","repo":"tinyhumansai/openhuman","slug":"team-missing-after-creation-team-id","errorCode":null,"errorMessage":"team missing after creation: {team_id}","messagePattern":"team missing after creation: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/orchestration/agent_teams/ops.rs","lineNumber":379,"sourceCode":"        run_ledger::shutdown_agent_team_member(&config.workspace_dir, team_id, member_id)?\n            .ok_or_else(|| {\n                anyhow!(TeamError::UnknownMember {\n                    member_id: member_id.to_string(),\n                })\n            })?;\n    log::debug!(\n        \"{LOG_PREFIX} shutdown_member.exit team={team_id} member={member_id} released={}\",\n        released_task_ids.len()\n    );\n    Ok(MemberShutdown {\n        member,\n        released_task_ids,\n    })\n}\n\nfn team_view(config: &Config, team_id: &str) -> Result<TeamView> {\n    let team = run_ledger::get_agent_team(&config.workspace_dir, team_id)?\n        .ok_or_else(|| anyhow!(\"team missing after creation: {team_id}\"))?;\n    let members = run_ledger::list_agent_team_members(&config.workspace_dir, team_id)?;\n    let tasks = run_ledger::list_agent_team_tasks(&config.workspace_dir, team_id)?;\n    Ok(TeamView {\n        team,\n        members,\n        tasks,\n    })\n}\n\n/// Validate a new task's dependency edges against the team's existing tasks.\n///\n/// Rejects self-dependency, unknown dependency ids, and any edge that would\n/// introduce a cycle. The cycle check builds the full graph (existing tasks +\n/// the new task with its proposed deps) and runs Kahn's algorithm — the same\n/// shape used for workflow phase graphs in `workflow_runs::ops::has_cycle`.\nfn validate_dependencies(\n    new_task_id: &str,\n    depends_on: &[String],","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/orchestration/agent_teams/ops.rs#L361-L397","documentation":"Internal consistency check in team_view: immediately after creating a team, re-reading it from the run ledger returned None. This should be impossible absent a ledger write/read race or persistence fault — the create path just persisted the row. It is a defensive guard converting a violated postcondition into an explicit error rather than unwrapping.","triggerScenarios":"Thrown at src/openhuman/agent/orchestration/agent_teams/ops.rs:379 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the run-ledger write path for silent failures (SQLite error swallowed, wrong workspace_dir on read)","Look for concurrent deletion of the team between create and re-read","If reproducible, capture ledger logs around create to see whether the row was committed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}