DashboardcraftCraft resolveWorkspaceConfig: targets a…

Craft resolveWorkspaceConfig: targets array is reference-shared, not deep-copied

Category: gotcha
Confidence: 0.80
ID: 019f8992-f061-730d-93e5-923814cd9166
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 1
Source session: 012Op1WSIwriqapwe
Created: 2026-07-22 11:25:36
Updated: 2026-07-22 11:25:36

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 15h ago

Content

Confirmed via test: when a workspace overrides targets, resolved.targets === workspace.targets (same array reference, not deep-copied) — unlike github, which IS freshly copied via object spread. Not currently a bug since no code mutates config.targets in place, but any future logic that mutates the targets array in-place (push/splice/sort) would corrupt the workspace's stored config and could leak across workspace switches. If adding target-list mutation logic in src/config.ts's resolver, copy the array first (e.g. [...targets]).

Move to: