Repository navigation
Add streaming JSONL output to gh aw logs - #77304
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
ADRs are stored in
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /codebase-design, and /grill-with-docs. Skill selection used the fallback heuristic because the triage step was not run. The JSONL-focused tests pass under go test -race, and the core design holds up: the stream is mutex-guarded, the first write error cancels collection, and the multi-target path does not emit a duplicate summary. Three items remain.
📋 Key Themes & Highlights
Key Themes
- Cancellation reported as failure: a cancelled run emits
progresswithstage: failed, notskipped(inline comment onlogs_format_jsonl.go). - Duplicated stdin summary logic: two identical
opts.JSONOutput || stream != nilblocks (inline comment onlogs_orchestrator_stdin.go). - Docs contract gap: the docs promise a summary for empty results, but an all-targets-failed run ends without one (inline comment on
logs_multi.go).
Positive Highlights
- ✅ Run events are emitted during collection, and tests check that they arrive before the batch finishes.
- ✅ Count parity between streamed
runevents and the final report is tested (TestLogsJSONLRunMatchesFinalReportCounts). - ✅ The stdin stream path reuses
appendProcessedWorkflowRuns, so it keeps parse handling and cache writes. - ✅ The
ignoredlocalerrorsuppression onsplitLogsATIFErrorcarries a clear justification.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Streamed runs can expose work-queue details excluded by the selected artifact scope, while misclassified skips and missing metadata-failure events make stdout status reporting unreliable.
4 open issues
What changed in this PR
Adds gh aw logs --format jsonl so CLI consumers can receive progress and processed runs during collection, followed by an authoritative final summary.
Changes:
- Introduces typed JSONL events, synchronized writes, and cancellation on output failures.
- Integrates streaming across discovery, multiple workflow targets, stdin, cache hits, and empty results.
- Adds format validation, focused tests, and event-contract documentation.
| File | Description |
|---|---|
pkg/cli/logs_run_download_concurrent.go |
Emits download progress for cache hits and worker results. |
pkg/cli/logs_orchestrator.go |
Starts and finalizes discovery-mode streaming. |
pkg/cli/logs_orchestrator_types.go |
Carries the stream through orchestration and rendering options. |
pkg/cli/logs_orchestrator_stdin.go |
Streams stdin collection and handles empty summaries. |
pkg/cli/logs_orchestrator_render.go |
Renders JSONL summaries and shares message-count updates. |
pkg/cli/logs_orchestrator_download.go |
Emits discovery progress and accepted run records. |
pkg/cli/logs_multi.go |
Shares streaming across workflow targets and emits warnings. |
pkg/cli/logs_format_jsonl.go |
Implements event encoding, write synchronization, cancellation, and terminal events. |
pkg/cli/logs_format_jsonl_test.go |
Covers flags, streaming timing, concurrency, summaries, and write failures. |
pkg/cli/logs_command.go |
Exposes the format and rejects combination with --json. |
docs/src/content/docs/setup/cli.md |
Documents events and distinguishes streaming from the JSONL cache. |
Review effort: Max (dynamic)
Co-authored-by: Copilot App <[email protected]>
|
Regarding the generated ADR notice: reviewed and finalized the draft against the implementation, including concurrent streaming, cancellation, and failure semantics. The finalized ADR is linked in the PR description. |
|
Regarding this review status: no code change is needed for the progress notice itself. The actionable findings are addressed in their individual review threads. |
|
Regarding the Test Quality Sentinel result: no change is requested by this reported_no_action notice. It is not being treated as proof of test coverage; the review fixes have their own focused regression checks. |
|
Regarding the skills-review completion notice: the notice itself needs no code change. The three findings in the accompanying review are addressed individually in their inline threads. |
|
Regarding the specification-review result: this reported_no_action notice contains no requested change. Streaming remains selected only with |
|
Regarding the Ponytail Reviewer result: no code change is needed because this notice reports no actionable finding. The concrete inline findings are handled separately, with focused validation of their fixes. |
|
Accepted the ADR gate feedback: finalized ADR-77304 with Context, Decision, Alternatives Considered, and Consequences, and linked it in the PR description. It documents the |
Co-authored-by: Copilot App <[email protected]>
|
The generated ADR notice is already addressed: the draft has been finalized and linked in the PR description. No further change is needed for this repeated notice. |
|
The review progress notice contains no actionable finding, so no additional change is needed. Concrete findings are addressed in their individual review threads. |
|
The Test Quality Sentinel notice requests no change. Its no-action result is not being used as evidence that tests passed or changes were published. |
|
The skills-review completion notice introduces no additional change request. The accompanying actionable findings were handled in their inline threads. |
|
The specification-review notice reports no actionable finding. Validation and publication are established separately rather than inferred from that status. |
|
The Ponytail Reviewer notice contains no requested change. Its no-action result is not proof of validation or publication. |
|
The ADR gate request is accepted and already satisfied: the committed ADR has Context, Decision, Alternatives Considered, and Consequences and is linked in the PR description. No additional ADR edit is needed for this repeated request. |
|
Confirmed the prior ADR response: the committed ADR documents concurrent streaming, cancellation, and failure handling and is linked in the PR description. This acknowledgment introduces no further change. |
|
The prior status response remains correct: the progress notice itself needs no change. Actionable findings are tracked separately in their inline threads. |
|
The prior test-status response introduces no additional requirement. A reported_no_action result is not treated as proof of test coverage or passing checks. |
|
The prior skills-review response is an acknowledgment, not a new implementation request. The original findings were addressed in their individual review threads. |
|
Confirmed the prior specification response: streaming still uses only |
|
The prior Ponytail response remains applicable: the notice has no actionable finding. Concrete findings and their validation are handled independently. |
|
Confirmed the prior ADR resolution: the finalized, linked ADR contains all four sections and documents selector, summary, cancellation, and incomplete-stream semantics. This is already satisfied and needs no additional edit. |
|
🎉 This pull request is included in a new release. Release: |



Summary
CLI consumers currently have to wait for the full logs report before parsing results. Add
gh aw logs --format jsonlso they can consume progress and processed run data during collection.--format jsonl; no standalone flag is added.The final summary is authoritative: streamed runs do not yet include cross-run analysis or live outcomes. Human diagnostics remain on stderr.
ADR: ADR-77304: Stream JSONL Output from the Logs Command
Validation
go test ./pkg/cli -run '^Test(LogsJSONL|NewLogsCommand)$|^TestLogsJSONL' -count=1make agent-report-progress-no-testmake buildgolangci-lint run ./pkg/cli(0 issues)make check-workflow-drift(365 workflows compiled; no drift)--stdin --format jsonl.Impacted unit tests passed during the final gate. Initial lint findings were corrected and the affected checks rerun; custom analyzers have no diagnostics in changed files, with unrelated baseline diagnostics remaining elsewhere.
Review fixes also passed focused race-enabled JSONL, stdin empty-result, and Harbor tests. Harbor tests use a canonical temporary directory on macOS because
/varis a symlink; build, lint, and workflow drift checks were rerun after the fixes.