[Feature] Isolated Database Environments for Worktree-Based Task Execution #254
Replies: 1 comment
-
|
+1 on this. Hit the same wall and want to share a more concrete shape for the Working on a Laravel + Sail app. The thing that makes this specifically painful in Kanban (vs. a single-agent tool) is parallelism: I want to run 3-5 agents at once, each on its own task. They all share one Postgres. The moment one of them runs a migration on its branch, every other parallel agent's run is contaminated, and so is my own dev DB on The pattern I want to land on is one schema/database per worktree, named after the worktree, e.g. What would unblock this is one optional field in {
"shortcuts": [...],
"setupScript": "vendor/bin/sail up -d && WS=$(basename $KANBAN_WORKTREE_PATH) && vendor/bin/sail psql -U postgres -c \"CREATE DATABASE \\\"testing_${WS}\\\";\" 2>/dev/null; DB_DATABASE=testing_${WS} vendor/bin/sail artisan migrate --force"
}A shell snippet, Just v1: no I know Also opened a separate, narrower Feature Request discussion just for the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Git worktrees solve code isolation per task, but not database or service isolation. When an agent completes work in a worktree, there's no reliable way to verify it actually runs — because:
This defeats the purpose of agent-driven automation.
Proposed Solution
Use database schema isolation (e.g. Postgres schemas, or the equivalent for a given stack) as part of the worktree lifecycle:
publicschema (structure + data) into a new schema named after the branchExternal service references (S3 links, vendor IDs, etc.) all still work because the data is identical — just namespaced differently.
Feature Request
Add built-in lifecycle hooks to the orchestrator:
pre-task: clone schema, configure env vars, allocate a free portpost-task: drop schema, tear down worktreeThis would make every agent-completed task actually testable in a fully isolated environment — not just "code was written to a branch."
Beta Was this translation helpful? Give feedback.
All reactions