- 
                Notifications
    You must be signed in to change notification settings 
- Fork 748
feat: add errors_summary prompt for easy injection of all notebook errors #6995
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: add errors_summary prompt for easy injection of all notebook errors #6995
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
| @@ -56,12 +60,6 @@ | |||
| traceback: list[str] | |||
|  | |||
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.
is this different from MarimoErrorDetail?
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.
Nope I forgot to remove it. I'll fix that thanks
|  | ||
| for notebook in notebooks: | ||
| session_id = notebook.session_id | ||
| notebook_errors = context.get_notebook_errors(session_id) | 
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.
do we want this get_notebook_error( to be include_stderr=True?
we may want to make include_stderr non-optional so it is explicit when used
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.
I was keeping it out of prompts because it dumps in the errors from all notebooks. But I think you mentioned most people use one notebook at a time so should be ok?
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.
We can leave it false then - but I'd make it explicit
| suggested_fix="Try again with a valid cell ID.", | ||
| meta={"cell_id": cell_id}, | ||
| ) | ||
| return session_view.cell_operations[cell_id] | 
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.
maybe some basic unit tests for these new context calls
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.
done! added this to test_base.py
        
          
                marimo/_ai/_tools/base.py
              
                Outdated
          
        
      | maybe_cell_op=cell_op, | ||
| include_stderr=include_stderr, | ||
| ) | ||
| if len(errors) > 0: | 
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.
nit: if errors:
        
          
                marimo/_ai/_tools/tools/errors.py
              
                Outdated
          
        
      | # Sort by cell_id for stable output | ||
| summaries.sort(key=lambda s: s.cell_id) | ||
| return summaries | ||
| def _get_total_errors_count_without_stderr( | 
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.
nit: _count_marimo_errors or _count_marimo_errors_without_stderr (if you need to be more verbose)
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.
Might remove this depending on how we handle STDERR in the fn
for more information, see https://pre-commit.ci
…o into tools-errors-improvement
📝 Summary
This adds errors_summary prompt so users can easily inject all errors in notebooks into agents or Cursor easily divided into notebooks and cells (with session_id and file path data included for each notebook):
🔍 Description of Changes
This also:
📋 Checklist