#1129, add usage update in ACP mode

This commit is contained in:
tanzhenxin
2025-12-09 09:58:19 +08:00
parent efbf50554d
commit d7b9466516
15 changed files with 279 additions and 28 deletions

View File

@@ -31,10 +31,16 @@ export class AcpFileSystemService implements FileSystemService {
});
if (response.content.startsWith('ERROR: ENOENT:')) {
// Treat ACP error strings as structured ENOENT errors without
// assuming a specific platform format.
const match = /^ERROR:\s*ENOENT:\s*(?<path>.*)$/i.exec(response.content);
const err = new Error(response.content) as NodeJS.ErrnoException;
err.code = 'ENOENT';
err.errno = -2;
err.path = filePath;
const rawPath = match?.groups?.['path']?.trim();
err['path'] = rawPath
? rawPath.replace(/^['"]|['"]$/g, '') || filePath
: filePath;
throw err;
}