fix(sandbox-tenki): address review feedback, update @tenkicloud/sandbox to ^0.5.4 - #2
Open
camcalaquian wants to merge 1 commit into
Open
Conversation
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.
Addresses the bot review feedback on VoltAgent#1387 and bumps the SDK. Merging this into
feat/sandbox-tenkiupdates the upstream PR directly.Review feedback addressed
cubic P1 — abort/timeout during resume can wedge the lifecycle queue (
sandbox.ts)session.resume()is a unary RPC with no transport deadline, so a dead connection could holdlifecycleTransition(and every laterstop()/start()/execute()on a paused sandbox) forever. Two-part fix:RESUME_TRANSITION_TIMEOUT_MS(180s, matching the SDK'swaitResumeddefault); on expiry the sandbox stayspausedand the queue drains. Retrying is safe — the engine treats resume on an already-RUNNING session as idempotent (verified in the engine source,resume_session.go).execute()passes its cancellation signal intoresumeIfPaused, so a transition whose caller already timed out/aborted bails out at the head of the queue instead of issuing a resume RPC nobody is waiting for.cubic P2 — mid-stream pump failure silently truncates output (
sandbox.ts,utils.ts)A pump that dies mid-read now flags its buffer as
failed;resolveOutputthen prefers the resolved run's complete aggregate bytes (still subject tomaxOutputBytestruncation) over the silently-short streamed buffer.cubic P3 — multiline
reasoninjects extra stderr lines (utils.ts)CR/LF in the guest agent's free-form
reasonare collapsed to spaces before composing the single-line diagnostic.cubic P3 — docs omit
TENKI_AUTH_TOKEN(website/docs/workspaces/sandbox.md)Now mentions both fallback env vars, consistent with the README.
CodeRabbit — reject blank/multiline SSH keys (
tools.ts)publicKeyschema now refines to non-empty, single-line entries before any provisioning/mutation, with schema tests.CodeRabbit nitpicks — all four taken:
createTenkiToolkitaccepts a narrow exportedTenkiToolkitSandbox(Pick<TenkiSandbox, "getSandbox" | "authorizeSshKey">); the test mock no longer needsas unknown as TenkiSandbox.vi.clearAllMocks()→vi.resetAllMocks()so per-test mock implementations don't leak across tests.stdin/_writeSpyscaffolding frommakeHandle.SDK update
@tenkicloud/sandbox^0.5.1→^0.5.4, lockfile regenerated with the repo-pinnedpnpm@8.10.5(--frozen-lockfilere-validated). The 0.5.4 pin ofws@8.21.1/@bufbuild/protobuf@2.12.1re-keys a few dependent lockfile entries; no adapter API changes were needed.Validation
vitest run --coverage: 150 tests passed (was 133), coverage stays 100% lines/branches/functions/statementstsc --noEmit,tsupbuild,publint(pre-existing suggestions only),biome ciclean on changed filespnpm install --frozen-lockfilepasses with pnpm 8.10.5