Keep the connector's gRPC code when a Lambda connector fails at startup #1243
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 250 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1243"
general
weight: 0.35
ggreer
Summary
When a connector failed to build at Lambda startup (for example, bad credentials),
lambda-runreturned the error and the process exited. The caller then got onlyRuntime.ExitErrorand the log tail, soLambdaInvokeFailure.Code()wasUnknown. The connector's real gRPC code was lost. For example, a GitHub connector with a bad App key reportedUnknowninstead ofUnauthenticated.Changes in
pkg/cli/lambda_server__added.go, regular (non per-invoke-identity) mode:connector.Registerruns only when the build succeeded.ensureInitialGenerationbuilds and registers the connector if there isn't one yet. While the build keeps failing, its error is returned as the invoke's status viaErrorResponse, keeping its gRPC code.Per-invoke identity mode is unchanged. It builds its own reloader with a connector already in place, so this path never runs there.
Testing
TestLambdaConnectorReloaderRetriesFailedInitialBuild. A failed build returns itsUnauthenticatedstatus, and no connector is registered. The next invoke retries, registers and serves the call. Once a connector is registered, later invokes don't rebuild it.go test -tags baton_lambda_support ./pkg/cli/,go vetandgolangci-lintpass.code = Unauthenticatedfrom the Lambda response, where it had previously receivedUnknown.Notes
🤖 Generated with Claude Code