diff --git a/app/shared/lib/runtime/__snapshots__/message-parser.spec.ts.snap b/app/shared/lib/runtime/__snapshots__/message-parser.spec.ts.snap index 4b60f10b..9af949f3 100644 --- a/app/shared/lib/runtime/__snapshots__/message-parser.spec.ts.snap +++ b/app/shared/lib/runtime/__snapshots__/message-parser.spec.ts.snap @@ -57,6 +57,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl exports[`StreamingMessageParser > valid artifacts with actions > should correctly parse chunks and strip out bolt artifacts (1) > onActionClose 2`] = ` { "action": { + "actionType": "create", "content": "some content ", "filePath": "index.js", @@ -83,6 +84,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl exports[`StreamingMessageParser > valid artifacts with actions > should correctly parse chunks and strip out bolt artifacts (1) > onActionOpen 2`] = ` { "action": { + "actionType": "create", "content": "", "filePath": "index.js", "type": "file", diff --git a/app/shared/lib/runtime/message-parser.ts b/app/shared/lib/runtime/message-parser.ts index 9ec272b0..8a7fdc47 100644 --- a/app/shared/lib/runtime/message-parser.ts +++ b/app/shared/lib/runtime/message-parser.ts @@ -357,14 +357,14 @@ export class StreamingMessageParser { } } else if (actionType === 'file') { const filePath = this.#extractAttribute(actionTag, 'filePath') as string; - const actionType = this.#extractAttribute(actionTag, 'actionType') as 'create' | 'update'; + const fileActionType = this.#extractAttribute(actionTag, 'actionType') as 'create' | 'update'; if (!filePath) { logger.debug('File path not specified'); } (actionAttributes as FileAction).filePath = filePath; - (actionAttributes as FileAction).actionType = actionType || 'create'; // default to 'create' if not specified + (actionAttributes as FileAction).actionType = fileActionType || 'create'; } else if (!['shell', 'start'].includes(actionType)) { logger.warn(`Unknown action type '${actionType}'`); }