Skip to content

Add dual output to parse agent log files for terminal and step summary#1195

Merged
pelikhan merged 4 commits into
mainfrom
copilot/add-logging-to-step-summary
Oct 3, 2025
Merged

Add dual output to parse agent log files for terminal and step summary#1195
pelikhan merged 4 commits into
mainfrom
copilot/add-logging-to-step-summary

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 3, 2025

Problem

The parse agent log files (parse_claude_log.cjs, parse_codex_log.cjs, parse_copilot_log.cjs) were only writing output to the GitHub step summary via core.summary.addRaw(). This meant that parsed agent logs were only visible in the GitHub UI after the workflow completed, but not in the terminal output during workflow execution, making real-time debugging difficult.

Solution

Updated all three parse agent log files to write output to both destinations by inlining the calls:

  1. Terminal output via core.info() - visible during workflow run logs in real-time
  2. Step summary via core.summary.addRaw() - visible in the GitHub UI after completion

Before:

core.summary.addRaw(result.markdown).write();

After:

core.info(result.markdown);
core.summary.addRaw(result.markdown).write();

Benefits

  • Improved visibility: Users can now see parsed agent logs both during workflow execution and in the final summary
  • Better debugging: Real-time log output helps with troubleshooting workflow issues
  • Simple implementation: Direct inline calls without additional helper functions
  • Consistent pattern: All three parse log files now follow the same pattern

Testing

  • Added verification that both core.info and core.summary.addRaw are called with parsed output
  • All 393 tests pass (15 JavaScript + 378 Go tests)
  • Manual integration tests confirm dual output functionality works correctly

Files Modified

  • pkg/workflow/js/parse_claude_log.cjs
  • pkg/workflow/js/parse_codex_log.cjs
  • pkg/workflow/js/parse_copilot_log.cjs
  • pkg/workflow/js/parse_claude_log.test.cjs

Fixes #issue-number

Original prompt

Update the parse agent logs JavaScript file to write the output both to the github step summary file and the terminal.

Add a helper function "write" that write both to core.info and core.summary.*


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 3, 2025 14:34
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add write() helper function that outputs to both core.info and core.summary
- Update parse_claude_log.cjs to use write() helper
- Update parse_codex_log.cjs to use write() helper
- Update parse_copilot_log.cjs to use write() helper
- Add test for write() helper function
- Add test verification that core.info is called with parsed output

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot make it simpler, inline the write function in each files

Copilot AI changed the title [WIP] Add logging to write output to terminal and summary file Add write helper to parse agent log files for dual output to terminal and step summary Oct 3, 2025
Copilot AI requested a review from pelikhan October 3, 2025 14:48
- Remove write() helper function from all three parse log files
- Inline the calls: core.info(text) and core.summary.addRaw(text).write()
- Remove write from module.exports
- Remove test for write helper function (no longer needed)
- All tests pass (393 JS + Go tests)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot make it simpler, inline the write function in each files

Done. Inlined the write function calls in all three files (parse_claude_log.cjs, parse_codex_log.cjs, parse_copilot_log.cjs). The code now directly calls:

core.info(result.markdown);
core.summary.addRaw(result.markdown).write();

Commit: f1dd01f

Copilot AI changed the title Add write helper to parse agent log files for dual output to terminal and step summary Add dual output to parse agent log files for terminal and step summary Oct 3, 2025
@pelikhan pelikhan marked this pull request as ready for review October 3, 2025 15:02
@pelikhan pelikhan merged commit 1efa447 into main Oct 3, 2025
@pelikhan pelikhan deleted the copilot/add-logging-to-step-summary branch October 3, 2025 15:02
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