Hmbown/CodeWhale · error · anyhow::Error

Cannot queue a parent message for agent {agent_id}: status i

Error message

Cannot queue a parent message for agent {agent_id}: status is {} (only running children accept messages)

What it means

Status guard in queue_running_parent_message: the resolved agent's status is not a running state (completed/failed/cancelled), so queuing a parent message is refused. Terminal records are immutable receipts, not mailboxes — the surface fails closed rather than acknowledging undeliverable work.

Source

Thrown at crates/tui/src/tools/subagent/mod.rs:5352

        })
    }

    /// Queue-only message entrypoint for live children. Terminal records are
    /// immutable receipts, not mailboxes, so the message surface fails closed
    /// instead of acknowledging undeliverable work.
    pub fn queue_running_parent_message(
        &mut self,
        agent_ref: &str,
        text: String,
    ) -> Result<ParentMailReceipt> {
        let agent_id = self.resolve_agent_ref(agent_ref)?;
        let status = self
            .agents
            .get(&agent_id)
            .map(|agent| agent.status.clone())
            .ok_or_else(|| anyhow!("Agent {agent_id} not found"))?;
        if status != SubAgentStatus::Running {
            return Err(anyhow!(
                "Cannot queue a parent message for agent {agent_id}: status is {} (only running children accept messages)",
                subagent_status_name(&status)
            ));
        }
        self.queue_parent_message(&agent_id, text, false)
    }

    pub(crate) fn queue_running_parent_message_for_session(
        &mut self,
        active_session_id: &str,
        agent_ref: &str,
        text: String,
    ) -> Result<ParentMailReceipt> {
        let agent_id = self.resolve_agent_ref_for_session(active_session_id, agent_ref)?;
        self.queue_running_parent_message(&agent_id, text)
    }

    /// Queue mail and attempt a live wake (`agents/followup`).

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Check the agent's status and only message agents that are running
  2. If the agent completed, spawn a new agent for follow-up work
  3. Retrieve the finished agent's result instead of trying to queue more input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/tools/subagent/mod.rs:5352 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/8bfee37dee9e277b. Report an issue: GitHub.