diegosouzapw/OmniRoute · error

Codex Cloud send message failed

Error message

Codex Cloud send message failed: ${response.status} ${error}

What it means

CodexCloudAgent.sendMessage POSTed a follow-up to an existing Codex Cloud task and the API returned a non-OK status; the body text is embedded. The message could not be delivered to the running task — expired apiKey, task finished, or transient server error.

Solutions

  1. Refresh credentials on 401/403 before retrying
  2. Check task state — follow-ups may be rejected after completion
  3. Retry 429/5xx with backoff
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/cloudAgent/agents/codex.ts:132 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/5560ce472f754e65. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/cloudAgent/agents/codex.ts:132

  }

  async sendMessage(
    externalId: string,
    message: string,
    credentials: AgentCredentials
  ): Promise<CloudAgentActivity> {
    const response = await fetch(`${this.baseUrl}/codex/cloud/tasks/${externalId}/followup`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${credentials.apiKey}`,
      },
      body: JSON.stringify({ message }),
    });

    if (!response.ok) {
      const error = await response.text();
      throw new Error(`Codex Cloud send message failed: ${response.status} ${error}`);
    }

    return {
      id: this.generateActivityId(),
      type: "message",
      content: message,
      timestamp: new Date().toISOString(),
    };
  }

  async listSources(
    _credentials: AgentCredentials
  ): Promise<{ name: string; url: string; branch?: string }[]> {
    return [];
  }
}

View on GitHub (pinned to a179ffed5b)