-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enhanced Terminal Error Handling and Alert System #797
base: main
Are you sure you want to change the base?
feat: enhanced Terminal Error Handling and Alert System #797
Conversation
Looks good, wanted something like this |
May be add to readme that it was done too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thecodacus first off: That's a great PR! Thanks for preparing / documenting this so extensively!
I don't only want to look at the (very helpful) video and respond "lgtm", but it will take some time as the diff is huge.
At first glance, there are a couple of aspects I want to clarify / where I'm in doubt hoping this helps:
As you nicely introduced, there are different aspects covered in this PR and I wonder whether these separate capabilities should be combined in the way that I currently understand:
ActionAlert
You called it ActionAlert
and not ActionError
. What's the resoning behind that? I saw you also have type: 'error' | 'info';
, but I cannot think about where type: info
should be used / how the workflow handling information messages should actually be. Why not limit this to ActionError
?
If it was an ActionError
, I think about whether there could be other errors that could be resolved in a similar way (throwing an Error
which allows the LLM to try to fix it). If this was the case, then this would be something like an ActionableError
which I'd love to see. I can e. g. imagine that exceeding a context length for an LLM might be such an actionable error, with the resulting action that the workbench reduces the context.
Alerting
You are also introducing Alerting
as a component for the first time. Currently, we do have a couple of places in which we propagate information about something that didn't work as expected to the user. And we don't have this in a central place. Would it make sense to have an AlertManagement
component which provides state for all messages towards the user (and not have it in the workbench-state)?
From such a state (which holds an array of alerts then), ActionableErrors
could be propagated to the Chat.
I'm a bit reluctant to think about introducing this here, as it might be over-engineering, but I feel that introducing error handling all over the place is... not the smartest idea with respect to regression / testability.
Tests
Speaking of tests: I'd love to have automated tests for that. It would alo make sense to have real unit-tests for that (e. g. that an ActionAlert
is properly bubbled, rendered, resolved), but also an integration test would be helpful.
But frankly: If we are in a sort-of archaic mode now, I'm also fine to just merge it 😬
I wanted the alert component to have option to add other types of alerts for future usecases like if you see the commercial bolt, llm can suggest some solutions sometimes which are just suggestions from llm and use can either take that or reject. so I didn;t wanted to make the alert limited to only error and be a generic system
I have added a central place for this in workbenchStore (as this component is already holding all the other stores) but yes if the implementation becomes complex and we have lots of other alerts and stuff I do think pulling it out to make its own component is best option
Yes I like this idea of |
got it, will try to change that to something else.
got it, so the this is an issue of capturing exit code of previous commands, which we where discussing in on other PR.
yes I am not very good at writing lines 😅 , I will update the wording.
I saw how bolt.new alerts user for error. so this UX immediately came to my mind, I am up for a better UX 👍 |
Yes, that's what I guessed you wanted to achieve. However, I think that a suggestion is different compared to surfacing an error. And might be presented differently. And there may be multiple at the same time. => would you be fine to limit this PR to |
@wonderwhy-er yes makes sense. can you provide me the chat export for me to do some testing on that?
@mrsimpson sure I will just update the chat alert component and the interface |
And can't reproduce so nevermind. And current state of reloads makes me wonder if we can when loading chat wait to run commands till end end, each one once, instead of rebuilding multiple times. Something to test. |
And on reload I do get error messages again for things that were already fixed in later messages. |
yeah. was thinking about that, figuring out a way to fix that |
We might have to think of ways how to capture any error in the browser console and feed it back. There will be always errors. |
yes That will need some brainstorming, I have added that in the PR description as future improvements |
When the error logs from the browser console are copy pasted into the llm 99% of all errors get resolved and the preview works again. I spent around 3 days to log these errors from the browsers console but was unable to. Once we get these errors into our event logs we can feed the error into the Chat LLM and it heals the errors. We have to collect all errors from Terminal and from Browser console. We will feed that back to the llm and 100% will get solved and we are not stuck with a blank preview or stopped file creation. The most challenging part is getting the browser consoles logs. Any ideas? I tried nearly everything. |
Lets explore that in separate PR. |
Yes absolutely we can discuss that in a different PR. It is not just JavaScript errors but we have to collect, group and feed the Browser Console Errors into the LLM. These are connection errors, JavaScript errors, broken code errors, any error basically. The challenge is how do we get it exactly as shown in Browser console. Please create a PR and lets continue there. Thanks |
@wonderwhy-er let me know so we can advance on these errors. I guess this is a core blocker for bolt diy as I get this quite often. Maybe we get that fixed in a couple days if we put the brains together |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worked great on windows 11,
Here checked how to get errors |
Enhanced Terminal Error Handling and Alert System
Overview
This PR introduces a comprehensive error handling system for terminal operations, featuring user-friendly error alerts and automatic LLM-powered error resolution. The system gracefully manages command execution lifecycles, including proper abortion of superseded commands.
Key Changes
1. Terminal Error Management
ActionCommandError
class for structured error handling2. Command Execution Improvements
3. UI Enhancements
ChatAlert
component for displaying terminal errors4. Error Resolution System
Technical Details
Error Handling System
Command Lifecycle Management
Alert System Integration
Testing Considerations
Migration Notes
Future Improvements
Preview
terminal.error.capture.demo.mov
Updates
updated the UX of the Alert