CB-543: neutralize tracked opencode.json and .autoenv in provisioned worktrees #22
Reference in New Issue
Block a user
Delete Branch "worker/cb-543-neutralize-worktree-hostile-configs-f13dba-12"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes live bug: a tracked
opencode.jsonlands in every bridged worktree carrying{file:.secrets/...}references to gitignored secrets (.secrets/ is gitignored), so opencode refuses to start — 100% reproducible for opencode workers.Generalizes the existing single-file .mcp.json neutralization in GitWorktrees.isolateToolSurface to a LIST of worktree-hostile configs, each with a format-valid neutral stub and a create-if-absent policy:
Each stub is valid for its format: an explicitly empty mcpServers map, an empty JSON object, and an empty env file. Absent configs are skipped silently — never fails provisioning, never invents stubs for files the repo doesn't have. Neutralized copies are marked
git update-index --skip-worktreeso they never surface as a pending modification.Does NOT copy or reference .secrets/ anywhere — secrets stay workspace-scoped.
Tests (GitWorktreesTest, +3): tracked opencode.json neutralized + skip-worktree hidden; absent config skipped without error / no stub invented; all three configured files covered. Existing 4 tests (incl. .mcp.json create-always) unregressed.
Build: mvn clean install — Tests run: 524, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS. Based on origin/main @
6dee84c.