Skip to content
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

After a cell's code execution fails, click the error analysis button to perform the analysis. #1184

Open
msyJY opened this issue Jan 6, 2025 · 9 comments
Labels
enhancement New feature or request

Comments

@msyJY
Copy link

msyJY commented Jan 6, 2025

Hello, I was previously working on configuring a custom model for jupyter-ai and came across an issue where there was a feature mentioned. This feature allows a button to pop up when code in a notebook cell encounters an error, and clicking the button would enable error analysis. However, I didn't save the issue link and now I can't find it. I'm wondering if there are any related discussions in the jupyter-ai issues? If so, could you please let me know how to configure this feature locally? Thank you!
WeChatc509267e1059540cbe5622a81a2b4022

@msyJY msyJY added the enhancement New feature or request label Jan 6, 2025
@dlqqq
Copy link
Member

dlqqq commented Jan 7, 2025

@msyJY Thanks for opening an issue about this! I don't recall any dedicated issues for this, but I'll link them here in case I find them later.

We are already working on providing some kind of UX for fixing errors directly from the notebook. @Zsailer has written a set of AI extensions which provide AI capabilities directly in the notebook, so there may already exist a WIP solution for this. Zach, can you chime in here about the status of this feature?

@Zsailer
Copy link
Member

Zsailer commented Jan 7, 2025

Yep, checkout out: https://github.com/Zsailer/jupyterlab-magic-wand.

This work is still in early phase, but here is a plugin you can install that works with Jupyter AI out-of-the-box and adds a "magic" button to the cell toolbar which will fix exceptions. Test it out and leave feedback! 🚀

@dlqqq and I are working with others to begin moving some of this work into Jupyter AI, so keep an eye out for major releases coming down the pipeline :)

@msyJY
Copy link
Author

msyJY commented Jan 8, 2025

Thank you, I will give it a try.

@krassowski
Copy link
Member

It would be pretty natural for the error renderer to have a place to add buttons, as the cell toolbar does.

Currently multiple extensions compete for this, trying to add buttons like "Fix Error", "Explain Error", "Copy traceback", "Collapse", e.g. https://github.com/deshaw/jupyterlab-skip-traceback.

@krassowski
Copy link
Member

works with Jupyter AI out-of-the-box and adds a "magic" button to the cell toolbar which will fix exceptions

Personally not a huge fan of this because I would like to have a "Fix" button only when relevant (because I disable the cell toolbar as distracting).

@krassowski
Copy link
Member

Another data point, pretzel ai (a hard fork of JupyterLab, because of... reasons? anyways, pretzelai/pretzelai#110) had it both on the cell toolbar and on the error output:

image

@dlqqq
Copy link
Member

dlqqq commented Jan 8, 2025

@krassowski Thanks for sharing examples of other extensions providing features directly through the cell error UI. I think we'll need something similar in addition to Zach's existing magic wand feature for Jupyter AI v3. Multiple (5+) users have requested a simple "Fix error" button to be available in error cells. We could make it share an icon with the magic wand feature, so the user knows that they are sharing the same functionality.

@Zsailer
Copy link
Member

Zsailer commented Jan 8, 2025

Personally not a huge fan of this because I would like to have a "Fix" button only when relevant

Actually, the magic button does "fix" only when it's relevant. That's part of the "magic" ;). It uses context from the cell, its output, and its metadata to decide what to do. If a traceback is seen, it tries to fix. If not, it will do something else based on what the cell (and its context) gives it.

But, I get that this has edge cases.

One thing I've explored is adding UX to the magic button where if you hold it down for a second, a subset of buttons pop up like "fix", "edit", etc. I think this is fine too; however, I found that in most cases this wasn't needed. The cell context was rich enough for the agent to match my expectation.

@dlqqq
Copy link
Member

dlqqq commented Jan 8, 2025

@Zsailer Just a random usability suggestion (no need to even respond):

  • Single clicking the magic wand opens a menu with options. If a user clicks any of these options, it opens a prompt which allows them to add additional instructions before submitting.
  • Double clicking the magic wand (or single clicking while the menu is open) runs the magic automatically with no user input.

This is kind of similar to the UI provided by file browsers, where you single click for granular actions like renaming / moving, and double click for the main action (opening the file).

IDK if this is even close to the optimal UX, but I would like to explore other solutions similar to this which offer both features (prompted & promptless). I see value in both, so I think we should try to provide both and be sure to not assume a tradeoff between the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants