Skip to content

More perf improvements#1416

Merged
jhaynie merged 8 commits intomainfrom
fix/job-logs-v2-stream
Apr 28, 2026
Merged

More perf improvements#1416
jhaynie merged 8 commits intomainfrom
fix/job-logs-v2-stream

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented Apr 28, 2026

Summary by CodeRabbit

  • New Features

    • Added optional wait-for-status and timeout when waiting for sandbox status
    • Commands now cache and reuse richer sandbox routing context (region + org)
  • Bug Fixes

    • Cache operations are now fault-tolerant to avoid blocking CLI actions
    • Normalizes missing org info in sandbox responses to a usable object
  • Performance

    • Faster, lower-memory file transfers using streamed archives and direct streaming
    • Reduced tail latency when completing sandbox runs
  • Tests

    • Added test covering sandbox info normalization when org is absent

jhaynie added 5 commits April 16, 2026 22:44
The job logs command was missing the v2 flag when calling streamUrlToWritable.
Without this flag, Pulse uses a 500ms timeout probe that can fall back to the
legacy path which cannot serve v2 stream data.
@agentuity-agent
Copy link
Copy Markdown

agentuity-agent Bot commented Apr 28, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🔴 Failed (deploy_f8104ca9bc2e98b2cafd2889174fcc7b) - 2026-04-28T19:08:09Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a513fde4-1e9d-4045-a04d-bd873dca7eab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaces many CLI sandbox commands to use a new resolveSandboxTarget/cacheSandboxTarget flow, migrates fs transfers to streamed tar.gz archives and streaming I/O, refactors execution completion to poll executions in parallel with stream draining, extends sandbox API wait parameters and response shapes, and makes SQLite cache access fault-tolerant.

Changes

Cohort / File(s) Summary
Database resilience
packages/cli/src/cache/resource-region.ts
Initialize SQLite with WAL journaling, 5s busy timeout, and NORMAL synchronous mode. Wraps cache reads/writes in try/catch so failed DB queries return null or are ignored instead of throwing.
Sandbox target resolution infra & cache
packages/cli/src/cmd/cloud/sandbox/util.ts
Adds exported ResolvedSandboxTarget interface, resolveSandboxTarget(...) function (cache-first resolver that may call sandboxResolve), and cacheSandboxTarget(...) to persist region+orgId routing context.
Replace sandboxResolve → resolveSandboxTarget (checkpoints)
packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts, .../delete.ts, .../list.ts, .../restore.ts
All checkpoint subcommands now call resolveSandboxTarget(logger, auth, apiClient, sandboxId, configName, config) instead of direct sandboxResolve, passing logger/auth/config through resolution.
Replace sandboxResolve → resolveSandboxTarget (basic sandbox ops)
packages/cli/src/cmd/cloud/sandbox/create.ts, delete.ts, env.ts, get.ts, pause.ts, resume.ts, run.ts
Sandbox create/delete/env/get/pause/resume/run updated to use resolveSandboxTarget and to cache routing via cacheSandboxTarget where applicable; get.ts adds waitForStatus/waitMs CLI options forwarded to API.
Replace sandboxResolve → resolveSandboxTarget (jobs & executions)
packages/cli/src/cmd/cloud/sandbox/job/create.ts, .../destroy.ts, .../get.ts, .../list.ts, .../logs.ts, .../execution/list.ts
All job and execution list/logs subcommands now use resolveSandboxTarget (logger + auth + config flow) instead of sandboxResolve; logs.ts sets stream option v2: true.
Replace sandboxResolve → resolveSandboxTarget (fs basic ops)
packages/cli/src/cmd/cloud/sandbox/fs/ls.ts, mkdir.ts, rm.ts, rmdir.ts
Filesystem listing and directory ops now resolve region/orgId via resolveSandboxTarget with logging/auth and config context.
Filesystem — archive uploads/downloads & streaming
packages/cli/src/cmd/cloud/sandbox/fs/cp.ts, .../upload.ts, .../download.ts
Directory uploads now create on-disk tar.gz and call sandboxUploadArchive; directory downloads fetch tar.gz via sandboxDownloadArchive and extract locally. Single-file uploads/downloads switch to streaming (createReadStream → web Readable conversion, pipeline, createWriteStream) and use file stats for byte counts. Adds createTarGzArchive helper; removes in-memory per-file buffering.
Filesystem — single-file streaming & tools
packages/cli/src/cmd/cloud/sandbox/fs/download.ts, .../upload.ts, .../cp.ts
Archive and single-file handlers no longer buffer whole responses in memory; they stream to disk via pipeline(Readable.fromWeb(...), createWriteStream) and compute sizes from filesystem metadata.
Execution completion & stream coordination
packages/cli/src/cmd/cloud/sandbox/exec.ts, packages/core/src/services/sandbox/run.ts
Exec flow now races execution long-poll with concurrent stream draining; when executionId present, sandboxRun long-polls executionGet in parallel with draining streams and uses final execution status/exitCode as primary source. Adds abort-aware stream helpers and awaits writable completion.
Sandbox API: wait params & response shape changes
packages/core/src/services/sandbox/get.ts, .../getStatus.ts, .../create.ts
Adds waitForStatus and waitMs params to sandboxGet/sandboxGetStatus schemas and query serialization. sandboxGet normalizes org to non-null object when missing. SandboxCreateDataSchema accepts optional executionId in responses.
Tests
packages/server/test/sandbox-client.test.ts
Adds a test asserting sandboxGet normalization when server returns org: null and client constructed with orgId, verifying info.org becomes non-null object derived from provided orgId.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
packages/cli/src/cache/resource-region.ts (1)

128-129: Add minimal diagnostics in silent cache failure paths.

These catch {} blocks make persistent DB failures invisible; a trace/debug log would materially improve supportability without blocking CLI flows.

Also applies to: 170-172, 205-207, 219-221

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cache/resource-region.ts` around lines 128 - 129, Replace
the empty catches that currently read "catch { return null; }" with "catch (err)
{ console.debug('resource-region cache operation failed:', err); return null; }"
(or use the project's logger if available) so each silent DB/cache failure in
packages/cli/src/cache/resource-region.ts emits a minimal diagnostic including
the error object; apply the same change to the other occurrences of the empty
catch blocks.
packages/cli/src/cmd/cloud/sandbox/fs/upload.ts (1)

51-58: Fail fast on local file validation before remote resolution.

Right now target resolution runs before checking the archive path. Moving local file checks first avoids unnecessary API calls when the file is invalid.

Suggested reorder
 	async handler(ctx) {
 		const { args, opts, options, auth, logger, apiClient } = ctx;
 
+		const stat = statSync(args.archive);
+		if (!stat.isFile()) {
+			logger.fatal(`${args.archive} is not a file`);
+		}
+		const bytes = stat.size;
+		const content = Readable.toWeb(createReadStream(args.archive)) as ReadableStream<Uint8Array>;
+
 		const { region, orgId } = await resolveSandboxTarget(
 			logger,
 			auth,
 			apiClient,
 			args.sandboxId,
 			ctx.config?.name ?? 'production',
 			ctx.config
 		);
 
 		const client = createSandboxClient(logger, auth, region);
-
-		const stat = statSync(args.archive);
-		if (!stat.isFile()) {
-			logger.fatal(`${args.archive} is not a file`);
-		}
-
-		const bytes = stat.size;
-		const content = Readable.toWeb(createReadStream(args.archive)) as ReadableStream<Uint8Array>;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/cloud/sandbox/fs/upload.ts` around lines 51 - 58, Move
the local archive validation to run before calling resolveSandboxTarget to fail
fast on invalid files: in upload.ts validate the archive path (check existence,
readability and correct archive format for args.archivePath or the variable used
for the upload source) and return/exit with a clear logger error if invalid,
then only call resolveSandboxTarget(logger, auth, apiClient, args.sandboxId,
ctx.config?.name ?? 'production', ctx.config) after the local checks pass;
adjust any early-return/error handling so resolveSandboxTarget (and its
region/orgId resolution) is not invoked when the local file is invalid.
packages/cli/src/cmd/cloud/sandbox/get.ts (1)

65-77: Consider rejecting empty waitForStatus arrays.

Allowing [] makes wait semantics unclear. A non-empty constraint would make intent explicit.

Suggested schema tweak
 		options: z.object({
 			waitForStatus: z
-				.array(z.string())
+				.array(z.string().min(1))
+				.nonempty()
 				.optional()
 				.describe('Wait for one of these statuses before returning'),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/cloud/sandbox/get.ts` around lines 65 - 77, The current
options schema allows an empty waitForStatus array which makes wait semantics
ambiguous; update the waitForStatus schema (inside the options object) to reject
empty arrays by adding a non-empty constraint (e.g., call .nonempty() on the
z.array(z.string()) before .optional()), so when waitForStatus is provided it
must contain at least one status string; leave waitMs unchanged.
packages/cli/src/cmd/cloud/sandbox/fs/cp.ts (1)

237-244: Redundant file existence check.

Line 237 checks Bun.file(resolvedPath).exists() but the result is only used to guard a statSync call that itself has throwIfNoEntry: false. The statSync would return undefined if the file doesn't exist, making the exists() check redundant.

Consider simplifying:

♻️ Simplified file check
 const resolvedPath = resolve(localPath);
-
-	if (!(await Bun.file(resolvedPath).exists())) {
-		const stat = statSync(resolvedPath, { throwIfNoEntry: false });
-		if (!stat) {
-			logger.fatal(`Local path not found: ${localPath}`);
-		}
+	const stat = statSync(resolvedPath, { throwIfNoEntry: false });
+	if (!stat) {
+		logger.fatal(`Local path not found: ${localPath}`);
 	}
-
-	const stat = statSync(resolvedPath);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/cloud/sandbox/fs/cp.ts` around lines 237 - 244, Remove
the redundant Bun.file(resolvedPath).exists() check and the duplicate statSync
call: call statSync(resolvedPath, { throwIfNoEntry: false }) once, store its
result in a single `stat` variable, and if that result is falsy call
`logger.fatal(\`Local path not found: ${localPath}\`)`; then continue using that
`stat` for subsequent logic. This replaces the exists() guard and avoids calling
statSync twice while preserving the existing error handling.
packages/cli/src/cmd/cloud/sandbox/exec.ts (1)

378-403: Missing abort signal propagation in fast terminal poll.

The waitForTerminalExecutionFast function doesn't accept or propagate an AbortSignal, meaning if the user sends SIGINT/SIGTERM during the fast poll phase, in-flight executionGet requests won't be cancelled immediately. The outer abort handler at lines 96-101 triggers, but individual requests will complete before the loop can check termination.

Consider accepting and propagating the signal:

♻️ Proposed fix to propagate abort signal
 async function waitForTerminalExecutionFast(
 	client: Parameters<typeof executionGet>[0],
 	executionId: string,
 	orgId: string,
-	logger: Parameters<typeof streamUrlToWritable>[2]
+	logger: Parameters<typeof streamUrlToWritable>[2],
+	signal?: AbortSignal
 ) {
 	const deadline = Date.now() + EMPTY_STREAM_FAST_TIMEOUT_MS;
 	while (Date.now() < deadline) {
-		const info = await executionGet(client, { executionId, orgId });
+		if (signal?.aborted) {
+			throw new DOMException('Aborted', 'AbortError');
+		}
+		const info = await executionGet(client, { executionId, orgId, signal });
 		if (TERMINAL_EXECUTION_STATUSES.has(info.status)) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/cloud/sandbox/exec.ts` around lines 378 - 403, The
fast-poll loop in waitForTerminalExecutionFast does not accept or forward an
AbortSignal so in-flight executionGet calls won't be cancelled; modify
waitForTerminalExecutionFast signature to accept an AbortSignal (e.g., signal:
AbortSignal), check signal.aborted inside the loop to exit early, and pass that
signal to every executionGet invocation (both the loop calls and the final
fallback call with wait: EXECUTION_WAIT_DURATION) so in-flight requests are
aborted promptly when the outer handler signals cancellation. Ensure any
sleep/wait respects the signal (abort the timeout) or returns immediately when
signal.aborted.
packages/core/src/services/sandbox/run.ts (1)

606-611: Duck-typing for writable stream detection could be fragile.

The check 'once' in writable is used to detect Node.js-style writables before calling finished(). While this works, it's a heuristic that could break if a custom writable has an once property but isn't compatible with finished().

Consider using a more explicit type guard or just wrapping in try-catch without the pre-check:

♻️ Alternative: rely on try-catch alone
 		writable.end();
-		if ('once' in writable) {
-			await finished(writable as NodeJS.WritableStream).catch(() => {
-				// Ignore finish errors here; the main read/write path already
-				// reported meaningful stream errors.
-			});
-		}
+		await finished(writable as NodeJS.WritableStream).catch(() => {
+			// Ignore finish errors here; the main read/write path already
+			// reported meaningful stream errors.
+		});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/services/sandbox/run.ts` around lines 606 - 611, The
duck-typing check "'once' in writable" is fragile; remove the pre-check and
instead invoke finished(writable as NodeJS.WritableStream) inside a try/catch so
non-Node writables won't cause incorrect detection and any errors are safely
ignored as intended. Update the block around the writable variable where
finished(...) is called (the code that currently checks "'once' in writable") to
simply await finished(...) wrapped in try { await finished(...) } catch { /*
ignore finish errors */ } so behavior remains the same without relying on the
'once' property heuristic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/cli/src/cmd/cloud/sandbox/util.ts`:
- Around line 24-46: The apiClient fallback is unreachable because
resolveSandboxTarget's parameter apiClient is typed as required; update the
function signature in resolveSandboxTarget to make apiClient optional (e.g.,
apiClient?: APIClient | null) so the nullish-coalescing fallback to
getGlobalCatalystAPIClient can run, and ensure any call sites that pass
undefined/null are adjusted or accept the optional parameter; no other logic
changes needed (keep sandboxResolve, getGlobalCatalystAPIClient, and
setResourceInfo usage as-is).

---

Nitpick comments:
In `@packages/cli/src/cache/resource-region.ts`:
- Around line 128-129: Replace the empty catches that currently read "catch {
return null; }" with "catch (err) { console.debug('resource-region cache
operation failed:', err); return null; }" (or use the project's logger if
available) so each silent DB/cache failure in
packages/cli/src/cache/resource-region.ts emits a minimal diagnostic including
the error object; apply the same change to the other occurrences of the empty
catch blocks.

In `@packages/cli/src/cmd/cloud/sandbox/exec.ts`:
- Around line 378-403: The fast-poll loop in waitForTerminalExecutionFast does
not accept or forward an AbortSignal so in-flight executionGet calls won't be
cancelled; modify waitForTerminalExecutionFast signature to accept an
AbortSignal (e.g., signal: AbortSignal), check signal.aborted inside the loop to
exit early, and pass that signal to every executionGet invocation (both the loop
calls and the final fallback call with wait: EXECUTION_WAIT_DURATION) so
in-flight requests are aborted promptly when the outer handler signals
cancellation. Ensure any sleep/wait respects the signal (abort the timeout) or
returns immediately when signal.aborted.

In `@packages/cli/src/cmd/cloud/sandbox/fs/cp.ts`:
- Around line 237-244: Remove the redundant Bun.file(resolvedPath).exists()
check and the duplicate statSync call: call statSync(resolvedPath, {
throwIfNoEntry: false }) once, store its result in a single `stat` variable, and
if that result is falsy call `logger.fatal(\`Local path not found:
${localPath}\`)`; then continue using that `stat` for subsequent logic. This
replaces the exists() guard and avoids calling statSync twice while preserving
the existing error handling.

In `@packages/cli/src/cmd/cloud/sandbox/fs/upload.ts`:
- Around line 51-58: Move the local archive validation to run before calling
resolveSandboxTarget to fail fast on invalid files: in upload.ts validate the
archive path (check existence, readability and correct archive format for
args.archivePath or the variable used for the upload source) and return/exit
with a clear logger error if invalid, then only call
resolveSandboxTarget(logger, auth, apiClient, args.sandboxId, ctx.config?.name
?? 'production', ctx.config) after the local checks pass; adjust any
early-return/error handling so resolveSandboxTarget (and its region/orgId
resolution) is not invoked when the local file is invalid.

In `@packages/cli/src/cmd/cloud/sandbox/get.ts`:
- Around line 65-77: The current options schema allows an empty waitForStatus
array which makes wait semantics ambiguous; update the waitForStatus schema
(inside the options object) to reject empty arrays by adding a non-empty
constraint (e.g., call .nonempty() on the z.array(z.string()) before
.optional()), so when waitForStatus is provided it must contain at least one
status string; leave waitMs unchanged.

In `@packages/core/src/services/sandbox/run.ts`:
- Around line 606-611: The duck-typing check "'once' in writable" is fragile;
remove the pre-check and instead invoke finished(writable as
NodeJS.WritableStream) inside a try/catch so non-Node writables won't cause
incorrect detection and any errors are safely ignored as intended. Update the
block around the writable variable where finished(...) is called (the code that
currently checks "'once' in writable") to simply await finished(...) wrapped in
try { await finished(...) } catch { /* ignore finish errors */ } so behavior
remains the same without relying on the 'once' property heuristic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91c200b4-968f-4b35-baee-7ac5873d23c6

📥 Commits

Reviewing files that changed from the base of the PR and between ff89dc1 and d57bb60.

📒 Files selected for processing (31)
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/core/src/services/sandbox/getStatus.ts
  • packages/core/src/services/sandbox/run.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Agentuity Deployment
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome as code formatter with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/core/src/services/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/core/src/services/sandbox/run.ts
  • packages/core/src/services/sandbox/getStatus.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript Strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/core/src/services/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/core/src/services/sandbox/run.ts
  • packages/core/src/services/sandbox/getStatus.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
packages/core/src/**/*.ts

📄 CodeRabbit inference engine (packages/core/AGENTS.md)

packages/core/src/**/*.ts: Build TypeScript with bun run build command
Run TypeScript type checking with bun run typecheck command
Ensure runtime compatibility with both Browser and Node/Bun environments with no runtime-specific code
Build target must be ESNext with TypeScript declaration files
Prefer interfaces for public APIs
Use generics for reusable type utilities
Ensure no side effects in all exports - all exports must be pure with no global mutations
All relative imports in TypeScript files MUST include the .ts extension
Run bun run build before publishing to compile TypeScript

Files:

  • packages/core/src/services/sandbox/create.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/core/src/services/sandbox/run.ts
  • packages/core/src/services/sandbox/getStatus.ts
packages/cli/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

Use Bun.file(f).exists() instead of existsSync(f) for file existence checks

Files:

  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
🧠 Learnings (3)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/core/src/services/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/core/src/services/sandbox/run.ts
  • packages/core/src/services/sandbox/getStatus.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
📚 Learning: 2026-01-13T04:32:02.691Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 565
File: packages/cli/src/cmd/cloud/region-lookup.ts:14-26
Timestamp: 2026-01-13T04:32:02.691Z
Learning: Enforce sandbox identifier prefixes in new code within the CLI cloud region lookup: new sandboxes must use the sbx_ prefix. The snbx_ prefix may appear in legacy code or examples, but do not use snbx_ for new sandboxes. When reviewing changes in packages/cli/src/cmd/cloud/, ensure any created sandbox identifiers use sbx_ and remove or migrate any snbx_ usages in newly added code.

Applied to files:

  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.

Applied to files:

  • packages/cli/src/cmd/cloud/sandbox/run.ts
  • packages/cli/src/cmd/cloud/sandbox/job/get.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts
  • packages/cli/src/cmd/cloud/sandbox/env.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/cli/src/cmd/cloud/sandbox/job/create.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/ls.ts
  • packages/cli/src/cmd/cloud/sandbox/job/logs.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/rm.ts
  • packages/cli/src/cmd/cloud/sandbox/job/list.ts
  • packages/cli/src/cmd/cloud/sandbox/execution/list.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/delete.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts
  • packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts
  • packages/cli/src/cmd/cloud/sandbox/job/destroy.ts
  • packages/cli/src/cmd/cloud/sandbox/resume.ts
  • packages/cli/src/cmd/cloud/sandbox/util.ts
  • packages/cli/src/cache/resource-region.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/download.ts
  • packages/cli/src/cmd/cloud/sandbox/exec.ts
  • packages/cli/src/cmd/cloud/sandbox/get.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/upload.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
🔇 Additional comments (34)
packages/cli/src/cache/resource-region.ts (1)

21-23: Good SQLite tuning for local cache concurrency.

journal_mode=WAL, busy_timeout, and synchronous=NORMAL are sensible defaults here and align with the cache fault-tolerance direction.

packages/cli/src/cmd/cloud/sandbox/create.ts (1)

209-210: Nice upgrade to cache full sandbox routing context.

Persisting both region and orgId here is consistent with downstream resolveSandboxTarget usage and avoids extra resolve calls.

packages/core/src/services/sandbox/create.ts (1)

142-145: Backward-compatible schema extension looks correct.

Adding optional executionId cleanly supports create+run flows without breaking existing consumers.

packages/cli/src/cmd/cloud/sandbox/job/list.ts (1)

31-38: Resolver migration is solid here.

Using resolveSandboxTarget(...) with profile/config context is consistent and correctly threads region/orgId into jobList.

packages/cli/src/cmd/cloud/sandbox/checkpoint/list.ts (1)

43-50: Good adoption of shared sandbox target resolution.

The resolved target object is used correctly for both client region and checkpoint org scoping.

packages/cli/src/cmd/cloud/sandbox/run.ts (1)

198-199: Good routing-context cache update after run.

Caching {sandboxId, region, orgId} here improves follow-up command targeting and matches the new resolver flow.

packages/cli/src/cmd/cloud/sandbox/pause.ts (1)

40-47: Target resolution refactor is correctly applied.

This keeps pause routing/org scoping aligned with the shared sandbox resolution path.

packages/cli/src/cmd/cloud/sandbox/job/logs.ts (1)

67-74: Looks good: resolver migration + explicit v2 stream selection.

Both changes are consistent with the updated sandbox targeting and streaming protocol flow.

Also applies to: 130-130

packages/cli/src/cmd/cloud/sandbox/job/get.ts (1)

4-5: resolveSandboxTarget migration looks correct here.

The updated import and resolver call are consistent with the command’s auth/apiClient requirements and preserve the existing jobGet flow cleanly.

Also applies to: 25-32

packages/cli/src/cmd/cloud/sandbox/env.ts (1)

4-6: Nice refactor to shared sandbox target resolution.

This update keeps the env mutation path intact while correctly sourcing region/orgId through resolveSandboxTarget.

Also applies to: 47-54

packages/cli/src/cmd/cloud/sandbox/resume.ts (1)

4-6: Looks good—resolver integration is consistent.

The switch to resolveSandboxTarget is clean, and downstream resume execution still uses the resolved region/orgId as expected.

Also applies to: 40-47

packages/cli/src/cmd/cloud/sandbox/fs/rmdir.ts (1)

4-6: Good consistency update for sandbox targeting.

The rmdir command now follows the shared resolver path while preserving the existing sandboxRmDir invocation semantics.

Also applies to: 50-57

packages/cli/src/cmd/cloud/sandbox/job/create.ts (1)

4-6: Refactor is solid in job create.

Using resolveSandboxTarget here keeps the command aligned with the newer shared routing/tenancy resolution flow.

Also applies to: 36-43

packages/cli/src/cmd/cloud/sandbox/execution/list.ts (1)

1-1: Nice update—shared sandbox resolution is correctly applied.

The new resolver call integrates cleanly, and the existing orgId override behavior is preserved.

Also applies to: 6-6, 57-64

packages/cli/src/cmd/cloud/sandbox/checkpoint/delete.ts (1)

4-6: checkpoint delete migration looks good.

The switch to resolveSandboxTarget is straightforward and keeps the delete operation flow intact.

Also applies to: 66-73

packages/cli/src/cmd/cloud/sandbox/fs/ls.ts (1)

4-6: Good consistency change in fs ls.

Using resolveSandboxTarget here aligns with the broader sandbox command pattern and preserves existing list behavior.

Also applies to: 66-73

packages/cli/src/cmd/cloud/sandbox/fs/rm.ts (1)

38-45: Resolver migration looks correct.

The new resolveSandboxTarget(...) wiring is consistent and preserves downstream usage of region and orgId.

packages/cli/src/cmd/cloud/sandbox/checkpoint/restore.ts (1)

45-52: Sandbox target resolution update is solid.

No regressions in the restore path; resolved region/org routing is used correctly.

packages/cli/src/cmd/cloud/sandbox/fs/mkdir.ts (1)

49-56: LGTM on resolver migration in mkdir.

The updated resolution call is correctly integrated and keeps API usage intact.

packages/cli/src/cmd/cloud/sandbox/get.ts (1)

87-108: Good integration of target resolution + target cache write.

resolveSandboxTarget(...) and cacheSandboxTarget(...) usage is consistent in this flow.

packages/cli/src/cmd/cloud/sandbox/checkpoint/create.ts (1)

45-52: Checkpoint create resolver update looks correct.

No issues found in the changed routing/tenant resolution path.

packages/cli/src/cmd/cloud/sandbox/job/destroy.ts (1)

41-48: job destroy target resolution change is clean.

The resolved region/orgId plumbing into jobStop remains correct.

packages/cli/src/cmd/cloud/sandbox/fs/upload.ts (1)

67-68: Nice improvement: upload now streams archive content.

This avoids loading whole archives into memory and aligns well with the perf objective.

packages/cli/src/cmd/cloud/sandbox/delete.ts (1)

60-67: Cache invalidation is correct; this concern can be closed.

The clearSandboxRegionCache function properly invalidates all cached data. Both cacheSandboxTarget (writing via setResourceInfo) and clearSandboxRegionCache (deleting via deleteResourceRegion) operate on the same row identified by (resource_type, profile, id). The DELETE statement removes the entire row from the cache table, including all fields (region, org_id, project_id), not just the region. No stale cache entries will remain after deletion.

packages/cli/src/cmd/cloud/sandbox/fs/download.ts (1)

55-76: LGTM! Good refactor to streaming architecture.

The switch from in-memory chunk collection to direct disk streaming via pipeline(Readable.fromWeb(...), createWriteStream(...)) reduces memory pressure for large archives. The use of resolveSandboxTarget correctly implements cache-first sandbox resolution.

packages/core/src/services/sandbox/getStatus.ts (1)

16-52: LGTM! Clean extension of status API with wait parameters.

The waitForStatus and waitMs parameters enable server-side waiting, which aligns with the PR's goal of reducing tail latency by pushing polling to the server. The waitMs != null check correctly handles both undefined and null cases.

packages/cli/src/cmd/cloud/sandbox/exec.ts (1)

225-260: LGTM! Clever optimization with stream racing.

The race between executionWaitPromise and stream completion, with the fast poll fallback when streams EOF with 0 bytes, reduces latency for quick-completing commands. The void executionWaitPromise.catch(() => undefined) correctly suppresses unhandled rejection warnings when aborting.

packages/core/src/services/sandbox/get.ts (1)

192-234: LGTM! Consistent with getStatus.ts wait parameter handling.

The waitForStatus and waitMs parameters mirror the implementation in getStatus.ts, maintaining API consistency across sandbox status and get endpoints.

packages/core/src/services/sandbox/run.ts (2)

183-217: LGTM! Solid refactor for parallel execution and stream handling.

The new approach of waiting for execution completion in parallel with stream consumption (when executionId is available) eliminates unnecessary sequential latency. The fallback to stream-first completion for missing executionId maintains backward compatibility.


319-353: LGTM! Clean long-polling implementation.

The waitForExecutionCompletion function correctly implements long-polling with proper abort signal checking before each iteration and terminal status detection.

packages/cli/src/cmd/cloud/sandbox/util.ts (1)

100-107: LGTM! Clean cache helper.

The cacheSandboxTarget function provides a simple wrapper for persisting both region and orgId, complementing the existing cacheSandboxRegion function.

packages/cli/src/cmd/cloud/sandbox/fs/cp.ts (3)

394-407: LGTM! Good use of temp directory with proper cleanup.

The archive-based upload approach using mkdtempSync with cleanup in finally is correct and handles errors gracefully. Using tar.gz archives is more efficient than per-file uploads for directories.


514-537: LGTM! Streaming archive extraction for directory downloads.

The download-and-extract approach using temp files with proper cleanup is efficient. The tar.extract with preservePaths: false and strict: true provides safe extraction behavior.


486-501: LGTM! Efficient single-file streaming download.

Using pipeline with Readable.fromWeb() to stream directly to disk avoids buffering the entire file in memory. The Bun.file(targetPath).size is a clean way to get the final byte count.

Comment on lines +24 to +46
export async function resolveSandboxTarget(
logger: Logger,
auth: AuthData,
apiClient: APIClient,
sandboxId: string,
profileName = 'production',
config?: Config | null
): Promise<ResolvedSandboxTarget> {
const cachedInfo = await getResourceInfo('sandbox', profileName, sandboxId);
if (cachedInfo?.region && cachedInfo?.orgId) {
logger.trace(
`[sandbox] Found cached target for ${sandboxId}: ${cachedInfo.region}/${cachedInfo.orgId}`
);
return { region: cachedInfo.region, orgId: cachedInfo.orgId };
}

logger.trace(`[sandbox] Cache miss for target ${sandboxId}, resolving via CLI API`);
const globalClient =
apiClient ?? (await getGlobalCatalystAPIClient(logger, auth, profileName, undefined, config));
const sandbox = await sandboxResolve(globalClient, sandboxId);
await setResourceInfo('sandbox', profileName, sandboxId, sandbox.region, sandbox.orgId);
return { region: sandbox.region, orgId: sandbox.orgId };
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Unreachable fallback for apiClient parameter.

The apiClient parameter is typed as APIClient (required), but line 41-42 has fallback code using ?? that will never execute since apiClient cannot be null or undefined based on the type signature.

Either make the parameter optional (apiClient?: APIClient | null) to match the intended behavior, or remove the fallback:

🔧 Proposed fix: make apiClient optional
 export async function resolveSandboxTarget(
 	logger: Logger,
 	auth: AuthData,
-	apiClient: APIClient,
+	apiClient: APIClient | null,
 	sandboxId: string,
 	profileName = 'production',
 	config?: Config | null
 ): Promise<ResolvedSandboxTarget> {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/cloud/sandbox/util.ts` around lines 24 - 46, The
apiClient fallback is unreachable because resolveSandboxTarget's parameter
apiClient is typed as required; update the function signature in
resolveSandboxTarget to make apiClient optional (e.g., apiClient?: APIClient |
null) so the nullish-coalescing fallback to getGlobalCatalystAPIClient can run,
and ensure any call sites that pass undefined/null are adjusted or accept the
optional parameter; no other logic changes needed (keep sandboxResolve,
getGlobalCatalystAPIClient, and setResourceInfo usage as-is).

jhaynie added 2 commits April 28, 2026 11:17
# Conflicts:
#	packages/cli/src/cmd/cloud/sandbox/exec.ts
#	packages/cli/src/cmd/cloud/sandbox/run.ts
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

📦 Canary Packages Published

version: 2.0.9-1ae3d87

Packages
Package Version URL
@agentuity/schedule 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schedule-2.0.9-1ae3d87.tgz
@agentuity/runtime 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-runtime-2.0.9-1ae3d87.tgz
@agentuity/react 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-react-2.0.9-1ae3d87.tgz
@agentuity/keyvalue 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-keyvalue-2.0.9-1ae3d87.tgz
@agentuity/postgres 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-postgres-2.0.9-1ae3d87.tgz
@agentuity/email 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-email-2.0.9-1ae3d87.tgz
@agentuity/sandbox 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-sandbox-2.0.9-1ae3d87.tgz
@agentuity/workbench 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-workbench-2.0.9-1ae3d87.tgz
@agentuity/server 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-server-2.0.9-1ae3d87.tgz
@agentuity/webhook 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-webhook-2.0.9-1ae3d87.tgz
@agentuity/opencode 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-opencode-2.0.9-1ae3d87.tgz
@agentuity/frontend 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-frontend-2.0.9-1ae3d87.tgz
@agentuity/schema 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schema-2.0.9-1ae3d87.tgz
@agentuity/drizzle 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-drizzle-2.0.9-1ae3d87.tgz
@agentuity/queue 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-queue-2.0.9-1ae3d87.tgz
@agentuity/auth 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-auth-2.0.9-1ae3d87.tgz
@agentuity/db 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-db-2.0.9-1ae3d87.tgz
@agentuity/coder 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-2.0.9-1ae3d87.tgz
@agentuity/migrate 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-migrate-2.0.9-1ae3d87.tgz
@agentuity/cli 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-cli-2.0.9-1ae3d87.tgz
@agentuity/vector 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-vector-2.0.9-1ae3d87.tgz
@agentuity/core 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-core-2.0.9-1ae3d87.tgz
@agentuity/task 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-task-2.0.9-1ae3d87.tgz
@agentuity/evals 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-evals-2.0.9-1ae3d87.tgz
@agentuity/claude-code 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-claude-code-2.0.9-1ae3d87.tgz
@agentuity/coder-tui 2.0.9-1ae3d87 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-tui-2.0.9-1ae3d87.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schedule-2.0.9-1ae3d87.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-runtime-2.0.9-1ae3d87.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-react-2.0.9-1ae3d87.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-keyvalue-2.0.9-1ae3d87.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-postgres-2.0.9-1ae3d87.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-email-2.0.9-1ae3d87.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-sandbox-2.0.9-1ae3d87.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-workbench-2.0.9-1ae3d87.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-server-2.0.9-1ae3d87.tgz",
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-webhook-2.0.9-1ae3d87.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-opencode-2.0.9-1ae3d87.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-frontend-2.0.9-1ae3d87.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schema-2.0.9-1ae3d87.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-drizzle-2.0.9-1ae3d87.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-queue-2.0.9-1ae3d87.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-auth-2.0.9-1ae3d87.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-db-2.0.9-1ae3d87.tgz",
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-2.0.9-1ae3d87.tgz",
    "@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-migrate-2.0.9-1ae3d87.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-cli-2.0.9-1ae3d87.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-vector-2.0.9-1ae3d87.tgz",
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-core-2.0.9-1ae3d87.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-task-2.0.9-1ae3d87.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-evals-2.0.9-1ae3d87.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-claude-code-2.0.9-1ae3d87.tgz",
    "@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-tui-2.0.9-1ae3d87.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schedule-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-runtime-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-react-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-keyvalue-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-postgres-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-email-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-sandbox-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-workbench-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-server-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-webhook-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-opencode-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-frontend-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-schema-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-drizzle-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-queue-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-auth-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-db-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-migrate-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-cli-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-vector-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-core-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-task-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-evals-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-claude-code-2.0.9-1ae3d87.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-1ae3d87/agentuity-coder-tui-2.0.9-1ae3d87.tgz

@jhaynie jhaynie merged commit e7b19ff into main Apr 28, 2026
29 of 32 checks passed
@jhaynie jhaynie deleted the fix/job-logs-v2-stream branch April 28, 2026 18:36
Huijiro added a commit that referenced this pull request Apr 28, 2026
Brings in 10 commits from main on top of the v3 branch:
  - More perf improvements (#1416)
  - Relax stream namespace timestamp fields (#1406)
  - feat: add per-sandbox paused timeout support (#1392)
  - fix(ci): handle successful docs sync transport errors (#1415)
  - Update stale docs (#1404)
  - feat(docs): add Pagefind keyword search (#1412)
  - fix(ci): run release-next tests with test env (#1414)
  - Add coder Hub rpc_ready protocol event (#1413)
  - fix(docs): improve Ask AI query handling (#1411)
  - Move default template from agent pattern to route-only (#1386)

Conflict resolutions:

  Modify/delete (deleted on v3, kept deleted — main's edits dropped):
    - packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
    - packages/runtime/src/middleware.ts
    - packages/runtime/src/services/sandbox/http.ts
    - templates/_base/src/api/index.ts
    - templates/default/package.overlay.json
    - templates/default/src/api/index.ts
    - templates/default/src/web/App.tsx

  File location (apps/docs -> docs rename from v3):
    - docs/src/web/lib/pagefind-search.ts (placed at v3 path)

  Content:
    - .github/workflows/release-next.yaml — deduped the NODE_ENV env block
      on the Unit tests step (both sides added it; kept main's placement
      before run:); kept v3's trailing newline.
    - docs/src/api/streaming/route.ts — kept v3's defensive runtime type
      narrowing for body.model (added by CodeRabbit feedback) but adopted
      main's default model name 'gpt-5.4-mini' to match the rest of the
      docs demo apps.
    - bun.lock — regenerated from the merged package manifests.
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