Elffuss BraidHub

kikocis/continue public

fix: return output from edit file tool + accept ./ paths
Changeset95b2bfbfd2aa9bee233c99ce1e78daa3036e5c7e78a62b0b277d543450cb3980
AuthorNate <sestinj@gmail.com> · 2025-09-09 23:10 -07:00
CommitterNate <sestinj@gmail.com> · 2025-09-09 23:10 -07:00
Parentsae0f6b584d4f

Browse the files at this changeset

1 file changed

modified gui/src/util/clientTools/editImpl.ts +15 −5
@@ -12,16 +12,20 @@
1212 "`filepath` and `changes` arguments are required to edit an existing file.",
1313 );
1414 }
15+ let filepath = args.filepath;
16+ if (filepath.startsWith("./")) {
17+ filepath = filepath.slice(2);
18+ }
1519
1620 const openFiles = await extras.ideMessenger.ide.getOpenFiles();
1721 let firstUriMatch = await resolveRelativePathInDir(
18- args.filepath,
22+ filepath,
1923 extras.ideMessenger.ide,
2024 );
2125
2226 if (!firstUriMatch) {
2327 for (const uri of openFiles) {
24- if (uri.endsWith(args.filepath)) {
28+ if (uri.endsWith(filepath)) {
2529 firstUriMatch = uri;
2630 break;
2731 }
@@ -29,7 +33,7 @@
2933 }
3034
3135 if (!firstUriMatch) {
32- throw new Error(`${args.filepath} does not exist`);
36+ throw new Error(`${filepath} does not exist`);
3337 }
3438 const streamId = uuid();
3539 void extras.dispatch(
@@ -42,7 +46,13 @@
4246 );
4347
4448 return {
45- respondImmediately: false,
46- output: undefined, // No immediate output.
49+ respondImmediately: true,
50+ output: [
51+ {
52+ name: "File edited successfully",
53+ content: `Successfully initiated edit for ${firstUriMatch}`,
54+ description: "File edit operation started",
55+ },
56+ ],
4757 };
4858 };