Commit graph

10 commits

Author SHA1 Message Date
Kynan Ware
65b45adbd8 Improve log rendering error handling and test coverage
Refactors log rendering to print errors to stderr and continue processing on JSON parse or rendering failures, instead of returning early. Updates tests to check both stdout and stderr outputs, and adds new test cases and testdata for tolerant parsing and error scenarios.
2025-09-16 17:21:01 -06:00
Kynan Ware
97d3253aaf Prefix rendered shell commands with '$ ' in logs
Shell commands in log output are now prefixed with '$ ' for improved readability and consistency with common shell output conventions. Updated related test data and test helper comments to reflect this change.
2025-09-16 11:58:58 -06:00
Kynan Ware
d636f4c213 Clarify comment on CRLF normalization in tests
Updated comments in log_test.go to clarify that CRLF is normalized to LF for OS-agnostic test behavior, improving code readability.
2025-09-16 11:47:48 -06:00
Kynan Ware
2c68168611 Rename testdata log files for clarity
Renamed sample log input and expected output files in testdata to use a consistent 'log-*-input.txt' and 'log-*-want.txt' naming scheme. Updated references in log_test.go to match the new file names for improved clarity and maintainability.
2025-09-15 13:52:14 -06:00
Kynan Ware
f33ef4227a Normalize line endings in log testdata files too 2025-09-15 13:43:12 -06:00
Kynan Ware
62d7a7541a Fix line ending conversion in tests 2025-09-15 13:41:19 -06:00
Kynan Ware
87d8d835f7 Add note for updating testdata files in log tests
A comment was added to TestFollow with instructions on how to update the .want testdata files when test outputs change. This helps maintainers regenerate expected output files more easily.
2025-09-15 13:36:35 -06:00
Kynan Ware
0b5a0491ca Make log tests OS-agnostic by normalizing line endings
Updated TestFollow to normalize line endings in test log files, ensuring consistent behavior across different operating systems, especially Windows.
2025-09-15 13:27:01 -06:00
Kynan Ware
0fb10fca7d Various log rendering improvements
Updated the LogRenderer interface and implementations to accept *iostreams.IOStreams instead of *iostreams.ColorScheme, enabling access to terminal theme and width for improved markdown rendering. Refactored related code, tests, and mocks to support this change, and enhanced log rendering to better handle markdown and code output for various tool calls.
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
05e609c5b3 fix(agent-task/shared): add log renderer
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00