From 874fd2b47cd10e15c761f654d998e746a0fba3f6 Mon Sep 17 00:00:00 2001 From: Brent Rager Date: Sun, 30 Aug 2026 19:41:21 -0400 Subject: [PATCH] fix(sst): use `bundle` for the prebuilt Rust Lambda, not `handler` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every route of a SmoothAgentApi deploy failed with: Error: Runtime not found: provided.al2023 `args.handler` is a PREBUILT artifact directory — the cargo-lambda output holding `bootstrap`. Passing it as `handler` makes SST try to BUILD it, and SST dispatches its builder on the runtime string. There is no builder registered for the literal `provided.al2023`: SST expects `rust` or `go` as the BUILD input and maps those to that Lambda runtime itself. So the value is a valid Lambda runtime and an invalid SST build runtime, and the two are easy to conflate. `bundle` is the documented way to say "I built this myself, skip bundling" — with `handler` then naming the entrypoint inside it (`bootstrap`, which is also the crate's [[bin]] name). This failed in a way that pointed at the wrong layer: each route created its log group and IAM role successfully FIRST, so the run looked like a permissions problem right up until the build step. Found deploying smooth-operator's serverless flavor for the first time (SmooAI/smooth-operator#559) — the path had never actually been run. Typecheck is unchanged: 93 pre-existing errors on main (the `sst` ambient globals a library checkout cannot resolve), 93 with this change. --- sst/pnpm-lock.yaml | 1 - sst/src/components/websocket-lambda-api.ts | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sst/pnpm-lock.yaml b/sst/pnpm-lock.yaml index 57c6a5a..1fd025b 100644 --- a/sst/pnpm-lock.yaml +++ b/sst/pnpm-lock.yaml @@ -3,7 +3,6 @@ lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false - injectWorkspacePackages: true importers: diff --git a/sst/src/components/websocket-lambda-api.ts b/sst/src/components/websocket-lambda-api.ts index 55c84e3..d3002e3 100644 --- a/sst/src/components/websocket-lambda-api.ts +++ b/sst/src/components/websocket-lambda-api.ts @@ -98,7 +98,20 @@ export function WebSocketLambdaApi(name: string, args: WebSocketLambdaApiArgs): for (const r of routes) { api.route(r.routeKey, { - handler: args.handler, + // `bundle` + `handler`, NOT `handler` alone. `args.handler` is a + // PREBUILT artifact directory (cargo-lambda output containing + // `bootstrap`) — SST's `bundle` is the documented way to say "I built + // this myself, skip bundling". + // + // Passing it as `handler` instead makes SST try to BUILD it, and it + // dispatches its builder on the runtime string. There is no builder + // registered for the literal `provided.al2023` (SST expects `rust` or + // `go` as the build input and maps those to it), so every route failed + // with `Runtime not found: provided.al2023` — after successfully + // creating its log group and role, which made it look like a + // permissions problem rather than a build one. + bundle: args.handler, + handler: 'bootstrap', runtime: args.runtime ?? 'provided.al2023', architecture: args.architecture ?? 'arm64', timeout: r.timeout,