Repository navigation
fix(picker): render a failed action's error once - #119
Merged
Merged
Conversation
Two runs of the CLI stand between a picked action and the screen, and both rendered. `Command.runWith` prints a `UserError` through the formatter and re-fails with it, so the run the picker dispatches through printed the sentence, handed the same error on, and the run standing outside printed it again. The same command typed out only ever crosses the outer run, which is why it says it once. The dispatching run is not the one that owns the screen, so it renders nothing: `renderErrors` is what Effect's own wizard sets when it re-runs a command inside another run. Closes #118 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
An action picked in
dw-mcsays twice what went wrong with it. Two runs of the CLI stand between the action and the screen, andCommand.runWithrenders aUserErrorbefore it hands it on, so the run the picker dispatches through prints the sentence and the run standing outside prints it again. The dispatching run renders nothing instead, and the screen belongs to the outer run - the one a typed command reaches, which has always said it once.What changes
src/cli/cli.ts— the run the picker dispatches through takesrenderErrors: false, which is what Effect's own wizard sets when it re-runs a command inside another run.src/adapters/picker.ts—recordingcollects what the CLI renders as a failure where a caller asks for it, instead of swallowing it.src/cli/pick.test.ts— a picked action on a machine whosegitrefuses, counting what reached the screen.Test plan
pnpm check— pass: 58 files, 817 tests, lint, format, typecheck and buildsrc/cli/pick.test.ts— 23/23, with "says once what went wrong with the action it dispatched" red at 2 renders before the fixdw-mc review dominikwozniak/dw-mc#1renders once with and without the fix, so the picker is the only thing that doubled itRisk
A failure the outer run does not render would now print nothing;
Command.rundelegates to the samerunWiththe test drives, so the outer render is the one under test.Closes #118
🤖 Generated with Claude Code