Hmbown/CodeWhale · error

Fleet task worker.role selector does not name a member in…

Error message

Fleet task {} worker.role selector {selector:?} does not name a member in the explicitly selected Fleet

What it means

A Fleet task's worker.role selector resolved to no member in the explicitly selected Fleet while exact-member mode is on. The selector string is a legacy role label; freeze_fleet_task_members could not map it to any roster member, so the task cannot be frozen.

Solutions

  1. Change the task's worker selection to name an existing member of the current Fleet.
  2. Add/restore a member with the referenced role to the Fleet.
  3. Fix the role-label typo in the task spec.

Example fix

// before
"worker": {"role": "reviewer"}  // no member with role "reviewer"
// after
"worker": {"member": "agent-7"}
Defensive patterns

Strategy: validation

Validate before calling

fn selector_resolves(selector: &str, profiles: &[AgentProfile]) -> bool { profiles.iter().any(|p| p.id == selector || p.role == selector) }

Prevention

When it happens

Trigger: freeze_fleet_task_members with require_exact_member=true and a task whose worker.role names a role (e.g. "worker") that no AgentProfile in agent_profiles carries, or a member id that does not exist in the roster.

Common situations: Renaming/removing a Fleet member while tasks still reference its old role or id; typos in role labels; specs copied from another fleet whose roster differs.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/f8f9aeeed7256e9f. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/fleet/worker_runtime.rs:196

                anyhow::anyhow!(
                    "Fleet task {} references unknown agent profile selector {selector:?}",
                    task.id
                )
            })?)
        } else if let Some(selector) = legacy_role_selector.as_deref() {
            // `role` was historically only a posture. Preserve that contract
            // when no exact Fleet is selected and a roster lookup is absent.
            // Ambiguity is never a posture: silently dropping it would make a
            // selected team launch an anonymous session-route worker.
            match resolve_member_in_profiles(agent_profiles, selector).map_err(|error| {
                anyhow::anyhow!(
                    "Fleet task {} has invalid worker.role member selector {selector:?}: {error}",
                    task.id
                )
            })? {
                Some(profile) => Some(profile),
                None if require_exact_member => {
                    bail!(
                        "Fleet task {} worker.role selector {selector:?} does not name a member in the explicitly selected Fleet",
                        task.id
                    )
                }
                None => None,
            }
        } else if require_exact_member {
            bail!(
                "Fleet task {} must name one member from the explicitly selected Fleet",
                task.id
            );
        } else {
            None
        };

        if let Some(profile) = selected {
            validate_selected_member_model(task, profile)?;
            let snapshot = FrozenFleetMember::from_profile(profile);

View on GitHub (pinned to 73e0f67d83)