Skip to content

Expose runtime image handles across SDKs safely#433

Merged
DorianZheng merged 3 commits into
mainfrom
codex/expose-image-handle-across-sdks
Apr 15, 2026
Merged

Expose runtime image handles across SDKs safely#433
DorianZheng merged 3 commits into
mainfrom
codex/expose-image-handle-across-sdks

Conversation

@DorianZheng

@DorianZheng DorianZheng commented Apr 7, 2026

Copy link
Copy Markdown
Member

What changed

  • expose runtime-scoped image handles across the Python, Node, Go, and C SDKs
  • enforce runtime shutdown and free liveness for FFI image handles and cached SDK image handles
  • restore external Go module consumers by installing both libboxlite.a and include/boxlite.h into the module cache
  • make the FFI rest dependency test-only, document the current Go context.Context cancellation limitation, and cache image handles in Node/Python instead of re-fetching them per call
  • add regression coverage for Go setup, runtime shutdown/free image-handle behavior, and SDK wrapper behavior

Why

The SDKs needed parity with the core runtime image APIs, but the initial rollout had two real follow-up issues:

  • Go module consumers outside a full repo checkout could no longer find boxlite.h
  • FFI image handles could continue operating past the runtime shutdown/free boundary

This update keeps the SDK image-handle API, fixes the Go module packaging path, and makes the shutdown contract explicit across the FFI and language bindings.

Impact

  • SDK users can call runtime.images.pull(...) and runtime.images.list() consistently across Python, Node, Go, and C
  • Go consumers using go get github.com/boxlite-ai/boxlite/sdks/go can build from the published module cache again
  • image handles now reject operations after runtime shutdown/free instead of continuing through a stale execution path
  • Node/Python wrappers no longer pay redundant runtime.images() setup cost on every call

Root cause

  • The Go prebuilt path assumed a full repository checkout after moving the header out of sdks/go
  • the FFI image-handle path owned enough runtime state to stay usable after shutdown unless it checked liveness explicitly
  • the wrapper SDKs mirrored the older per-call runtime-image lookup instead of caching the handle once

Validation

  • cargo fmt --all
  • git diff --check
  • cargo test -p boxlite-ffi
  • cargo clippy -p boxlite-ffi --tests -- -D warnings
  • cargo check -p boxlite-node -p boxlite-python
  • cd sdks/go && go test ./cmd/setup
  • pre-push make test hook for changed components (c ffi go node python rust)

@DorianZheng DorianZheng marked this pull request as ready for review April 7, 2026 10:48
@DorianZheng DorianZheng changed the title [codex] Expose runtime image handle across SDKs Expose runtime image handles across SDKs safely Apr 14, 2026
@DorianZheng DorianZheng merged commit b76a1e7 into main Apr 15, 2026
41 checks passed
@DorianZheng DorianZheng deleted the codex/expose-image-handle-across-sdks branch April 15, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant