Skip to content

Conversation

@PuneetP16
Copy link

@PuneetP16 PuneetP16 commented Nov 26, 2024

Behavior

When the app reloads, it re-runs all the commands, but the shell commands were failing. To fix this issue, I've made the following change in the app/lib/runtime/action-runner.ts file:

Now the actions are properly awaited

Before Change:
image

After Change:
image

Key Change

Addition of the return statement before calling this.#executeAction. This ensures that the promise returned by this.#executeAction is properly awaited and propagated through the promise chain, preventing the subsequent actions from running before the current one has completed.

Testing

  • ✅ Manually verified that shell commands now execute successfully during app reload
  • ✅ Confirmed actions run in the correct sequence

Note: Code changes also contains a prettier fix regarding let currentLevel: DebugLevel = (import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV) ? 'debug' : 'info';

needed to return promise for proper artifact chaining
.catch((error) => {
console.error('Action failed:', error);
});
return this.#currentExecutionPromise;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this line for inter artifact chaining to work properly in workbench level

@thecodacus thecodacus merged commit fe45651 into stackblitz-labs:main Nov 29, 2024
1 of 2 checks passed
@thecodacus
Copy link
Collaborator

thanks for the fix

jhillbht pushed a commit to jhillbht/bolt.new-any-llm that referenced this pull request Jan 27, 2025
[fix]: shell commands execution failure on app reload
Stijnus pushed a commit to Stijnus/bolt.diy that referenced this pull request Mar 19, 2025
[fix]: shell commands execution failure on app reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants