-
Notifications
You must be signed in to change notification settings - Fork 43
Fix Claude log parser: use stream-json and tee for JSONL output #12947
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
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot make sure the Claude output is also streamed to the action stdout |
The log parser expects either JSON array format or JSONL format (newline-delimited JSON objects), but the code was using `--output-format json` which outputs a single JSON object. Changed to `--output-format stream-json` which outputs JSONL format compatible with the parser. - Changed `--output-format json` to `--output-format stream-json` in claude_engine.go - Updated test to expect stream-json instead of json - Recompiled all workflow files to apply the change Fixes the "Log format not recognized as Claude JSON array or JSONL" error. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
Agent Container Tool Check
Result: 10/12 tools available Missing Tools:
Core development tools (shell, git, HTTP, JSON/YAML processing, GitHub CLI, Node.js, Python, Go) are all available. Java and .NET runtimes are not installed in this container.
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Status: PASS @pelikhan
|
Add `2>&1 | tee -a` redirection to capture Claude's stream-json output to the log file while also displaying it on the GitHub Actions console for monitoring. Previously, only debug logs were written to the file via --debug-file, but the JSON output from --output-format stream-json went to stdout and wasn't captured in the log file. This meant the log parser couldn't read the JSON output. Now both debug logs and JSON output are written to /tmp/gh-aw/agent-stdio.log AND displayed on the console. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
PRs: Fix Claude log parser: use stream-json for JSONL output; [fp-enhancer] Apply functional programming and immutability improvements
|
Claude Code CLI was configured with
--output-format json, which produces a single JSON object. The log parser expects either JSON array format[{...}, {...}]or JSONL format{...}\n{...}\n(newline-delimited). Additionally, the JSON output wasn't being captured to the log file for parsing.Changes
Engine configuration (
pkg/workflow/claude_engine.go):Output capture (
pkg/workflow/claude_engine.go):Test update (
pkg/workflow/claude_engine_test.go):stream-jsonflagWorkflow recompilation:
.lock.ymlfiles regenerated with new CLI flags and output redirectionTechnical details
The
stream-jsonformat emits newline-delimited JSON objects (JSONL), which the parser'sparseLogEntries()function already handles via its line-by-line JSON parsing logic. Theteecommand captures stdout/stderr to the log file while also displaying output on the GitHub Actions console for real-time monitoring.Previously, only debug logs were written to the file via
--debug-file, but the JSON output from--output-format stream-jsonwent to stdout and wasn't captured. Now both debug logs and JSON output are written to/tmp/gh-aw/agent-stdio.logfor parsing, while remaining visible on the console.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset