Skip to content

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

Merged
sweetmantech merged 3 commits intotestfrom
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 intotestfrom
sweetmantech/myc-4139-api-post-apisandboxes-commands-optional-to-simply-create-a

Conversation

@sweetmantech
Copy link
Contributor

@sweetmantech sweetmantech commented Feb 4, 2026

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 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Feb 4, 2026

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

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Feb 4, 2026 4:06pm

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Catalog_availability 43% (+17pp) 2 🟢 1 🔴
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 44.38s (-1.88s) 3 🟢 2 🔴

Catalog Songs Count Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Llm_calls 4 (+0) - -
Tool_calls 0 (+0) - -
Errors 3 (+0) - -
Llm_errors 1 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 17.79s (+3.25s) 1 🟢 2 🔴

First Week Album Sales Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Llm_calls 1 (+0) - -
Tool_calls 0 (+0) - -
Errors 1 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 15.87s (-2.81s) 3 🟢 1 🔴

Memory & Storage Tools Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 21.64s (-4.21s) 1 🟢 -

Monthly Listeners Tracking Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Llm_calls 2 (+0) - -
Tool_calls 0 (+0) - -
Errors 2 (+0) - -
Llm_errors 1 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 15.32s (-0.33s) 3 🟢 2 🔴

Search Web Tool Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 2 (+0) - -
Llm_errors 1 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 28.64s (-0.84s) 6 🟢 5 🔴

Social Scraping Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 26.74s (+2.99s) 4 🟢 2 🔴

Spotify Followers Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 3 (+0) - -
Llm_errors 2 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 19.52s (+3.07s) 2 🟢 3 🔴

Spotify Tools Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 39.89s (+3.38s) 1 🟢 1 🔴

TikTok Analytics Questions Evaluation (HEAD-1770221131)

Score Average Improvements Regressions
Question_answered 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 21.79s (+2.32s) - 2 🔴

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

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 name Status Explanation
Solid & Clean Code ✅ Passed Pull 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.

sweetmantech and 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 <[email protected]>
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 <[email protected]>
@sweetmantech sweetmantech merged commit b409070 into test Feb 4, 2026
4 checks passed
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