fix(hook): preserve configured output_summary label on failure#808
Conversation
PR #772 forced Combined output on failure to avoid losing diagnostics, but this changed the summary header label (e.g., "lint output:" instead of "lint stderr:"), breaking #784's tests. Use combined content on failure but keep the configured label. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Greptile SummaryThis PR fixes a label regression introduced by #772: on failure, it was forcing Confidence Score: 5/5Safe to merge — minimal, targeted fix with no regressions introduced. Single-line change in a well-tested code path. The fix correctly preserves the configured label while keeping combined content on failure, exactly matching the intent of both #772 and #784. All four No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[save_output_summary called] --> B{is_check_first\ncheck that failed?}
B -- yes --> C[return early\n no output saved]
B -- no --> D{is_failure AND\noutput_summary != Hide?}
D -- yes --> E["append_step_output\nlabel = self.output_summary\ncontent = combined\n(preserves label, captures all streams)"]
D -- no --> F{output_summary value}
F -- Stderr --> G[label=Stderr, content=stderr]
F -- Stdout --> H[label=Stdout, content=stdout]
F -- Combined --> I[label=Combined, content=combined]
F -- Hide --> J[no output saved]
Reviews (1): Last reviewed commit: "fix(hook): preserve configured output_su..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates the step output logic in src/step/output.rs to respect the configured output summary label even during failure scenarios, while still honoring the 'hide' opt-out. I have no feedback to provide as there are no review comments to address.
### 🐛 Bug Fixes - **(hook)** remove dup output and preserve check_first diagnostics by [@nkakouros](https://github.com/nkakouros) in [#784](#784) - **(hook)** show combined output for failed steps by [@nkakouros](https://github.com/nkakouros) in [#772](#772) - **(hook)** preserve configured output_summary label on failure by [@jdx](https://github.com/jdx) in [#808](#808) ### 📦️ Dependency Updates - update rust crate pklr to 0.4.1 by [@jhult](https://github.com/jhult) in [#805](#805) ### New Contributors - @jhult made their first contribution in [#805](#805) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Primarily a version bump and doc/metadata regeneration, plus routine dependency lockfile updates; minimal behavioral risk beyond potential upstream crate changes. > > **Overview** > Bumps `hk` to **v1.41.1** and adds the corresponding `CHANGELOG.md` release entry. > > Regenerates/version-aligns published artifacts and docs (CLI docs JSON/markdown, `hk.usage.kdl`, and all docs/examples that reference the release `package://.../v1.41.1` URLs). > > Updates `Cargo.lock` for dependency bumps (notably `pklr 0.4.1`, `indexmap 2.14.0`/`hashbrown 0.17.0`, and `tokio 1.51.1`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0a2a092. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <[email protected]>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [hk](https://github.com/jdx/hk) | patch | `1.41.0` → `1.41.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/hk (hk)</summary> ### [`v1.41.1`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1411---2026-04-10) [Compare Source](jdx/hk@v1.41.0...v1.41.1) ##### 🐛 Bug Fixes - **(hook)** remove dup output and preserve check\_first diagnostics by [@​nkakouros](https://github.com/nkakouros) in [#​784](jdx/hk#784) - **(hook)** show combined output for failed steps by [@​nkakouros](https://github.com/nkakouros) in [#​772](jdx/hk#772) - **(hook)** preserve configured output\_summary label on failure by [@​jdx](https://github.com/jdx) in [#​808](jdx/hk#808) ##### 📦️ Dependency Updates - update rust crate pklr to 0.4.1 by [@​jhult](https://github.com/jhult) in [#​805](jdx/hk#805) ##### New Contributors - [@​jhult](https://github.com/jhult) made their first contribution in [#​805](jdx/hk#805) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuOCIsInVwZGF0ZWRJblZlciI6IjQzLjExMC44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Summary
Combinedoutput on failure to avoid losing diagnostics, but this changed the summary header label (e.g.,lint output:instead oflint stderr:), breaking fix(hook): remove dup output and preserve check_first diagnostics #784's tests.output_summary.Test plan
test/output_summary_no_duplicate.batspasses locally (both tests)🤖 Generated with Claude Code
Note
Low Risk
Low risk, small change limited to end-of-run output summarization; main risk is subtle behavior differences in how failure output is labeled (and stored) for downstream consumers/tests.
Overview
On step failure, the summary now saves combined output content to avoid losing diagnostics, but preserves the step’s configured
output_summarymode/label instead of forcingCombined.output_summary = "hide"is still respected even on failure, preventing any summary output from being recorded.Reviewed by Cursor Bugbot for commit f0090e4. Bugbot is set up for automated code reviews on this repo. Configure here.