aaif-goose/goose · error

No valid messages to send to Anthropic API

Error message

No valid messages to send to Anthropic API

What it means

Error "No valid messages to send to Anthropic API" thrown in aaif-goose/goose.

Source

Thrown at crates/goose-provider-types/src/formats/anthropic.rs:788

    )
}

pub fn create_request_for_model(
    provider_name: &str,
    model_config: &ModelConfig,
    wire_model_name: &str,
    system: &str,
    messages: &[Message],
    tools: &[Tool],
    options: AnthropicFormatOptions,
) -> Result<Value> {
    let options = options.for_model(model_config);
    let anthropic_messages = format_messages_with_options(messages, &options);
    let tool_specs = format_tools(tools, &options);
    let system_spec = format_system(system, &options);

    if anthropic_messages.is_empty() {
        return Err(anyhow!("No valid messages to send to Anthropic API"));
    }

    let max_tokens = model_config.max_output_tokens();
    let mut payload = json!({
        "model": wire_model_name,
        "messages": anthropic_messages,
        "max_tokens": max_tokens,
    });

    if !system.is_empty() {
        payload
            .as_object_mut()
            .unwrap()
            .insert("system".to_string(), json!(system_spec));
    }

    if !tool_specs.is_empty() {
        payload

View on GitHub (pinned to 3810898a74)

When it happens

Trigger: Thrown at crates/goose-provider-types/src/formats/anthropic.rs:788 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/ef85ce8adb93675f. Report an issue: GitHub.