Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
38447e7a fix(ai-sandbox-sprites): address adversarial-review findings
Lifecycle / cancellation (client.ts):
- exec(): parse control frames synchronously so an early kill/close can't read
a stale (undefined) session id; kill()/abort now reach the server-side kill
endpoint even before session_info arrives, instead of orphaning the remote
process (H4). Add a connect watchdog so a CONNECTING stall fails wait()
instead of hanging forever (M3). An explicit kill() resolves wait() with a
conventional 137 rather than rejecting (G3).
- restoreCheckpoint(): probe a write→read round-trip (not just a directory
list) so it resolves only once the restored overlay actually serves reads,
not while it is merely listable (H5); honor the caller's AbortSignal during
the multi-minute readiness wait (M5).
- createCheckpoint(): return the version THIS call created (pre/post diff +
stream parse) instead of the current max, which a concurrent or
eventually-consistent list could make wrong (M4).
Handle / provider:
- ports.connect() no longer silently downgrades URL auth to public; it returns
a token-authenticated channel for sprite-auth Sprites and never mutates the
mode (H3).
- create() runs the workspace mkdir from '/', so a non-default workdir is not
created with its own (not-yet-existent) dir as cwd (G2).
- fs error messages fall back to stdout, since the fast path folds stderr into
stdout for instant commands (M1).
- restoreCheckpoint(ref) validates the Sprite-name component of a name#vN ref
(L1).
Packaging / docs:
- Add engines node>=22.4 (global undici WebSocket); fix the Node-version
comment and the readyTimeoutMs JSDoc (M8/N1).
Tests: add deterministic client.test.ts (stub WebSocket + fetch: frame demux,
abnormal-close→throw, kill endpoint, early-abort kill, createCheckpoint id,
fsRead 404→throw, lifecycle) and provider.test.ts (create naming/urlAuth/mkdir,
resume branches); update handle.test.ts for the no-downgrade connect and ref
validation (H6).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>