feat(sandbox): forward provisioning progress via ensureWorkspaceSandbox onProgress#161
Merged
Conversation
…ox onProgress
Add an optional onProgress callback to EnsureWorkspaceSandboxOptions,
threaded into the waitFor('running') calls on both the stopped-box resume
and cold-create paths. Surfaces the SDK's real provisioning sub-steps
(ProvisionEvent { step, status, message, percent }) to callers, which
previously discarded them by calling waitFor without onProgress.
Purely additive: a caller that passes no onProgress is unchanged, and a
reused running box (no waitFor) emits nothing.
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.
Summary
Adds an optional
onProgresscallback toEnsureWorkspaceSandboxOptions, threaded into thewaitFor('running')calls on both provisioning paths — stopped-box resume (resumeStoppedBox) and cold create. The SDK'swaitForemits real provisioning sub-steps asProvisionEvent { step, status, message, percent }over SSE; today the substrate discards them by callingwaitFor('running', { timeoutMs })with noonProgress. This forwards them to callers so they can surface live "warming up" status instead of an opaque silent wait.Why
A box coming up cold is silent for however long provisioning takes. Consumers (e.g. the GTM agent's graceful slow-chat work) want to show honest progress — "Pulling image…", "Starting container…", "Health check…" — rather than a blank spinner or a false timeout. This exposes the data the SDK already produces.
What changed
EnsureWorkspaceSandboxOptionsgainsonProgress?: (event: ProvisionEvent) => void.ensureWorkspaceSandboxdestructuresonProgressand passes it into:resumeStoppedBox(...)→match.waitFor('running', { timeoutMs, onProgress })box.waitFor('running', { timeoutMs: 120_000, onProgress })ProvisionEventfrom@tangle-network/sandbox.Compatibility
Purely additive. A caller that passes no
onProgressbehaves exactly as before, and a reused running box (which skipswaitFor) emits nothing.onProgressis spread conditionally, sowaitForoptions are byte-identical to today when it's absent.Testing
tsc --noEmitclean.vitest run src/sandbox— 106 passing; the 3 failingdeferred profile filestransport-retry tests are pre-existing and fail identically onmainwithout this change (verified by stashing the diff). They are unrelated to this change (retry/auth-refresh timing, notwaitFor/provisioning).