fix(runpod): make new pods accept the configured SSH key - #1203
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review: needs changes before merge. Reviewed July 31, 2026, 11:22 AM ET / 15:22 UTC. ClawSweeper reviewWhat this changesThe PR loads the configured SSH key’s adjacent public-key file, validates it before deployment, and places it in RunPod’s pod environment as Merge readinessKeep this PR open: it has strong redacted live RunPod proof and a focused fix for the linked SSH-authentication bug, but the current shared validator still accepts malformed OpenSSH key payloads and can therefore create a paid pod that cannot authorize Crabbox’s identity. Priority: P2 Review scores
Verification
How this fits togetherCrabbox converts a lease configuration into a RunPod pod request, then uses the configured local SSH identity for readiness, repository sync, and remote commands. The provider request must receive a valid matching public key so the remote image can add it to flowchart LR
Config[Lease configuration] --> KeyPath[Configured SSH key path]
KeyPath --> PublicKey[Adjacent public-key file]
PublicKey --> Validation[OpenSSH key validation]
Validation --> PodRequest[RunPod pod request]
PodRequest --> PodEnv[PUBLIC_KEY environment]
PodEnv --> SSHAccess[SSH readiness, sync, and commands]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use a complete authorized-key parser for the shared helper, add malformed-payload coverage, preserve the exact validated public key in the RunPod request, and remove the release-owned changelog entry before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: provide a configured Is this the best way to solve the issue? No, not yet: serializing the configured key is the correct narrow repair, but the current type-and-token heuristic does not prove a complete OpenSSH authorized key and fails the stated preflight guarantee. A standard authorized-key parser is the safer shared-core solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5aa1c3983874. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks, @morluto — I pushed a small maintainer follow-up on top of your commit. I moved adjacent public-key loading and validation into the shared core helper, reused the existing OpenSSH type guard from KubeVirt, added a clear error for an unconfigured key path, and covered missing, empty, and private-key-content Your redacted live RunPod proof—successful SSH, sync, and command execution plus zero pods after the missing-sidecar failure—was the deciding evidence for moving this forward. Thank you for doing that careful validation. |
Closes #1202
What Problem This Solves
Fixes an issue where users provisioning RunPod leases with a configured
ssh.keywould receive a running pod with an exposed SSH port but no matching authorized key. The pod could reportPUBLIC_KEYasnull, leaving Crabbox's SSH readiness check unable to authenticate.Why This Change Was Made
The RunPod provider now reads the configured key's adjacent
.pubfile before creating the pod and serializes that exact value asenv.PUBLIC_KEYin thePOST /podsrequest. Missing or empty public-key files fail before the paid resource is created.This keeps key ownership unchanged: the private key remains local, and only its public half is included in the provider request.
User Impact
RunPod pods created by Crabbox can authorize the same SSH identity that Crabbox uses for readiness, sync, and command execution. Invalid local key configuration now fails before pod creation instead of producing an unreachable running lease.
Evidence
RUNNINGwith public port 22 but could not authenticate; the pod environment showedPUBLIC_KEYasnull..pubvalue reaches the acquire request and JSON serialization preserves it asenv.PUBLIC_KEY.go test ./internal/providers/runpod -count=1— pass.go test -race ./internal/providers/runpod ./internal/providers/all -count=1— pass.go vet ./internal/providers/runpod ./internal/providers/all— pass.go build -trimpath -o /tmp/crabbox-runpod-key-check ./cmd/crabbox— pass.Live provider proof
Validated commit
1a3b1aabb466ef48bcbf46b500de9e6d594e1037with the patched Crabbox binary and a disposable SSH key created only for this test.The one-shot RunPod lease completed SSH readiness, repository sync, and a remote command:
The missing-sidecar preflight was also exercised with the disposable public-key file temporarily absent:
The private key remained local. The evidence above omits the disposable key value, API credentials, host/IP, port, local paths, and provider endpoints. RunPod reported no remaining pods after either check.