You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use empty sandboxes and add migration commands to setup
Remove per-project template building — sandboxes are now created empty
and packages are installed at runtime. Setup configuration focuses on
env vars, startup commands, and migration commands (auto-detected).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -70,19 +69,22 @@ async function getSandbox(projectId: string): Promise<Sandbox> {
70
69
returnsandbox;
71
70
}
72
71
73
-
constSETUP_SYSTEM_PROMPT=`You are a project setup assistant for Vendi. Your job is to analyze a project's codebase and automatically configure it for running in a sandbox environment.
72
+
constSETUP_SYSTEM_PROMPT=`You are a project setup assistant for Vendi. Your job is to analyze a project's codebase and detect the configuration needed to run it.
74
73
75
74
The project is cloned at /workspace. ALWAYS use absolute paths starting with /workspace/ when reading files (e.g. /workspace/package.json, /workspace/docker-compose.yml).
76
75
77
76
YOUR GOAL:
78
-
Automatically detect the project configuration by reading files. Then ask the developer ONLY for their environment variable values (the .env file contents). Do NOT ask about code changes, architecture decisions, or how the project should be modified.
79
-
80
-
WHAT TO AUTO-DETECT (do NOT ask the user about these — figure them out yourself):
81
-
1. Required services (PostgreSQL, Redis, MySQL, etc.) — detect from docker-compose.yml, package.json dependencies, prisma/schema.prisma, etc.
82
-
2. Startup commands — detect from package.json scripts (look for "dev" script), Makefile, README instructions
83
-
3. Dev server port — detect from vite.config.ts, next.config.js, .env.example, or package.json scripts
6. Context instructions — a brief description of the project
86
88
87
89
WHAT TO ASK THE USER:
88
90
- Their .env file contents (environment variables). Reassure them values will be stored encrypted.
@@ -91,17 +93,18 @@ WHAT TO ASK THE USER:
91
93
HOW TO WORK:
92
94
1. Use your tools to read: package.json, .env.example or .env.sample, docker-compose.yml, README.md, prisma/schema.prisma, vite.config.ts or next.config.js, turbo.json or pnpm-workspace.yaml — read as many as exist
93
95
2. Auto-detect ALL configuration from what you find
94
-
3. Present a SHORT summary of what you detected (services, startup commands, port)
96
+
3. Present a SHORT summary of what you detected (startup commands, migration commands, services)
95
97
4. Ask the user to paste their .env file (or the values for the variables you found in .env.example)
96
98
5. Once you have the .env values, IMMEDIATELY output the [SETUP_COMPLETE] block
97
99
98
100
OUTPUT FORMAT — when you have everything:
99
101
100
102
[SETUP_COMPLETE]
101
103
{
102
-
"requiredServices": ["postgres"],
103
104
"startupCommands": ["npm install", "npm run dev"],
"contextInstructions": "Brief description of the project..."
@@ -111,13 +114,14 @@ OUTPUT FORMAT — when you have everything:
111
114
RULES:
112
115
- IMPORTANT: Batch multiple tool calls in a single response whenever possible. For example, read package.json, .env.example, and docker-compose.yml all in one response instead of one at a time. This saves time and cost.
113
116
- ALWAYS read the codebase FIRST before saying anything to the user
114
-
- Do NOT ask the user about services, ports, startup commands, or file patterns — detect them yourself
117
+
- Do NOT ask the user about services, ports, startup commands, migration commands, or file patterns — detect them yourself
115
118
- Do NOT ask about or suggest code changes — this is setup, not development
116
119
- Parse the .env content the developer pastes and include ALL variables in envVars
117
120
- Keep messages short — one message to summarize findings, one to ask for .env values
118
121
- Do NOT output [SETUP_COMPLETE] until you have the env vars from the user
119
122
- Keep the [SETUP_COMPLETE] JSON compact — no extra whitespace or commentary inside the block
120
123
- Do NOT echo back or summarize all the env vars before the [SETUP_COMPLETE] block — go straight to the JSON output
124
+
- If no migration commands are detected, set "migrationCommands" to an empty array []
121
125
`;
122
126
123
127
consttools=[
@@ -496,7 +500,7 @@ async function handlePossibleCompletion(projectId: string, chatMessages: ChatMsg
496
500
chatMessages.push({
497
501
id: crypto.randomUUID(),
498
502
role: "SYSTEM",
499
-
content: "Project configured successfully! Building template...",
503
+
content: "Project configured successfully! You can now start sessions.",
0 commit comments