Repository navigation
fix(cli): correct three refusals from #5008 - #5027
Conversation
The refusal for an int flag said "Expected integer from 100 to 120000", but the parser takes any number in range and floors it: open --timeout 1.5 runs with 1 while --timeout 0.5 is refused. The message now says "Expected number >= 1 (rounded down to an integer)". Which values are accepted does not change. Env and config values still say integer, since those sources refuse a fraction.
…inate
readCoordinateEndpoint split "," into two empty segments and "170," into
"170" and one, and Number("") is 0, so gesture drag refused both as the
coordinates (0, 0) and (170, 0). An empty segment now makes the endpoint
no coordinate, so it reaches the selector checks like any other malformed
target.
parseFillTarget caught every decode error and answered with the generic "fill requires x y text, @ref text, or selector text", so a client that sent fill positionals straight to the daemon lost fill_target_missing and its guidance. A decode refusal with a typed reason now reaches the caller with the message, reason and hint the CLI reports; other decode failures keep the generic response. The decoder quotes the positionals, and a --text-stdin or --record-as fill's lone positional may be the text itself, so a sensitive fill keeps the reason with a message that echoes none of them.
|
Thanks for the quick fix. The PR is ready at d322875: the three corrected refusals trace cleanly through the changed routes, and the tests cover each regression. No conflicts. The only red marks are the two cancelled Body rules runs, which check the PR body text and share no route with this diff, and the other 15 checks pass. Not verified here: the tests and the CLI were not run locally, and the exact point where the late "Invalid selector term" refusal fires relative to device dispatch on the drag route was not confirmed. Not blocking, and fine to take or leave: (1) |
Summary
Follow-up to #5008, from its review:
Expected integer, but the parser floors any number in range (open --timeout 1.5runs with 1). It now saysExpected number >= 1 (rounded down to an integer); accepted values do not change. Env and config refusals still say integer, since they refuse a fraction.gesture dragread","and"170,"as coordinates, because an empty segment became 0. Such endpoints now reach the selector checks.details.reasonfill_target_missing. A--text-stdinor--record-asfill keeps the reason, with a message that does not echo its positionals. Untyped decode failures keep the generic response.Before / after
Base
aecafaf30, headd3228751f. Output of the CLI parser, the drag payload reader and selector parser, and the daemon fill decoder:Validation
d3228751f,check:affected --run --head,exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related (441 tests) pass.--timeout 1.5staying accepted and floored,",","170,"and"170 , "drag endpoints, andfillwith only its text through the daemon interaction handler, with and without--text-stdin/--record-as. Each fails with its fix reverted.fill_target_missingrow inerror-reasons.mdstays put:scripts/reasons/generate.tsorders rows by table file path, then line.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.