Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Logging the entire raw safe-outputs file via core.info(rawContent) produces excessive logs when entries contain full issue/discussion bodies, potentially megabytes of output.

Changes:

  • Use displayFileContent helper from display_file_helpers.cjs (same helper used in gateway print)
  • Truncate content to first 5000 bytes with clear marker
  • Wrap output in collapsible log group with file size in title
  • Display content line-by-line with proper truncation handling

Example output:

Before:

📄 Raw safe-output .jsonl content:
{"type":"create_issue","body":"...15KB of text..."}
... potentially megabytes ...

After (small files):

▼ safe-outputs.jsonl (256 bytes)
  {"type":"create_issue","title":"Test Issue"}
  {"type":"add_comment","body":"Test comment"}

After (large files >5000 bytes):

▼ safe-outputs.jsonl (15384 bytes)
  {"type":"create_issue","body":"...truncated..."}
  ...
  (truncated, showing first 5000 bytes of 15384 total)

Benefits:

  • Code reuse: Uses the same well-tested helper as gateway logging
  • Consistency: Uniform file display behavior across the codebase
  • Reduced code: ~10 lines instead of ~30 lines of custom logic

Modified actions/setup/js/safe_output_summary.cjs lines 97-115.

Original prompt

Logging the entire raw safe-outputs file via core.info(rawContent) can produce extremely large logs (safe-output entries may include full issue/discussion bodies). Consider bounding the output (e.g., log size + first N characters, or truncate with a clear marker) and/or wrapping in a log group to reduce log spam and avoid exposing excessive content in Actions logs.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 12, 2026 11:14
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Reduce log size for raw safe-outputs Truncate and collapse raw safe-outputs logging Feb 12, 2026
Copilot AI requested a review from pelikhan February 12, 2026 11:21
@@ -101,8 +101,27 @@ async function writeSafeOutputSummaries(results, messages) {
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use file tree renderer function use in gateway print instead of this code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Replaced custom truncation logic with displayFileContent helper from display_file_helpers.cjs (used in gateway print). This provides:

  • Collapsible log group with file size in title
  • Line-by-line logging with proper truncation
  • Consistent behavior across the codebase

Commit: ce472c8

The output now shows:

▼ safe-outputs.jsonl (123 bytes)
  {"type":"create_issue",...}
  {"type":"add_comment",...}

For large files (>5000 bytes):

▼ safe-outputs.jsonl (15384 bytes)
  {"type":"create_issue",...}
  ...
  (truncated, showing first 5000 bytes of 15384 total)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 12, 2026 11:32
Copilot AI review requested due to automatic review settings February 12, 2026 11:32
Copilot AI changed the title Truncate and collapse raw safe-outputs logging Truncate and collapse raw safe-outputs logging using shared helper Feb 12, 2026
Copilot AI requested a review from pelikhan February 12, 2026 11:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses excessive logging in GitHub Actions by implementing truncation and collapsible grouping for raw safe-outputs .jsonl file content. Previously, the entire file was logged via core.info(), which could produce extremely large logs when entries included full issue/discussion bodies.

Changes:

  • Replaced direct file logging with the displayFileContent helper function that provides truncation (5000 bytes), collapsible log groups, and consistent formatting
  • Updated tests to verify the new logging behavior including truncation, log group usage, and empty file handling
  • Recompiled workflows, which updated lock files with explicit allow_body:true in update_issue handler configs and added actions/setup-go@v5 to action_pins.json

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
actions/setup/js/safe_output_summary.cjs Replaced unbounded raw file logging with displayFileContent helper that provides 5000-byte truncation and collapsible groups
actions/setup/js/safe_output_summary.test.cjs Added test coverage for truncation behavior and updated existing tests to verify log group usage
.github/workflows/ci-doctor.lock.yml Recompiled workflow lock file with explicit allow_body:true in update_issue handler config
.github/workflows/sub-issue-closer.lock.yml Recompiled workflow lock file with explicit allow_body:true in update_issue handler config
.github/workflows/workflow-health-manager.lock.yml Recompiled workflow lock file with explicit allow_body:true in update_issue handler config
pkg/workflow/data/action_pins.json Added SHA pin for actions/setup-go@v5 discovered during workflow compilation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan merged commit a7bdc5a into main Feb 12, 2026
125 checks passed
@pelikhan pelikhan deleted the copilot/limit-log-output-size branch February 12, 2026 11:44
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.

2 participants