Skip to content

feat: add per-sandbox paused timeout support#1392

Open
jhaynie wants to merge 4 commits intomainfrom
feat/sandbox-paused-timeout
Open

feat: add per-sandbox paused timeout support#1392
jhaynie wants to merge 4 commits intomainfrom
feat/sandbox-paused-timeout

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented Apr 17, 2026

Summary

  • Add paused field to sandbox timeout configuration across create, get, list, and types schemas
  • Update sandboxPause() to return SandboxPauseResult with terminatesAt ISO timestamp
  • Add --paused-timeout CLI flag to cloud sandbox create
  • Display auto-terminate info in CLI cloud sandbox pause output

Details

When a sandbox is created with a paused timeout (e.g., --paused-timeout 24h), pausing it will return a terminatesAt timestamp indicating when it will be automatically terminated if not resumed. The CLI displays this as a user-friendly message.

Files changed (10):

  • packages/core/src/services/sandbox/types.ts — Added paused to SandboxTimeoutConfigSchema and SandboxInfoSchema; updated SandboxService.pause() return type
  • packages/core/src/services/sandbox/pause.ts — New SandboxPauseResult type; response schema captures terminatesAt
  • packages/core/src/services/sandbox/create.ts — Added paused to request timeout schema
  • packages/core/src/services/sandbox/get.ts — Added paused to response timeout schema
  • packages/core/src/services/sandbox/list.ts — Added paused to response timeout schema
  • packages/core/src/services/sandbox/client.ts — Updated SandboxInstance.pause() and SandboxClient.pause() return types
  • packages/core/src/services/sandbox/index.ts — Export SandboxPauseResult
  • packages/runtime/src/services/sandbox/http.ts — Updated HTTPSandboxService.pause() return type
  • packages/cli/src/cmd/cloud/sandbox/create.ts — Added --paused-timeout flag
  • packages/cli/src/cmd/cloud/sandbox/pause.ts — Display terminatesAt info; include in JSON output

Companion PR: https://github.com/agentuity/app/pull/1316

Summary by CodeRabbit

  • New Features
    • Added a pausedTimeout option when creating sandboxes to control how long a sandbox may remain paused before auto-termination.
    • Pausing a sandbox now returns auto-termination info (when applicable) and the CLI shows a human-readable auto-terminate timestamp in non-JSON mode.
    • Sandbox info/list responses now include the paused timeout value.

Add paused timeout configuration to sandbox create, get, list, and pause
flows. When a sandbox is paused with a configured paused timeout, the
pause response includes a terminatesAt timestamp showing when it will
auto-terminate if not resumed.

Changes:
- Add paused field to timeout schemas (create, get, list, types)
- Update sandboxPause to return SandboxPauseResult with terminatesAt
- Add --paused-timeout CLI flag for sandbox create
- Display auto-terminate info in CLI pause output
@agentuity-agent
Copy link
Copy Markdown

agentuity-agent bot commented Apr 17, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🔴 Failed (deploy_d170a0353165b19d3bdbbe069e9b1f61) - 2026-04-17T04:11:53Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0f2892da-563c-491c-a07e-dd464aaabf10

📥 Commits

Reviewing files that changed from the base of the PR and between 8b06657 and b4bce9d.

📒 Files selected for processing (3)
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/core/src/services/sandbox/list.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/core/src/services/sandbox/create.ts
📜 Recent 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). (15)
  • GitHub Check: Windows WSL CLI Smoke Test
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Framework Integration Tests (TanStack & Next.js)
  • GitHub Check: Standalone Agent Test
  • GitHub Check: Package Installation & Usage Test
  • GitHub Check: Queue CLI Tests
  • GitHub Check: Queue SDK Tests
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Sandbox CLI Tests
  • GitHub Check: Template Integration Tests
  • GitHub Check: Storage CLI Tests
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Build
  • GitHub Check: Pack & Upload
🧰 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/list.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.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/list.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.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/list.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/pause.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/list.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.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/pause.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/pause.ts
🔇 Additional comments (5)
packages/cli/src/cmd/cloud/sandbox/pause.ts (3)

12-17: Schema update is clean and correctly optional.

terminatesAt is modeled as optional and documented clearly, which matches the upstream pause result contract.


51-54: Good propagation of paused-timeout data through handler output.

Capturing the sandboxPause(...) result and returning terminatesAt in the command response keeps JSON output aligned with the new API behavior.

Also applies to: 75-75


59-68: Nice defensive handling for malformed timestamps.

The Line 61 validity check before formatting avoids surfacing Invalid Date in TUI output and provides a safe fallback message.

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

115-118: timeout.paused schema addition looks correct.

Good update on Line 115-Line 118: the field remains optional and the '0s' wording is clear and aligned with the paused-timeout behavior.


232-232: Mapper now correctly returns timeout data.

Including timeout: s.timeout on Line 232 ensures list consumers can access timeout.paused from sandboxList(...).


📝 Walkthrough

Walkthrough

Adds paused-timeout support to sandbox APIs and CLI, and changes sandbox pause to return a structured result that may include an auto-termination timestamp (terminatesAt) instead of returning void.

Changes

Cohort / File(s) Summary
Pause API & Call Sites
packages/core/src/services/sandbox/pause.ts, packages/core/src/services/sandbox/client.ts, packages/runtime/src/services/sandbox/http.ts
Changed pause API to return SandboxPauseResult (includes sandboxId, status, optional checkpointId, optional terminatesAt) and updated callers/signatures to return that result instead of void. Response schema now a discriminated union parsing success/failure.
Timeout Schemas & Info
packages/core/src/services/sandbox/create.ts, packages/core/src/services/sandbox/get.ts, packages/core/src/services/sandbox/list.ts, packages/core/src/services/sandbox/types.ts
Added optional paused: string to sandbox timeout schemas (SandboxTimeoutConfigSchema, SandboxInfoSchema, related request/response shapes) to represent maximum paused duration (docs: formats like "24h" or "0"/"0s" for infinite).
Service Types & Exports
packages/core/src/services/sandbox/types.ts, packages/core/src/services/sandbox/index.ts
Updated SandboxService/SandboxSchema pause method signatures to Promise<SandboxPauseResult> and re-exported SandboxPauseResult from the pause module.
CLI: pause command
packages/cli/src/cmd/cloud/sandbox/pause.ts
Captured pause result from sandboxPause(...), extended response schema with optional terminatesAt, added TUI output that parses and displays localized auto-terminate time when present, and returns terminatesAt in the command response.
CLI: create command
packages/cli/src/cmd/cloud/sandbox/create.ts
Added new pausedTimeout CLI option and changed timeout construction to include a timeout object when either idleTimeout or pausedTimeout is provided, mapping to { idle: opts.idleTimeout, paused: opts.pausedTimeout }.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 17, 2026

📦 Canary Packages Published

version: 2.0.9-0e63f8b

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

Add to your package.json:

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

Or install directly:

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

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: 3

🤖 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/pause.ts`:
- Around line 59-64: The code constructs a Date from result.terminatesAt and
unconditionally prints terminateDate.toLocaleString(), which can show "Invalid
Date" for malformed input; update the block (the logic using
result.terminatesAt, terminateDate and the tui.info call in pause.ts) to
validate the timestamp before formatting: create terminateDate, check it's valid
(e.g., !isNaN(terminateDate.getTime()) or similar) and only call tui.info with
the formatted date when valid — otherwise either omit the message or show a safe
fallback (e.g., a generic "auto-terminate scheduled" message).

In `@packages/core/src/services/sandbox/create.ts`:
- Around line 52-57: The describe text for the paused timeout in the paused
schema is inconsistent with other timeouts; update the description on the paused
property (the z.string().optional().describe call for paused in create.ts) to
use "0s" for infinite instead of "0" so it matches the other timeout docs and
avoids CLI/API confusion.

In `@packages/core/src/services/sandbox/list.ts`:
- Around line 115-118: The sandboxList mapper currently parses timeout.paused in
the Zod schema but doesn't include it in the returned value from sandboxList;
update the mapper inside sandboxList (the mapping function that builds each
listed sandbox) to include a timeout object (or extend the existing timeout)
with paused set from the parsed source (e.g., map result.timeout?.paused into
the returned timeout.paused), ensuring the field remains optional and mirrors
the schema's type.
🪄 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: b4397b1f-c6a1-4028-9a67-20f680a89d88

📥 Commits

Reviewing files that changed from the base of the PR and between 55d882e and 8b06657.

📒 Files selected for processing (10)
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/core/src/services/sandbox/client.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/core/src/services/sandbox/get.ts
  • packages/core/src/services/sandbox/index.ts
  • packages/core/src/services/sandbox/list.ts
  • packages/core/src/services/sandbox/pause.ts
  • packages/core/src/services/sandbox/types.ts
  • packages/runtime/src/services/sandbox/http.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). (15)
  • GitHub Check: Framework Integration Tests (TanStack & Next.js)
  • GitHub Check: Queue SDK Tests
  • GitHub Check: Template Integration Tests
  • GitHub Check: Storage CLI Tests
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Queue CLI Tests
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Sandbox CLI Tests
  • GitHub Check: Package Installation & Usage Test
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Standalone Agent Test
  • GitHub Check: Pack & Upload
  • GitHub Check: Build
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Windows WSL CLI Smoke Test
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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/get.ts
  • packages/core/src/services/sandbox/list.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/core/src/services/sandbox/client.ts
  • packages/core/src/services/sandbox/index.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/runtime/src/services/sandbox/http.ts
  • packages/core/src/services/sandbox/pause.ts
  • packages/core/src/services/sandbox/types.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/get.ts
  • packages/core/src/services/sandbox/list.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/core/src/services/sandbox/client.ts
  • packages/core/src/services/sandbox/index.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/runtime/src/services/sandbox/http.ts
  • packages/core/src/services/sandbox/pause.ts
  • packages/core/src/services/sandbox/types.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/get.ts
  • packages/core/src/services/sandbox/list.ts
  • packages/core/src/services/sandbox/client.ts
  • packages/core/src/services/sandbox/index.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/core/src/services/sandbox/pause.ts
  • packages/core/src/services/sandbox/types.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/create.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
**/index.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use named exports from package index.ts files

Files:

  • packages/core/src/services/sandbox/index.ts
packages/runtime/**/*.{ts,tsx}

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

packages/runtime/**/*.{ts,tsx}: Every agent handler receives AgentContext with logger, tracer, storage (kv, vector, stream), and auth properties
Use ctx.logger instead of console.log for observability

Files:

  • packages/runtime/src/services/sandbox/http.ts
🧠 Learnings (4)
📚 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/get.ts
  • packages/core/src/services/sandbox/list.ts
  • packages/cli/src/cmd/cloud/sandbox/create.ts
  • packages/core/src/services/sandbox/client.ts
  • packages/core/src/services/sandbox/index.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
  • packages/core/src/services/sandbox/create.ts
  • packages/runtime/src/services/sandbox/http.ts
  • packages/core/src/services/sandbox/pause.ts
  • packages/core/src/services/sandbox/types.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/create.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.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/create.ts
  • packages/cli/src/cmd/cloud/sandbox/pause.ts
📚 Learning: 2025-12-13T14:15:18.261Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 168
File: packages/runtime/src/session.ts:536-546
Timestamp: 2025-12-13T14:15:18.261Z
Learning: The agentuity/runtime package is Bun-only; during code reviews, do not replace Bun-native APIs (e.g., Bun.CryptoHasher, Bun.serve, and other Bun namespace APIs) with Node.js alternatives. Review changes with the assumption that runtime runs on Bun, and ensure any edits preserve Bun compatibility and do not introduce Node.js-specific fallbacks. Apply this guidance broadly to files under packages/runtime (e.g., packages/runtime/src/...); if there are conditional environment checks, document why Bun is required and avoid dereferencing Bun-only APIs in non-Bun contexts.

Applied to files:

  • packages/runtime/src/services/sandbox/http.ts
🔇 Additional comments (9)
packages/core/src/services/sandbox/pause.ts (1)

5-18: Nice API contract upgrade for pause flow.

The discriminated response schema plus typed SandboxPauseResult return is clean and makes terminatesAt first-class for downstream callers.

Also applies to: 27-37, 47-71

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

167-170: timeout.paused addition looks good.

This is consistent with the expanded timeout model and keeps get-schema parity with paused-timeout support.

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

55-55: Good index surface update.

Re-exporting SandboxPauseResult keeps package exports in sync with the new pause API return type.

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

75-78: CLI paused-timeout plumbing is solid.

The new option and conditional timeout payload are correctly wired so paused timeout can be set independently of idle timeout.

Also applies to: 202-208

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

37-37: Pause return-type propagation is correctly implemented.

Both instance-level and client-level pause methods now consistently surface SandboxPauseResult.

Also applies to: 284-285, 402-404, 728-730

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

12-17: Good CLI surfacing of pause auto-terminate metadata.

terminatesAt is now included in both typed JSON output and command flow, which cleanly exposes the new backend behavior.

Also applies to: 51-54, 67-72

packages/runtime/src/services/sandbox/http.ts (1)

53-53: Pause result is correctly propagated through runtime service methods.

Good update: both pause call paths now return SandboxPauseResult, so downstream consumers can access fields like terminatesAt without extra lookups.

Also applies to: 269-272, 512-515

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

4-4: Pause API type contract is consistently updated.

SandboxPauseResult is imported and used in both SandboxSchema.pause and SandboxService.pause, keeping runtime and core interfaces aligned.

Also applies to: 410-411, 921-921


278-284: Paused timeout field is added consistently across timeout schemas.

Nice consistency: the new paused timeout is present in both config and returned sandbox info shapes.

Also applies to: 603-607

Comment thread packages/cli/src/cmd/cloud/sandbox/pause.ts
Comment thread packages/core/src/services/sandbox/create.ts
Comment thread packages/core/src/services/sandbox/list.ts
jhaynie and others added 3 commits April 16, 2026 21:46
…meout in list mapper

- Validate terminatesAt timestamp before formatting to avoid 'Invalid Date'
- Use '0s' consistently in paused timeout descriptions (was '0')
- Include timeout in sandboxList mapper so paused field is returned
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