-
Notifications
You must be signed in to change notification settings - Fork 749
feat(amazonq): get logs generated by the Agent #6832
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
Conversation
9806f89 to
ecd3fde
Compare
7ebe0e9 to
e2a0738
Compare
d0d5e37 to
67f02d8
Compare
packages/amazonq/.changes/next-release/Feature-86f056f5-4ac4-47be-8167-09c19a529a1e.json
Outdated
Show resolved
Hide resolved
292e569 to
57bfbf5
Compare
2b18918 to
cd3ac96
Compare
0bc6aad to
dabd1b9
Compare
| file.zipFilePath === RunCommandLogFileName | ||
| ) | ||
| if (logFileInfo) { | ||
| getLogger().info(`sessionState: Run Command logs, ${logFileInfo.fileContent}`) |
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.
what is the typical value of logFileInfo.fileContent ? is it potentially all of the contents of a big text file, or is it guaranteed to be just a small bit of text (e.g a filename or something like that)?
full text files should not be printed to the logs.
consider using truncate() to avoid printing excessively long text.
| export function truncate(s: string, n: number, suffix?: string): string { |
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.
The intent of the feature is to display the logs of the commands executed by the Agent to the User. Therefore the length of the logFileInfo.fileContent can be large which will be reflective of the logs generated if the user would've ran the code in their execution environment.
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.
Then it should be truncated to avoid edge cases where the logs are very large. Writing MB or GB to the log file isn't ever going to be useful to anyone, and is likely to cause problems instead.
Please always consider edge-cases when writing code.
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.
Truncating to limit the content length in revision.
8daee2b to
0f2a444
Compare
Problem
Users currently cannot access logs generated by the Agent when it executes user commands during code generation.
Solution
The output generated by the Agent during user command execution will be captured and written to the user's
logs. This ensures that:feature/xbranches will not be squash-merged at release time.