Fixing Read of Workspace root by index.ts (#5482)
* Fixing Read of Workspace root by index.ts * Fixing Read of Workspace root by index.ts
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Adding safety guard for workspace root
|
||||
@@ -89,6 +89,14 @@ export async function parseMentions(
|
||||
const uniqueMentions = Array.from(new Set(mentions))
|
||||
|
||||
for (const mention of uniqueMentions) {
|
||||
// Safety guard: skip a bare "/" mention. This can surface from parsed strings or tool output and would resolve to the
|
||||
// workspace root. Expanding it would scan the entire project, inflate context, and can trigger recursive loops.
|
||||
// If root-level expansion is ever desired, gate it behind an explicit syntax (e.g. "@root" or "@folder:/")
|
||||
// and enforce strict size/.clineignore limits instead.
|
||||
if (mention === "/") {
|
||||
continue
|
||||
}
|
||||
|
||||
if (mention.startsWith("http")) {
|
||||
let result: string
|
||||
if (launchBrowserError) {
|
||||
|
||||
Reference in new issue
Block a user