{"record":{"id":"77311020abe173a1","repo":"tinyhumansai/openhuman","slug":"unknown-team-team-id","errorCode":null,"errorMessage":"unknown team: {team_id}","messagePattern":"unknown team: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/openhuman/agent/orchestration/agent_teams/ops.rs","lineNumber":140,"sourceCode":"/// Validates `depends_on`: rejects self-dependency, unknown dependency ids, and\n/// dependency cycles (Kahn's algorithm over the team's existing tasks plus the\n/// new one). An optional `owner_member_id` must reference a real member.\n#[allow(clippy::too_many_arguments)]\npub fn assign_task(\n    config: &Config,\n    team_id: &str,\n    title: &str,\n    objective: Option<&str>,\n    owner_member_id: Option<&str>,\n    depends_on: &[String],\n) -> Result<AgentTeamTask> {\n    log::debug!(\n        \"{LOG_PREFIX} assign_task.entry team={team_id} deps={}\",\n        depends_on.len()\n    );\n\n    let team = run_ledger::get_agent_team(&config.workspace_dir, team_id)?\n        .ok_or_else(|| anyhow!(\"unknown team: {team_id}\"))?;\n    let _ = team;\n\n    let existing = run_ledger::list_agent_team_tasks(&config.workspace_dir, team_id)?;\n    let task_id = format!(\"task-{}\", Uuid::new_v4().simple());\n\n    if let Some(owner) = owner_member_id {\n        let members = run_ledger::list_agent_team_members(&config.workspace_dir, team_id)?;\n        if !members.iter().any(|m| m.id == owner) {\n            return Err(anyhow!(TeamError::UnknownMember {\n                member_id: owner.to_string(),\n            }));\n        }\n    }\n\n    validate_dependencies(&task_id, depends_on, &existing)?;\n\n    let order_index = existing.len() as i64;\n    let task = run_ledger::upsert_agent_team_task(","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/openhuman/agent/orchestration/agent_teams/ops.rs#L122-L158","documentation":"Thrown by agent_teams assign_task when run_ledger::get_agent_team() returns None for the given team_id — no row in the agent_teams table of the workspace's run-ledger SQLite DB. The team id was never created, was mistyped, belongs to a different workspace_dir (the ledger is per-workspace), or the team was closed/ledger reset. The task is rejected before insertion; note the code's `let _ = team;` — only existence is checked here.","triggerScenarios":"Calling agent_team_assign_task with a truncated/hallucinated team id; referencing a team created in another workspace or before a workspace wipe; assigning to a team after agent_team_close; core pointed at a different workspace_dir via env override.","commonSituations":"LLM inventing 'team-1234' instead of using the id returned by agent_team_create; multi-workspace setups; long sessions surviving a ledger reset.","solutions":["List live teams via agent_team_list and copy the id verbatim","If the team should exist, confirm the core is using the same workspace_dir where it was created","Recreate the team if it was closed or the ledger reset"],"exampleFix":"// before\ntool: agent_team_assign_task {\"team_id\":\"team-1234\", ...} // -> unknown team: team-1234\n// after\ntool: agent_team_list {} // -> \"team-3f9a2c...\"\ntool: agent_team_assign_task {\"team_id\":\"team-3f9a2c...\", ...}","handlingStrategy":"validation","validationCode":"// Resolve the team before assigning:\nlet teams = tool_exec(\"agent_team_list\", json!({})).await?; // or agent_team_get {team_id}\nlet id = teams.iter().find(|t| t.id == team_id).ok_or(\"unknown team\")?.id.clone();\ntool_exec(\"agent_team_assign_task\", json!({\"team_id\": id, /* ... */})).await","typeGuard":"fn team_exists(teams: &[TeamView], team_id: &str) -> bool {\n    teams.iter().any(|t| t.id == team_id)\n}","tryCatchPattern":"match tool_exec(\"agent_team_assign_task\", args).await {\n    Err(e) if e.to_string().contains(\"unknown team\") => {\n        let live = tool_exec(\"agent_team_list\", json!({})).await?; // refresh ids; recreate if closed\n        Err(anyhow!(\"team {team_id} not in {} live teams\", live.len()))\n    }\n    other => other,\n}","preventionTips":["Always carry team ids from the agent_team_create response through the session — never retype them","Remember the ledger is per-workspace_dir: switching workspaces orphans old ids","After agent_team_close, treat all ids from that team as dead"],"tags":["rust","agent-teams","not-found","validation","orchestration"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}