Commit 790f4c6
committed
fix: resolve symlinks in Filesystem.resolve() to prevent duplicate Instance contexts
Filesystem.resolve() used path.resolve() which normalizes path segments
but does not resolve symlinks. When opencode runs from a symlinked
directory, Instance.provide() could create duplicate contexts for the
same physical directory, causing Bus event isolation and a blank TUI.
Move symlink resolution (realpathSync) into Filesystem.resolve() so all
callers benefit. Falls back to the unresolved path if the target does
not exist, matching the guard pattern in normalizePath().
Fixes #16647
Fixes #154821 parent d15c2ce commit 790f4c6
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
505 | 523 | | |
506 | 524 | | |
0 commit comments