{"record":{"id":"d3b2ed8df4766ca9","repo":"astrid-runtime/astrid","slug":"provider-request-exceeds-limit-d3b2ed","errorCode":null,"errorMessage":"provider request exceeds limit","messagePattern":"provider request exceeds limit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":162,"sourceCode":"        Err(anyhow::anyhow!(\n            \"this executable is an Astrid provider companion, not an interactive command\"\n        ))\n    };\n    if let Err(error) = result {\n        eprintln!(\"{PROVIDER_NAME}: {error:#}\");\n        return ExitCode::from(2);\n    }\n    ExitCode::SUCCESS\n}\n\nasync fn run_stdio() -> Result<()> {\n    let mut bytes = Vec::new();\n    std::io::stdin()\n        .lock()\n        .take(MAX_REQUEST_BYTES + 1)\n        .read_to_end(&mut bytes)?;\n    if bytes.len() as u64 > MAX_REQUEST_BYTES {\n        bail!(\"provider request exceeds limit\");\n    }\n    let request: StorageProviderRequestV1 = serde_json::from_slice(&bytes)?;\n    if request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {\n        bail!(\"unsupported provider protocol {}\", request.protocol_version);\n    }\n    let request_id = request.request_id;\n    let outcome = match execute(request).await {\n        Ok(success) => StorageProviderOutcomeV1::Success(success),\n        Err(error) => StorageProviderOutcomeV1::Failure(StorageProviderFailureV1 {\n            code: \"provider-operation\".to_owned(),\n            message: bounded_failure_message(&error.to_string()),\n        }),\n    };\n    let response = StorageProviderResponseV1 {\n        protocol_version: STORAGE_PROVIDER_PROTOCOL_V1,\n        request_id,\n        provider: StorageProviderIdentityV1 {\n            name: PROVIDER_NAME.to_owned(),","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L144-L180","documentation":"This error means the storage provider binary read its JSON request from stdin and the byte count exceeded `MAX_REQUEST_BYTES`. The provider uses `take(MAX_REQUEST_BYTES + 1)` so oversized inputs are detected deterministically instead of being silently truncated. It is thrown in main.rs:162 before any parsing, protecting the provider from unbounded memory use.","triggerScenarios":"Piping or writing a provider request whose byte length is greater than MAX_REQUEST_BYTES into the provider's stdin — e.g. a host/agent serializing a request with large embedded payloads or accidental binary noise appended.","commonSituations":"A driver or harness writing the wrong stream to the provider's stdin; a protocol upgrade embedding large descriptors; concatenating multiple requests into one stdin write.","solutions":["Reduce the request payload size (remove embedded blobs, use references/ids).","Check the code that spawns the provider — it must write exactly one JSON request and close stdin.","Confirm MAX_REQUEST_BYTES matches the value the requesting side assumes; keep both sides in sync.","Pre-measure the serialized request size before spawning the provider and fail fast at the caller."],"exampleFix":"// caller-side size check\n// before\nchild.stdin.write_all(&request_bytes)?;\n// after\nensure!(request_bytes.len() <= MAX_REQUEST_BYTES, \"request too large for provider\");\nchild.stdin.write_all(&request_bytes)?;","handlingStrategy":"validation","validationCode":"let bytes = serde_json::to_vec(&request)?;\nif bytes.len() as u64 > MAX_REQUEST_BYTES { return Err(anyhow!(\"request too large\")); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-measure the serialized request before spawning the provider","Write exactly one JSON request to stdin and close it","Do not concatenate multiple requests into one stdin stream"],"tags":["stdin","payload-too-large","ipc","limits"],"backgroundTag":"payload-too-large","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}