feat(plan): create per-project sandboxes for multi-project plans #7270

Closed
opened 2026-04-10 14:20:44 +00:00 by hamza.khyari · 3 comments
Member

Summary

When a plan is linked to multiple projects (each with its own git-checkout resource), _create_sandbox_for_plan only creates a worktree for the first project's resource. The LLM sees files from all projects via context hydration, but can only write output to one sandbox. Changes for the second project are lost.

Metadata

  • Commit Message: feat(plan): create per-project sandboxes for multi-project plans
  • Branch: feature/multi-project-sandbox

Current Behavior

  1. Plan linked to project A and project B
  2. _create_sandbox_for_plan finds project A's git resource first, creates worktree, returns
  3. Project B's resource is never used for sandbox creation
  4. LLM generates fixes for both projects but only project A's files land on disk
  5. Apply merges only project A's changes

Expected Behavior

  1. Create a separate worktree sandbox for each project's git-checkout resource
  2. LLM output is routed to the correct sandbox based on file paths
  3. Apply merges each worktree into its respective project repo
  4. Apply Summary shows changes per project

Subtasks

  • Modify _create_sandbox_for_plan to return a list of (sandbox_root, sandbox_obj, project_name) tuples
  • Route LLM file output to the correct sandbox based on project file paths
  • Modify _apply_sandbox_changes to merge each sandbox into its respective repo
  • Show per-project Apply Summary panels

Definition of Done

  • Multi-project plan creates sandboxes for all linked git-checkout resources
  • LLM changes for each project land in the correct sandbox
  • Apply merges all sandboxes, showing per-project summaries
  • Scenario-7 end-to-end test passes with both projects modified

Spec Reference

specification.md §19312 (Apply commits each sandbox separately)

## Summary When a plan is linked to multiple projects (each with its own git-checkout resource), `_create_sandbox_for_plan` only creates a worktree for the **first** project's resource. The LLM sees files from all projects via context hydration, but can only write output to one sandbox. Changes for the second project are lost. ## Metadata - **Commit Message**: `feat(plan): create per-project sandboxes for multi-project plans` - **Branch**: `feature/multi-project-sandbox` ## Current Behavior 1. Plan linked to project A and project B 2. `_create_sandbox_for_plan` finds project A's git resource first, creates worktree, returns 3. Project B's resource is never used for sandbox creation 4. LLM generates fixes for both projects but only project A's files land on disk 5. Apply merges only project A's changes ## Expected Behavior 1. Create a separate worktree sandbox for each project's git-checkout resource 2. LLM output is routed to the correct sandbox based on file paths 3. Apply merges each worktree into its respective project repo 4. Apply Summary shows changes per project ## Subtasks - [ ] Modify `_create_sandbox_for_plan` to return a list of (sandbox_root, sandbox_obj, project_name) tuples - [ ] Route LLM file output to the correct sandbox based on project file paths - [ ] Modify `_apply_sandbox_changes` to merge each sandbox into its respective repo - [ ] Show per-project Apply Summary panels ## Definition of Done - Multi-project plan creates sandboxes for all linked git-checkout resources - LLM changes for each project land in the correct sandbox - Apply merges all sandboxes, showing per-project summaries - Scenario-7 end-to-end test passes with both projects modified ## Spec Reference `specification.md` §19312 (Apply commits each sandbox separately)
hamza.khyari added this to the v3.5.0 milestone 2026-04-10 14:20:44 +00:00
Owner

Verified — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Owner

Verified — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Owner

Verified — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Feature: per-project sandboxes for multi-project plans. MoSCoW: Should-have. Priority: Medium. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#7270
No description provided.