Skip to content

Conversation

@sweetmantech
Copy link
Collaborator

@sweetmantech sweetmantech commented Feb 6, 2026

Summary

  • Updates createSandbox to send command: "opencode" with args: ["run", prompt] instead of sending the raw prompt as command
  • Users type natural language prompts (e.g. "build a hello world app") and the Chat UI constructs the correct params for the API/task to execute opencode run "build a hello world app" in the sandbox

Test plan

  • Type a prompt in the /sandboxes textarea (e.g. "build a hello world app")
  • Verify the API receives { command: "opencode", args: ["run", "build a hello world app"] }
  • Verify the task executes opencode run "build a hello world app" in the sandbox

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Enhanced the sandbox creation mechanism to support structured command handling and improved flexibility.

The Chat UI now sends command: "opencode" with args: ["run", prompt]
so the task executes the user's prompt via opencode run in the sandbox.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
recoup-chat Ready Ready Preview Feb 6, 2026 2:42am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The createSandbox function API contract is updated to accept a prompt parameter instead of command, and the request payload structure is modified to send a structured command with arguments ({ command: "opencode", args: ["run", prompt] }) instead of a simple object.

Changes

Cohort / File(s) Summary
Function Signature & Request Payload Update
lib/sandboxes/createSandbox.ts
Parameter renamed from command to prompt and request body restructured to use a command-based approach with args array containing the run action and prompt value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🏖️ A prompt replaces the command's old way,
Structured args now pave the coding day,
Sandboxes run cleaner, with purpose aligned,
SOLID principles shine through the redesigned. ✨

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Solid & Clean Code ✅ Passed The createSandbox function change adheres to SOLID principles and clean code practices with single responsibility, clear naming, proper error handling, and focused implementation.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4162-chat-sandboxes-opencode-run-params

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.

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