Skip to content

Conversation

@nullfunc
Copy link
Contributor

@nullfunc nullfunc commented Oct 14, 2025

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

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

… add terminal logs to tracking leading up to debug prompt.
@nullfunc nullfunc requested a review from lionello as a code owner October 14, 2025 16:24
@nullfunc nullfunc requested review from KevyVo, edwardrf and jordanstephens and removed request for lionello October 14, 2025 16:25
@nullfunc nullfunc changed the title add last 10 terminal outputs for tracking for errors on command add last 30 terminal outputs for tracking for errors on command Oct 20, 2025
@nullfunc nullfunc requested a review from lionello October 21, 2025 16:35
@nullfunc nullfunc requested a review from lionello October 29, 2025 18:33
Copy link
Member

@jordanstephens jordanstephens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, these argument lists are getting long and threading the cache through each layer is adding a lot of complexity. I think this is getting complex enough to warrant creation of a log client struct that can has properties for the provider client and the cache. But given how many of us are working in this code right now, I think its best to do this in isolation in a followup.

@nullfunc nullfunc requested a review from lionello October 31, 2025 23:31
@nullfunc
Copy link
Contributor Author

nullfunc commented Nov 7, 2025

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 nullfunc marked this pull request as draft November 7, 2025 22:19
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

Successfully merging this pull request may close these issues.

5 participants