You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Cloud Control identifier, token or pagination cursor, or an aws_logs_tail filter pattern, that starts with file:// or fileb:// no longer makes the AWS CLI read a local file and send it to AWS. The CLI's paramfile loader (awscli/paramfile.py) replaces any command-line parameter value that begins with exactly file:// or fileb:// with the contents of that local file -- after expanding ~, $VAR and %VAR% -- before the request is signed, and v2 stores its no_paramfile setting without ever reading it, so there is no per-parameter opt-out. aws_resource_*'s identifier, requestToken, clientToken and nextToken, aws_paginate's startingToken and aws_logs_tail's filterPattern reached the command line unguarded, on tools annotated read-only that hosts commonly auto-approve: a prompt-injected identifier of file://~/.aws/credentials sent that file to AWS as the identifier, and the fileb:// form echoed the file's bytes back to the model in the error. The Cloud Control and pagination fields now reject the prefix before any process starts, in the same class as the existing leading-- reject and with errorKind absent the same way. As a backstop, runAwsCall refuses any such value among the CLI-level arguments a tool hands it (errorKind: "bad_input", naming the flag it belongs to) -- that is what closes filterPattern, which has no field-level reject of its own, and it also covers the values that come back from AWS, such as the request token awaitCompletion polls with. The match is exactly the loader's own case-sensitive, whitespace-free startswith, so nothing that reached AWS as itself before is refused now: FILE://, a leading space and file:/ with one slash all still pass through, verified against aws-cli 2.34.3 and 2.22.0 through a loopback stub. aws_lambda_invoke's own --payload fileb://<temp file> is exempted by its exact value, so --qualifier and the rest of that call stay guarded.
On Windows, an aws.exe in the server's working directory no longer stands in for the AWS CLI. Node resolves the bare command aws by looking in the current directory before PATH unless NoDefaultCurrentDirectoryInExePath is set. Claude Code sets it; hosts on the MCP SDK's default stdio transport pass only a short list of variables that does not include it, and start the server in their own working directory -- often the open project. So a repository with an aws.exe at its root ran that binary, with your AWS environment, on the first tool call: reproduced over MCP stdio on Node 22.22.2 against a build of this release with the fix removed, where a copy of node.exe planted as aws.exe answered aws_call sts get-caller-identity and the stub endpoint saw no requests at all. oam 0.16.2 never searched the working directory either way. The server now sets the variable for itself at startup when the host has not, as the first statement of the entry point, before any tool can spawn anything; an existing value is left alone whatever case the host spelled the key in. Windows evaluates the setting in the parent at spawn time, so the aws children are covered too, and the CLI inherits it, which also stops the CLI's own helpers resolving there: a planted session-manager-plugin.exe otherwise ran under aws ssm start-session and was handed the session's token. A credential_process configured as a bare program name that exists only in the working directory stops resolving; name it by absolute path.
Fixed
aws_lambda_invoke could run a function three times and still return nothing. A function slower than 60 s hit the AWS CLI's default socket read timeout, and the CLI's standard retry mode then sent Invoke again -- three attempts by default, five for a profile with max_attempts = 5. The tool's own description told callers to raise timeoutMs for a long function, which is exactly what set it off: through the v2.3.2 handler, aws-cli 2.34.3 against a local stub, a 70 s function with timeoutMs: 200000 received three Invoke POSTs 60 s apart and the call came back after 183 s as nonzero_exitRead timeout on endpoint URL, with no payload and no log tail. The invoke now runs with AWS_MAX_ATTEMPTS=1, which overrides any max_attempts in the caller's profile -- every spelling of the variable is dropped from the child environment first, because Node hands a child the upper-case key while oam hands it the last one -- and with a --cli-read-timeout derived from timeoutMs, so the request is sent once and the CLI waits as long as the caller asked. timeoutMs now means how long to wait for the function: the CLI gets 10 s more, enough for a cold start's init phase, so a function that hits its own timeout still comes back as a functionError with its log tail, and the tool's own kill timer fires 5 s after the CLI's as a backstop. Values above 900000, Lambda's synchronous maximum, are treated as 900000, which also stops a huge timeoutMs timing the call out at once -- Node fires a timer longer than 2^31-1 ms after 1 ms. No answer in time is errorKind: "timeout" whichever clock fired -- the CLI's read timeout used to surface as nonzero_exit -- and the message says whether the invoke was sent. That distinction is not cosmetic: --cli-read-timeout also bounds the CLI's credential calls, and a hung STS endpoint for a role_arn profile produces the identical Read timeout text with nothing sent to Lambda, so the handler reads the URL in the message rather than assuming the function ran.
Error codes and remedies survive the CLI giving up on its retries. Once botocore stops retrying it marks the error MaxAttemptsReached and writes ... when calling the X operation (reached max retries: N): ..., and the parser required operation: straight after the operation name, so every retry-exhausted error lost its code, its operation and its suggestion -- throttling and 5xx on every tool, which is exactly the case the backoff suggestion was written for. It matters more now that aws_lambda_invoke runs with AWS_MAX_ATTEMPTS=1: botocore marks the FIRST failure the same way when max_attempts is 1, so the CLI writes (reached max retries: 0) on every Lambda service error, and a missing function would have lost "Verify the resource identifier and region." On Windows the same pattern also swallowed the CLI's Additional error details: block, because the terminator looked for \n\n and the CLI writes \r\n\r\n. Both are fixed by the one regex, and the throttling suggestion now says how many times the CLI had already retried -- nothing is appended when it had not.
parseAwsError has a remedy for three transport failures that had none: Read timeout on endpoint URL and Connection was closed before we received a valid response (the request was sent, so a call that changes state may have taken effect -- check before retrying), and Connect timeout on endpoint URL (check network access, proxy and region). The remedies are deliberately generic about retry safety -- every tool but aws_lambda_invoke reaches them with the CLI's retries still on -- and the request they say was sent is the one to the endpoint the message names, which for a role_arn profile whose STS endpoint hangs is the credential call rather than the caller's operation.
aws_lambda_invoke accepts the qualifier $LATEST.PUBLISHED and function ARNs up to 256 characters. Both limits predate Lambda Managed Instances, and both rejected valid input here before anything spawned: FunctionName now allows the 256 characters the Invoke API documents (it was 170, which a 64-character name with a 59-character alias already exceeds), and the qualifier charset gains . for $LATEST.PUBLISHED -- sent as ?Qualifier=%24LATEST.PUBLISHED, verified through the installed CLI. : and / stay out, so a qualifier still cannot spell file://. The qualifier description no longer says an unqualified invoke always runs $LATEST -- on Managed Instances it runs $LATEST.PUBLISHED, and durable functions need an explicit qualifier -- the tool description says Managed Instances functions do not support the log tail, and invocationType no longer offers aws_iam_simulate as a DryRun substitute: the simulator evaluates the caller's identity policies and never fetches the function's resource-based policy.
Pagination cursors are accepted up to 8,192 characters, up from 2,048. Cloud Control documents ListResources NextToken at up to 4,096 characters, and aws-cli returned and accepted one that long against a local stub, but aws_resource_list rejected it locally before any process spawned. aws_paginate needs more headroom still: the CLI wraps a raw token as base64 JSON for --starting-token, so a 4,096-character cursor arrives as 5,484. It is the 128-character bug 2.0.0 fixed, one limit higher. The identifier cap (2,048) and the requestToken / clientToken cap (128) are unchanged.
Changed
aws_lambda_invoke no longer lets the AWS CLI retry a throttle, a 5xx or a dropped connection. This is a behavior change, not merely a fix. The CLI re-sent all three, and every re-send of an Invoke that reached the function is another run -- a dropped connection, a 429 TooManyRequestsException and a 500 ServiceException were each sent three times on the CLI's defaults. They now reach the caller on the first failure. For a TooManyRequestsException this gives something up: Lambda refused before running anything, so the old silent retry was safe, but no environment variable or flag limits retries to some error codes and not others. The tool description now says a throttle is safe to retry, and that after a dropped connection or a 5xx the function may have run, so check its logs first.
aws_lambda_invoke's timeoutMs now bounds the wait for the function, not the whole call. This is a behavior change, not merely a fix: the CLI is allowed 10 s beyond the value in force and the tool's own kill timer 5 s beyond that, so a call that gets no answer takes up to 15 s longer than it did -- 75 s instead of 60 s on the default, and 915 s whenever the value was clamped to Lambda's 900 s maximum. In 2.3.2 timeoutMs WAS the kill timer, so a host that used it as a hard wall-clock budget has to allow for the extra 15 s.
Test-only: suites named *.realcli.test.ts drive the AWS CLI v2 installed on PATH against an in-process endpoint on 127.0.0.1, with throwaway static keys, a throwaway config and credentials file, and a dead proxy for every other address, so what the fake CLI prints is checked against what the real one prints and nothing leaves the machine. param-file.realcli.test.ts runs on every npm test and skips itself, with a reason, when there is no CLI v2 to run; lambda.realcli.test.ts and aws-cli.realcli.test.ts, which wait out real timeouts and retries, also need AWS_MCP_REAL_CLI_TESTS=1, and release.sh's test step now exports it as a default an explicit AWS_MCP_REAL_CLI_TESTS=0 still overrides. A fake can only say what it was told the real CLI says; these check that it was told the truth.