fix(tui): wire recipe dispatcher through newRootCmdForRecipeStep#16
Merged
Conversation
Follow-up to PR #14 (TUI runner) + PR #15 (viper leak fix). The runner was left wiring an inline dispatcher factory because the helper from #15 didn't exist yet on that branch. With both landed, switch the TUI dispatcher to newRootCmdForRecipeStep so the TUI benefits from the same viper state reset the CLI `jc recipe run` already gets — fixes recipes that rely on a captured step's JSON output (security-audit, compliance-report) when run from the TUI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jrennichjc
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
newRootCmdForRecipeStephelper added in fix(recipe): stop -t from leaking into subsequent dispatched steps #15jc recipe runand the TUI Recipe runnerWhy
#14 and #15 were split for cleaner review: #15 predates the runner and fixes a bug on the CLI path too, so it didn't need to be bundled. The cost was this tail — while #15 made
jc recipe run security-auditwork again, the TUI's dispatcher ininternal/cmd/tui.gowas still wired through an inlinefunc() { return NewRootCmd() }that bypassed the viper reset. Recipes with capturing steps after-tsteps (security-audit, compliance-report) would still misrender from the TUI.Test plan
go build ./...cleango test ./...— all suites pass unchangedjc tui → Recipes, verifyAuth failures in last 7 days: 0instead of the old<no value>🤖 Generated with Claude Code
Note
Low Risk
Low risk wiring change confined to the TUI recipe dispatcher; behavior should only differ by preventing output-format/viper state leakage across recipe steps.
Overview
Fixes the TUI Recipes runner to build its dispatcher with
newRootCmdForRecipeStep(instead of an inlineNewRootCmdfactory), so persistent viper keys are reset between steps.This prevents a
-tstep from leaking table output settings into later JSON-capturing steps, aligning TUI recipe execution withjc recipe run.Reviewed by Cursor Bugbot for commit 0a786f4. Bugbot is set up for automated code reviews on this repo. Configure here.