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

Question : integrate *wut* to get help on last execution error in a tmux/screen as a killer feature ? #2742

Open
johnr14 opened this issue Jan 1, 2025 · 1 comment

Comments

@johnr14
Copy link

johnr14 commented Jan 1, 2025

Issue

I have found a nifty app called wut that lets you send a terminal output to a LLM to get help fixing errors.

It's so nice that it should be integrated into aider.

It's under MIT. Hope @shobrook wouldn't mind :)

demo

To work, wut must be executed from a terminal multiplexer that allow reading existing buffer, to date tmux and screen are the only official supported.

What it would add to aider

When in a directory, after a execution error, it would be possible to have aider request help from a LLM to understand and debug last message the same way that it would if the output was from /run.

What integration of wut could simplify

  • No need to copy paste errors that are printed in the terminal !
  • Help debug errors that happened midway in the execution or when it's not launched from /run
  • Simple and fast : just launch aider --wut and a chat would be launched, appending repo map, error log and the user could ask the question or ask to fix it.

What could be enhanced

  • edit chat before with aider --wut --edit would open repo map, error log and question in $EDITOR prior to sending to LLM
  • identify local files named in the the error log and append them automatically with --auto-file that will parse error log with regexp
  • propose a few standard fix, debug, help me understand, propose a plan to fix this questions that when launching with --question-select will provide a selection screen. Could also add --question-ask, --question-fix, --question-explain and finally --question-plan to have architect integrated to debug complicated multi steps situations

I think this would be a great addition, anyone else would like that ??

Q for dev : decide to just port wut to aider's code or make it as a sub module and wrap it like some king of plugin ??

Thanks to all aider's contributors !

Version and model info

No response

@johnr14
Copy link
Author

johnr14 commented Jan 3, 2025

I made a somewhat working implentation.
--auto-file needs some rework to :

  • Check it doesn't add anything without reason
  • Ask user for selecting files to include if more than 1

Add WUT (What Went Wrong) debugging functionality

This PR adds new features to help debug terminal command errors using LLMs:

1. Added `--wut` flag to analyze last terminal command output
2. Added `--auto-file` to automatically add files mentioned in error logs
3. Added question selection menu with `--question-select` and related flags:
   - `--question-ask` - Explain what went wrong
   - `--question-fix` - Fix the error
   - `--question-explain` - Detailed explanation
   - `--question-plan` - Step-by-step fix plan
4. Added `--edit-wut` to edit the wut prompt before sending to LLM
5. Integrated with existing git/file handling infrastructure

Key implementation details:

- Added new `wut.py` module with terminal context capture and processing
- Enhanced `main.py` to handle wut flags and integrate with coder
- Added new args in `args.py` for wut functionality
- Uses tmux/screen to capture terminal history
- Parses error output for file references
- Provides structured question options for debugging

This helps users quickly debug terminal errors and get AI-assisted explanations and fixes.

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

No branches or pull requests

1 participant