warpdotdev/warp · warning

Too many attachments. Maximum {} attachments allowed, but {}

Error message

Too many attachments. Maximum {} attachments allowed, but {} were provided.

What it means

run_agent caps cloud-query attachments at MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY = 25 (defined in app/src/ai/agent_sdk/driver/attachments.rs:25); the check at ambient.rs:337-350 fails fast when attachment_paths.len() exceeds it, deliberately before environment selection so the user does not spend a round-trip on env picking only to fail on attachments.

Source

Thrown at app/src/ai/agent_sdk/ambient.rs:343

                .as_ref()
                .and_then(|f| f.file.runner_id.as_ref())
                .is_some()
                && !FeatureFlag::CloudRunners.is_enabled()
            {
                super::report_fatal_error(
                    anyhow::anyhow!(
                        "`runner_id` is set in the config file but runner support is not enabled"
                    ),
                    ctx,
                );
                return;
            }

            // Validate and process attachments early, before environment selection
            // This ensures users don't have to go through env selection if attachment validation fails
            if args.attachment_paths.len() > MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY {
                super::report_fatal_error(
                    anyhow::anyhow!(
                        "Too many attachments. Maximum {} attachments allowed, but {} were provided.",
                        MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY,
                        args.attachment_paths.len()
                    ),
                    ctx,
                );
                return;
            }

            let attachments = if FeatureFlag::AmbientAgentsImageUpload.is_enabled() {
                if !args.attachment_paths.is_empty() {
                    match args
                        .attachment_paths
                        .iter()
                        .enumerate()
                        .map(|(i, path)| process_attachment(path, i))
                        .collect::<Result<Vec<_>, _>>()
                    {

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Reduce attachments to 25 or fewer (combine files or archive them into one attachment)
  2. Split the work across multiple runs
  3. Move bulky inputs out-of-band (Drive, URL) and reference them from the prompt

Example fix

# before
run ... $(ls ./reports/*.pdf)
# after
run ... $(ls ./reports/*.pdf | head -25)
Defensive patterns

Strategy: validation

Validate before calling

use super::driver::attachments::MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY;
if args.attachment_paths.len() > MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY {
    // reject (or batch) the request before spawning the run
}

Prevention

When it happens

Trigger: Passing more than 25 attachment paths to the ambient/cloud agent run command.

Common situations: Globbing a large directory into the command; migrating a workflow that bundled many files into fewer runs.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/09f836f309e6a75a. Report an issue: GitHub.