Feat/islo sdk provider#24
Closed
AdamGold wants to merge 2 commits into
Closed
Conversation
Adds `provider: islo` (alias-free) backed by github.com/islo-labs/go-sdk. Auth comes from ISLO_API_KEY (the SDK's NewIslo handles token exchange and refresh). Operations map to SDK calls: warmup -> CreateSandbox, status -> GetSandbox (with --wait polling), list -> ListSandboxes, stop -> DeleteSandbox. Run streams stdout/stderr live by consuming the islo SSE exec endpoint directly (the SDK currently buffers SSE through its JSON wrapper); auth and base URL still come from the SDK so retry/refresh stay consistent. Mirrors the existing blacksmith provider's dispatch and lease/claim model: - IsloConfig + islo: YAML block + CRABBOX_ISLO_* env overrides - --islo-image, --islo-workdir, --islo-gateway-profile flags on warmup/run - isb_<sandbox-name> lease IDs in the local claim store - Rejects --desktop, --browser, --sync-only, --checksum, --force-sync-large, --actions-runner for islo (all delegated or unsupported) - target.go skips coordinator routing; screenshot/vnc reject islo Tests: hand-rolled fake IsloClient (interface seam) covers warmup, run, streaming output, exit-code propagation, list, status wait + timeout, stop, auth-failure surfacing, lease-ID resolution, and SSE parsing. Existing config tests extended with islo YAML and CRABBOX_ISLO_* assertions. Live smoke against api.islo.dev confirmed warmup, status --wait, run with streamed stdout/stderr and nonzero exit propagation, list --json, and stop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The islo API has three exec entrypoints; the doc now records why we picked POST /exec/stream (batch, no stdin) over WebSocket /exec (interactive PTY) and over POST /exec + GetExecResult polling. Adds the SSE wire format (event: stdout|stderr|exit + data: lines) so a future maintainer can debug without reading parseIsloSSE. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
I tested this, seems not yet to be working and codex prefers the cli approach. I first need to see if your service makes sense, tbh the only reason we added blacksmith is because they sponsor us. |
Contributor
|
Thanks for the SDK-based follow-up and the detailed write-up. Closing for now because Crabbox is not taking an Islo provider integration at this point; providers are staying focused on the current ownership/provisioning backends. If we revisit Islo later after the service/product fit is clearer, I would start from a fresh, smaller design rather than keep this broad provider PR open. |
Closed
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.
replacing #16 for adding islo.dev support with Go SDK
Summary
Adds
provider: isloto crabbox, driven by the islo Go SDK. NoisloCLI required. Auth viaISLO_API_KEY; the SDK'sNewIslohandles API-key → JWT exchange and auto-refresh.Mapping
Sandboxes.CreateSandboxSandboxes.CreateSandbox(idempotent) + direct SSE consumer onPOST /sandboxes/{name}/exec/streamSandboxes.GetSandbox;--waitpolls every 2sSandboxes.ListSandboxesSandboxes.DeleteSandboxWhy a custom SSE consumer
The SDK's
Sandboxes.ExecInSandboxStreamreturnsinterface{}via the standard JSONcaller.Call— it buffers the SSE body and decodes, so callers don't see live deltas. Until the SDK exposes a streaming iterator,internal/cli/islo.goissues the streaming request directly. Auth (customauth.Provider), base URL, and token refresh still come from the SDK, so behavior stays in lockstep withNewIslo. The wire format observed againstapi.islo.devis plain SSE (event: stdout|stderr|exit, one or moredata:lines, blank-line terminator);parseIsloSSEfollows the spec including multi-linedata:joining and the leading-space strip.Mirrors the blacksmith pattern
IsloConfigstruct +islo:YAML block +CRABBOX_ISLO_*env overrides--islo-image,--islo-workdir,--islo-gateway-profileflags onwarmup/runisb_<sandbox-name>in the existing claim store; reusesclaimLeaseForRepoProvider,removeLeaseClaim,newLeaseSlug,resolveLeaseClaimunchangedserverTypeForConfig/serverTypeForProviderClassreturn""for islorun.go,pool.go,status.go,capabilities.go,target.go,screenshot.go,vnc.goaddisIsloProvidernext to existingisBlacksmithProviderchecksTests
Hand-rolled fake
IsloClient(interface seam) drives unit tests for warmup, run, streaming output, exit-code propagation, list (text + JSON), status wait, status timeout, stop, auth-failure surfacing, lease-ID resolution, and SSE parsing.config_test.goextended with islo YAML +CRABBOX_ISLO_*env assertions.Live verification (against api.islo.dev)
go vet ./...gofmt -l $(git ls-files '*.go')cleango test -race ./...go build -trimpath -o bin/crabbox ./cmd/crabboxnode scripts/check-docs-links.mjsandnode scripts/check-command-docs.mjspasscrabbox warmup --provider islo— sandbox created, lease + slug printedcrabbox status --provider islo --id <sandbox> --wait— polled torunningcrabbox run --provider islo --id <sandbox> -- echo hello— streamed stdoutcrabbox run --provider islo --id <sandbox> -- bash -lc '...; sleep 1; ...; exit 7'— interleaved stdout/stderr arriving live; exit code 7 propagates asExitError{Code: 7}crabbox list --provider islo --json— sandbox visible withrunningstatuscrabbox stop --provider islo <sandbox>— sandbox released, claim removedISLO_API_KEY→ exit 2 with actionable message--desktop→ exit 2 (islo sandboxes are headless)--sync-only→ exit 2 (sync is delegated)Follow-ups (not part of this PR)
go-sdk: exposeSandboxes.ExecStream(ctx, ...) <-chan ExecLogLine(or similar) so the custom SSE consumer here can be deleted.🤖 Generated with Claude Code