From 4fb64800d3bbd959511cb2a93dbf8451f34dc9a3 Mon Sep 17 00:00:00 2001 From: PuneetP16 Date: Tue, 26 Nov 2024 14:24:41 +0530 Subject: [PATCH 1/2] [fix]: shell commands failing on app reload --- app/lib/runtime/action-runner.ts | 2 +- app/utils/logger.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/runtime/action-runner.ts b/app/lib/runtime/action-runner.ts index 13b17ef11..4b32f7ada 100644 --- a/app/lib/runtime/action-runner.ts +++ b/app/lib/runtime/action-runner.ts @@ -95,7 +95,7 @@ export class ActionRunner { this.#currentExecutionPromise = this.#currentExecutionPromise .then(() => { - this.#executeAction(actionId, isStreaming); + return this.#executeAction(actionId, isStreaming); }) .catch((error) => { console.error('Action failed:', error); diff --git a/app/utils/logger.ts b/app/utils/logger.ts index 9b2c31c95..1a5c932c5 100644 --- a/app/utils/logger.ts +++ b/app/utils/logger.ts @@ -11,7 +11,7 @@ interface Logger { setLevel: (level: DebugLevel) => void; } -let currentLevel: DebugLevel = (import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV) ? 'debug' : 'info'; +let currentLevel: DebugLevel = import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV ? 'debug' : 'info'; const isWorker = 'HTMLRewriter' in globalThis; const supportsColor = !isWorker; From 5add317b1ab17943847c422ab38b490e862b1254 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sat, 30 Nov 2024 03:00:53 +0530 Subject: [PATCH 2/2] Update action-runner.ts needed to return promise for proper artifact chaining --- app/lib/runtime/action-runner.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/lib/runtime/action-runner.ts b/app/lib/runtime/action-runner.ts index 4b32f7ada..5fb984fd8 100644 --- a/app/lib/runtime/action-runner.ts +++ b/app/lib/runtime/action-runner.ts @@ -100,6 +100,7 @@ export class ActionRunner { .catch((error) => { console.error('Action failed:', error); }); + return this.#currentExecutionPromise; } async #executeAction(actionId: string, isStreaming: boolean = false) {