fix: ensure file is saved before running action

- update file path examples in prompt
This commit is contained in:
KevIsDev 2025-06-25 12:29:17 +01:00
parent c5804a4ab9
commit 29a9f0bc79
2 changed files with 6 additions and 3 deletions

View File

@ -163,8 +163,8 @@ The year is 2025.
- start: Starting project (use ONLY for project startup, LAST action)
- file:
- Two actionTypes are available for file actions:
- Create for when creating a new file - Example: <boltAction type="file" actionType="create" filePath="/home/project/src/App.tsx">
- Update for when updating an existing file - Example: <boltAction type="file" actionType="update" filePath="/home/project/src/App.tsx">
- Create for when creating a new file - Example: <boltAction type="file" actionType="create" filePath="/src/App.tsx">
- Update for when updating an existing file - Example: <boltAction type="file" actionType="update" filePath="/src/App.tsx">
- Creating/updating files (add filePath and contentType attributes)
- If updating a file it should have an update actionType attribute

View File

@ -580,10 +580,13 @@ export class WorkbenchStore {
this.#editorStore.updateFile(fullPath, data.action.content);
await this.saveFile(fullPath);
if (!isStreaming) {
await artifact.runner.runAction(data);
await this.saveFile(fullPath);
this.resetAllFileModifications();
} else {
await artifact.runner.runAction(data, isStreaming);
}
} else {
await artifact.runner.runAction(data);