Repository navigation
Give a resumed sandbox its Daytona API key back - #260
Merged
Merged
Conversation
A paused sandbox's saved state leaves out the API key. Resuming it did not put the key back, so repository archive uploads and file downloads in the resumed session failed with "Daytona API key is unavailable". That broke every pull request review turn that resumed a sandbox: the checkout of the pull request failed, so the agent could not push its fix. Both runtimes now resume through resumeDaytonaSandbox, which sets the key from the worker's configuration.
Contributor
Author
|
Gitlink bump: superloglabs/responder#391 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Pull request review turns can't push fixes when they resume a paused sandbox. Checking out the pull request fails with
Daytona API key is unavailable for file upload, andupdate_pull_requestthen refuses to push.This is the case for every review turn that resumes: tag mode threads and automation runs. In production, 5 review turns on customer pull requests hit it since #257 shipped (stacksyncdata
workflows-frontend#1737,connectors#2076,event-forward#85). A test with Codex reviewing superloglabs/otel-helpers#1 failed the same way.Cause
When a sandbox pauses, its saved state drops
apiKeyso the key isn't stored in the database. On resume,DaytonaSandboxClient.resumeuses the client's key to reach Daytona, but the session's state keepsapiKeyempty.uploadRepositoryArchiveanddownloadRepositoryFileread the key fromsession.state, so they throw.Change
resumeDaytonaSandboxinsandbox.tsdeserializes the saved state and resumes it withapiKeyset from the worker's Daytona configuration.investigate.ts) and automation runs (automation-sandbox.ts) resume through it.Validation
resumeDaytonaSandbox. The automation sandbox resume test now checks the key is passed.pnpm typecheck,pnpm lint(no new warnings),pnpm test(2053 passed).Summary by cubic
Fixes resumed sandboxes in review turns losing their Daytona API key, which broke pull request file transfers and prevented pushing fixes.
On pause, the saved state drops
apiKey. On resume,resumeDaytonaSandboxrestores it from the worker's Daytona configuration; tag mode (investigate.ts) and automation runs (automation-sandbox.ts) both resume through it. The key still never lands in saved state.resumeDaytonaSandboxdeserializes the saved state and resumes with the worker'sdaytonaApiKey.Written for commit 1dbf01f. Summary will update on new commits.