Remove sandbox_files / setup.sh feature#339
Conversation
setup.sh caused every E2B sandbox provision to timeout (pip install litellm[proxy] exceeded the 120s budget). Skills cover any legitimate "seed files into harness" need. - Drop sandbox_files column (Prisma migration + schema) - Remove readEnvMap() and setup.sh execution from e2b.ts - Remove sandbox_files from all zod schemas, API interfaces, and mappers - Remove rawFiles extraction from all session create / rehydrate paths - Remove setup.sh editor UI from agent detail page SandboxFileSpec type and envMap return value unchanged — still used by skills and the provider interface. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
@greptile review |
Greptile SummaryThis PR removes the
Confidence Score: 5/5Safe to merge — a straightforward removal with no functional regressions; the feature being deleted was actively causing timeouts. The removal is consistent across all fourteen changed files: the DB migration, every bring-up code path, all type definitions, and the UI. The migration uses IF EXISTS, is documented, and the SandboxFileSpec type is intentionally preserved for skill use. No dangling references or partial rollouts were found. No files require special attention.
|
| Filename | Overview |
|---|---|
| prisma/migrations/20260526000000_remove_sandbox_files/migration.sql | Drops sandbox_files column with IF EXISTS guard and inline comments explaining the reason — satisfies the repo's documented-deletion rule. |
| src/server/sandbox/e2b.ts | Removes readEnvMap() and the setup.sh execution block; envMap is now returned as {} which is correct since setup.sh was the only mechanism to populate it. |
| src/app/api/v1/managed_agents/agents/[agent_id]/session/route.ts | Removes sandbox_files extraction from all three bring-up paths (cold, warm, inline POST) and from finishBringUp's signature; skillFiles is now passed directly where allFiles was. |
| src/server/types.ts | Removes sandbox_files from CreateAgentBody, UpdateAgentBody, ApiAgent, and toApiAgent; SandboxFileSpec type intentionally preserved for skill use. |
| src/lib/api.ts | Removes sandbox_files from AgentRow, CreateAgentRequest, and UpdateAgentRequest client types; SandboxFileSpec export kept for skill callers. |
| src/server/rehydrate.ts | Removes rawFiles extraction and SandboxFileSpec import; both harnessCreateSession calls no longer pass files, consistent with other rehydration paths. |
| src/app/agents/[id]/page.tsx | Removes all setup script state, handlers (currentSetupScript, openSetupScriptEditor, handleSetupScriptSave), and the UI section; no remaining references to sandbox_files. |
Reviews (3): Last reviewed commit: "fix: address greptile review feedback (g..." | Re-trigger Greptile
Greptile SummaryThis PR removes the
Confidence Score: 4/5Safe to merge — the column removal and all primary code paths are handled correctly; the leftover The cleanup is thorough across 13 of 14 changed files. The one missed spot — reading
|
| Filename | Overview |
|---|---|
| prisma/migrations/20260526000000_remove_sandbox_files/migration.sql | Drops sandbox_files column with IF EXISTS guard and an explanatory comment satisfying the column-deletion documentation rule. |
| prisma/schema.prisma | Removes sandbox_files Json field from the Agent model in sync with the migration. |
| src/app/api/v1/managed_agents/agents/[agent_id]/session/route.ts | Three bring-up paths cleaned up correctly, but the inline-harness create-session code (lines 697–732) still reads agent.sandbox_files and spreads a now-always-empty sandboxFiles array — a missed removal. |
| src/app/agents/new/page.tsx | Removes sandbox_files from the create payload but leaves the SandboxFileSpec import and LocalProject.files field as dead code. |
| src/server/sandbox/e2b.ts | Removes readEnvMap helper and the setup.sh execution block; envMap: {} is now the always-correct return value since the feature is gone. |
| src/server/types.ts | Removes sandbox_files from CreateAgentBody, UpdateAgentBody, and ApiAgent; SandboxFileSpec type itself is retained as it is still used by skills. |
| src/lib/api.ts | Removes sandbox_files from AgentRow, CreateAgentRequest, and UpdateAgentRequest client interfaces cleanly. |
| src/server/rehydrate.ts | Removes rawFiles/files extraction and all downstream usages from both the inline and pod-based rehydrate paths; unused SandboxFileSpec import also dropped. |
| src/server/reconcile.ts | Removes sandbox_files read and files pass-through from the stuck-session recovery path. |
| src/app/agents/[id]/page.tsx | Removes all setup-script state, editor UI, save handler, and decode helper — clean deletion with no leftover references. |
| src/app/api/v1/managed_agents/agents/route.ts | Removes the conditional sandbox_files Prisma persist block and its explanatory cast comment from the agent create route. |
| src/app/api/v1/managed_agents/agents/[agent_id]/route.ts | Removes the sandbox_files conditional update from the agent PATCH route. |
| src/app/api/v1/managed_agents/sessions/[session_id]/opencode/[...path]/route.ts | Removes rawFiles extraction, SandboxFileSpec import, and files pass-through from the inline recovery path. |
| src/app/api/v1/managed_agents/sessions/[session_id]/restart/route.ts | Removes rawFiles and files from the restart create-session call. |
Comments Outside Diff (4)
-
src/app/api/v1/managed_agents/agents/[agent_id]/session/route.ts, line 697-699 (link)Incomplete removal — the inline-harness create-session path still reads
agent.sandbox_filesand splices the result intoharnessCreateSession. Every other bring-up path had its equivalent block removed in this PR, but this one was missed. After the migration the column no longer exists in the DB, sorawFilesis alwaysundefinedandsandboxFilesis always[], making the spread harmless but entirely dead. -
src/app/api/v1/managed_agents/agents/[agent_id]/session/route.ts, line 732 (link)Follow-up to the dead
sandboxFilesvariable: this spread should become justinlineSkillFilesonce the stale variable is removed. -
src/app/agents/new/page.tsx, line 23-34 (link)The
filesfield onLocalProjectand theSandboxFileSpecimport are now dead code.sandbox_filesis no longer passed in the create payload, soselectedProject?.filesis never consumed. TheSandboxFileSpectype in@/lib/apiis still valid (used by skills), but this local interface field and the import that exists solely to type it can be removed. -
src/app/agents/new/page.tsx, line 40-49 (link)With
SandboxFileSpecremoved from the import, this field inLocalProjectis no longer typed and can be dropped as well.
Reviews (1): Last reviewed commit: "feat: remove sandbox_files / setup.sh fe..." | Re-trigger Greptile
- Remove leftover rawFiles/sandboxFiles read from inline-harness create path in session/route.ts (lines 697-699) — last missed site - Fix inline files pass: spread sandboxFiles+inlineSkillFiles → just inlineSkillFiles (sandboxFiles was always empty after migration) - Rename allFiles → skillFiles in finishBringUp for accuracy - Remove dead SandboxFileSpec import and LocalProject.files field from new/page.tsx Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
@greptile review |
Summary
setup.shcaused every E2B sandbox provision to timeout —pip install litellm[proxy]exceeded the 120s budget. Skills cover any legitimate "seed files into harness" need.sandbox_filesDB column, all schema/API surface, the setup.sh execution block ine2b.ts, and the setup.sh editor UI from the agent detail page.SandboxFileSpectype andenvMapreturn value unchanged — still used by skills and the provider interface.Changes
prisma/schema.prisma+ migrationsandbox_filescolumnsrc/server/sandbox/e2b.tsreadEnvMap()and setup.sh executionsrc/server/types.tsCreateAgentBody,UpdateAgentBody,ApiAgent,toApiAgentsrc/lib/api.tsApiAgent,CreateAgentRequest,UpdateAgentRequestsrc/app/api/v1/.../session/route.tsrawSandboxFilesblocks fromcoldBringUp/warmBringUp/finishBringUpsrc/server/rehydrate.tsrawFilesextraction; drop unusedSandboxFileSpecimportrestart/route.ts,opencode/route.ts,reconcile.tsrawFilesremovalsrc/app/agents/[id]/page.tsxsrc/app/agents/new/page.tsxsandbox_files: selectedProject?.filesfrom create payloadagents/route.ts,agents/[agent_id]/route.tsTest plan
npx tsc --noEmitpasses (zero errors)sandbox_filesfield in payload🤖 Generated with Claude Code