Conversation
|
the previous issue is the output too large for single step while for multiple steps it might accumulated and become too large to send |
There was a problem hiding this comment.
Pull Request Overview
This PR aims to reduce the size of execution output to prevent JSON payload size errors that were causing failures in the dev branch. The changes focus on improving output truncation logic and reducing default character limits.
- Moved truncation constants to a centralized constants file for better organization
- Reduced the default character limit from 5000 to 2500 to prevent payload size issues
- Enhanced truncation logic to choose the more restrictive limit when both line and character limits apply
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| weco/constants.py | Added centralized constants for output truncation limits with reduced character limit |
| weco/utils.py | Refactored truncation logic to use centralized constants and improved algorithm to select smaller output |
| # Use whichever produces smaller result | ||
| if len(lines_output) <= len(chars_output): | ||
| output = lines_output | ||
| chars_truncated = False # Only show line truncation message |
There was a problem hiding this comment.
Setting flags to False to control message display creates confusing logic. Consider using a separate variable to track which truncation method was applied instead of modifying the original detection flags.
| chars_truncated = False # Only show line truncation message | ||
| else: | ||
| output = chars_output | ||
| lines_truncated = False # Only show char truncation message |
There was a problem hiding this comment.
Setting flags to False to control message display creates confusing logic. Consider using a separate variable to track which truncation method was applied instead of modifying the original detection flags.
|
close since it is not the root cause |
Seeing the error from some of the runs (
devbranch)I think it was caused by json payload too large and weco fails to send via
evaluate_feedback_then_suggest_next_solutioweco/api.py