You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 fix: auto-correct redundant absolute paths with warning (#503)
## Problem
Terminal-bench agents hit "Redundant path prefix" errors on 55% of tasks
(44/80) when using absolute paths like `/app/file.txt`. This wastes tool
calls as agents retry with relative paths—particularly affecting QEMU
(80% fail), Git (83% fail), and Security (75% fail) categories.
## Solution
Changed `validateNoRedundantPrefix` to auto-correct paths while keeping
the warning. Tools now use the corrected path and include: `"Using
relative paths like 'file.txt' instead of '/app/file.txt' saves tokens.
The path has been auto-corrected for you."`
**Expected impact:** +5-8pp pass rate improvement. Combined with merged
30-min timeout, targeting 60-65% pass rate.
_Generated with `cmux`_
error: `Redundant path prefix detected. The path '${filePath}' contains the workspace directory. Please use relative paths to save tokens: '${relativePath}'`,
90
+
correctedPath: relativePath,
91
+
warning: `Note: Using relative paths like '${relativePath}' instead of '${filePath}' saves tokens. The path has been auto-corrected for you.`,
91
92
};
92
93
}
93
94
@@ -135,3 +136,30 @@ export function validatePathInCwd(
135
136
136
137
returnnull;
137
138
}
139
+
140
+
/**
141
+
* Validates and auto-corrects redundant path prefixes in file paths.
142
+
* Returns the corrected path and an optional warning message.
143
+
*
144
+
* This is a convenience wrapper around validateNoRedundantPrefix that handles
145
+
* the common pattern of auto-correcting paths and returning warnings.
146
+
*
147
+
* @param filePath - The file path to validate (may be modified if redundant prefix found)
148
+
* @param cwd - The working directory
149
+
* @param runtime - The runtime to use for path normalization
150
+
* @returns Object with correctedPath and optional warning
0 commit comments