defang icon indicating copy to clipboard operation
defang copied to clipboard

add last 30 terminal outputs for tracking for errors on command

Open nullfunc opened this issue 3 months ago • 1 comments

Description

When CLI errors occur we don't always have a good idea of why it happens as we do not have customer deployment information. By including the last 10 lines of their terminal output when an error occurs on a command or before the AI debugger prompt we can hope to get some context on why they have a failure.

This PR includes

  • adding a circular buffer to the terminal to cache the last 10 terminal outputs
  • ~~add the terminal output to tracking command events which has a failure~~
  • ~~add the terminal output to tracking of when the debugger prompt~~

Linked Issues

fixes #2291

Checklist

  • [X] I have performed a self-review of my code
  • [X] I have added appropriate tests
  • [ ] I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

nullfunc avatar Oct 14 '25 16:10 nullfunc

Update: This PR is on hold. As mentioned above the threading of the logCache and the size of some of the function signatures is cumbersome. Additionally, this may not be the best way to log build breaks for analysis.

nullfunc avatar Nov 07 '25 22:11 nullfunc

Closing this for now

jordanstephens avatar Dec 19 '25 19:12 jordanstephens