fix(cli): fallback to local filesystem when ACP writeTextFile fails with invalid path#2295
fix(cli): fallback to local filesystem when ACP writeTextFile fails with invalid path#2295yiliang114 wants to merge 1 commit intomainfrom
Conversation
…ith invalid path When writing to a file path that does not yet exist, the ACP writeTextFile call may return an "invalid path" error. This adds a fallback mechanism that detects this specific error and delegates to the local filesystem service, which can create missing directories and write the file directly.
📋 Review SummaryThis PR addresses issue #2294 by adding a fallback mechanism to 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
TLDR
Fix ACP
writeTextFilefailing when the target file path does not exist. When ACP returns an "invalid path" error, automatically fall back to the local filesystem to perform the write, ensuring new file creation works correctly.Dive Deeper
When calling
writeTextFilevia the ACP protocol to write to a file path that does not yet exist (i.e., creating a new file), the IDE side returns an error containing "invalid path", causing the write to fail.This PR adds a fallback mechanism to
AcpFileSystemService.writeTextFileon the CLI side:isInvalidPathWriteError()helper that checks whether the error'sdataormessagefield contains "invalid path"mkdir -p+writeFileto create directories and filesReviewer Test Plan
Testing Matrix
Linked issues / bugs
Resolves #2294