Skip to content

feat: make command parameter optional for POST /api/sandboxes - #205

Merged
sweetmantech merged 3 commits into
testfrom
sweetmantech/myc-4139-api-post-apisandboxes-commands-optional-to-simply-create-a
Feb 4, 2026
Merged

feat: make command parameter optional for POST /api/sandboxes#205
sweetmantech merged 3 commits into
testfrom
sweetmantech/myc-4139-api-post-apisandboxes-commands-optional-to-simply-create-a

Conversation

@sweetmantech

@sweetmantechsweetmantech commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make the command parameter optional in POST /api/sandboxes
  • When command is omitted, sandbox is created without triggering the run-sandbox-command task
  • The runId field is only included in the response when a command was provided

Test plan

  • Call POST /api/sandboxes without command - verify sandbox is created, no runId returned
  • Call POST /api/sandboxes with command - verify sandbox is created with runId
  • Verify no regression in existing functionality

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Sandboxes can now be created without specifying a command.
  • Documentation

    • Updated API documentation to reflect that the command parameter is now optional when creating sandboxes; runId is included in responses only when a command is executed.

Allow creating a sandbox without providing a command, which skips
triggering the run-sandbox-command task. This enables users to simply
create a sandbox environment without executing any commands.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel

vercelBot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
recoup-apiReadyReadyPreviewFeb 4, 2026 4:06pm

@github-actions

github-actionsBot commented Feb 4, 2026

Copy link
Copy Markdown

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Catalog_availability43% (+17pp)2 🟢1 🔴
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration44.38s (-1.88s)3 🟢2 🔴

Catalog Songs Count Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Llm_calls4 (+0)--
Tool_calls0 (+0)--
Errors3 (+0)--
Llm_errors1 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration17.79s (+3.25s)1 🟢2 🔴

First Week Album Sales Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Llm_calls1 (+0)--
Tool_calls0 (+0)--
Errors1 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration15.87s (-2.81s)3 🟢1 🔴

Memory & Storage Tools Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration21.64s (-4.21s)1 🟢-

Monthly Listeners Tracking Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Llm_calls2 (+0)--
Tool_calls0 (+0)--
Errors2 (+0)--
Llm_errors1 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration15.32s (-0.33s)3 🟢2 🔴

Search Web Tool Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Llm_calls3 (+0)--
Tool_calls0 (+0)--
Errors2 (+0)--
Llm_errors1 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration28.64s (-0.84s)6 🟢5 🔴

Social Scraping Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration26.74s (+2.99s)4 🟢2 🔴

Spotify Followers Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Llm_calls3 (+0)--
Tool_calls0 (+0)--
Errors3 (+0)--
Llm_errors2 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration19.52s (+3.07s)2 🟢3 🔴

Spotify Tools Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration39.89s (+3.38s)1 🟢1 🔴

TikTok Analytics Questions Evaluation (HEAD-1770221131)

ScoreAverageImprovementsRegressions
Question_answered0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration21.79s (+2.32s)-2 🔴

@coderabbitai

coderabbitaiBot commented Feb 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • lib/sandbox/__tests__/validateSandboxBody.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**

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.

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

  • 🔍 Trigger a full review
📝 Walkthrough

Walkthrough

The pull request makes the command field optional when creating a sandbox. Previously required, it now allows sandbox creation without immediately executing a command. The task triggering logic is updated to only run when a command is provided.

Changes

Cohort / File(s)Summary
Sandbox Command Validation
lib/sandbox/validateSandboxBody.ts
Changed command field from required to optional in schema; retains non-empty constraint when provided.
Sandbox Creation Handler
lib/sandbox/createSandboxPostHandler.ts
Added conditional logic to trigger run-sandbox-command task only when command is present; adjusted error handling and response shaping accordingly.
API Route Documentation
app/api/sandboxes/route.ts
Updated POST endpoint documentation to reflect optional command field and conditional runId response property.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A sandbox born without a task,
No command needed, just ask,
Create the space, run when you're ready,
Optional flows, execution steady! 🏗️✨

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check nameStatusExplanation
Solid & Clean Code✅ PassedPull request demonstrates solid adherence to SOLID principles and clean code practices with well-structured implementation of optional command parameter.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4139-api-post-apisandboxes-commands-optional-to-simply-create-a

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

sweetmantechand others added 2 commits February 4, 2026 11:03
Update test to reflect that command is now optional - missing command
should return validated body, not an error.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add test case to verify that when command is not provided:
- Sandbox is created successfully
- triggerRunSandboxCommand is NOT called
- Response does not include runId
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sweetmantech
sweetmantech merged commit b409070 into testFeb 4, 2026
4 checks passed
Sign up for freeto 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

@sweetmantech