{"record":{"id":"09f836f309e6a75a","repo":"warpdotdev/warp","slug":"too-many-attachments-maximum-attachments-allow","errorCode":null,"errorMessage":"Too many attachments. Maximum {} attachments allowed, but {} were provided.","messagePattern":"Too many attachments\\. Maximum (.+?) attachments allowed, but (.+?) were provided\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/src/ai/agent_sdk/ambient.rs","lineNumber":343,"sourceCode":"                .as_ref()\n                .and_then(|f| f.file.runner_id.as_ref())\n                .is_some()\n                && !FeatureFlag::CloudRunners.is_enabled()\n            {\n                super::report_fatal_error(\n                    anyhow::anyhow!(\n                        \"`runner_id` is set in the config file but runner support is not enabled\"\n                    ),\n                    ctx,\n                );\n                return;\n            }\n\n            // Validate and process attachments early, before environment selection\n            // This ensures users don't have to go through env selection if attachment validation fails\n            if args.attachment_paths.len() > MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY {\n                super::report_fatal_error(\n                    anyhow::anyhow!(\n                        \"Too many attachments. Maximum {} attachments allowed, but {} were provided.\",\n                        MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY,\n                        args.attachment_paths.len()\n                    ),\n                    ctx,\n                );\n                return;\n            }\n\n            let attachments = if FeatureFlag::AmbientAgentsImageUpload.is_enabled() {\n                if !args.attachment_paths.is_empty() {\n                    match args\n                        .attachment_paths\n                        .iter()\n                        .enumerate()\n                        .map(|(i, path)| process_attachment(path, i))\n                        .collect::<Result<Vec<_>, _>>()\n                    {","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/ambient.rs#L325-L361","documentation":"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.","triggerScenarios":"Passing more than 25 attachment paths to the ambient/cloud agent run command.","commonSituations":"Globbing a large directory into the command; migrating a workflow that bundled many files into fewer runs.","solutions":["Reduce attachments to 25 or fewer (combine files or archive them into one attachment)","Split the work across multiple runs","Move bulky inputs out-of-band (Drive, URL) and reference them from the prompt"],"exampleFix":"# before\nrun ... $(ls ./reports/*.pdf)\n# after\nrun ... $(ls ./reports/*.pdf | head -25)","handlingStrategy":"validation","validationCode":"use super::driver::attachments::MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY;\nif args.attachment_paths.len() > MAX_ATTACHMENT_COUNT_FOR_CLOUD_QUERY {\n    // reject (or batch) the request before spawning the run\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap glob-expanded attachment lists at 25 in wrappers","Archive many small files into one attachment instead of passing them individually"],"tags":["cli","attachments","limits","validation"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}