Commit 3c403c4
Fix config-location migrator eating the user config when project dir is the config home
A project-scope config-location migration could move the USER config aside and
leave the user on schema defaults. The project legacy-source list includes a
bare-root source <root>/magic-context.{jsonc,json} (Magic Context historically
allowed a repo-root config). When a session's project directory IS the CortexKit
user config home (e.g. opencode opened with cwd ~/.config/cortexkit), that
bare-root source resolves to ~/.config/cortexkit/magic-context.jsonc — the user
config itself. The project migration then 'migrated' it into
<root>/.cortexkit/magic-context.jsonc and renamed the original to
.MOVED_READPLEASE, so the user config path went empty and MC ran on defaults.
(Same collision class for a project opened in ~/.config/opencode or ~/.pi/agent,
where bare-root resolves to a user legacy config.)
Fix: filter project-scope legacy sources against the full user-scope path set
(the CortexKit user target in both extensions + the OpenCode/Pi user legacy
paths). A project migration can never move a user-scope file. Pi inherits the
fix automatically (shared resolveLegacyConfigSources from @magic-context/core).
Added two regression tests covering the cortexkit-home and opencode-home cwds.
No data is lost by the original bug (content is preserved at both the misplaced
target and the .MOVED_READPLEASE marker), but the user silently ran on defaults.
Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>1 parent 0aff604 commit 3c403c4
2 files changed
Lines changed: 73 additions & 1 deletion
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
288 | 332 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
117 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
118 | 145 | | |
119 | 146 | | |
120 | 147 | | |
121 | 148 | | |
122 | 149 | | |
| 150 | + | |
123 | 151 | | |
124 | 152 | | |
125 | 153 | | |
| |||
138 | 166 | | |
139 | 167 | | |
140 | 168 | | |
141 | | - | |
| 169 | + | |
142 | 170 | | |
143 | 171 | | |
144 | 172 | | |
| |||
0 commit comments