Repository navigation
fix(cli): say what a refused flag, fill target, or drag endpoint expects - #5008
Conversation
A refused numeric or enum flag value printed only "Invalid wait: 240000",
so agents guessed what the flag meant. The parser now names the accepted
range or values ("Expected integer from 100 to 120000.") and returns
details.reason flag_value_invalid with the flag and its bounds. Env and
config refusals use the same describer, so --fps 500 and AGENT_DEVICE_FPS=500
read alike.
fill $REF "136849" with an unset REF reached the target decoder as one value and was told to use text="136849", which sends the text to the target slot. fill "$REF" "136849" decoded the blank target as x=0 and reported missing text. Both now refuse with details.reason fill_target_missing and say fill needs <target> <text>. One value that holds a selector key, such as label=Sign in, keeps its quoting hint.
gesture drag "170 1595" "540 160" reached selector resolution on the device and failed with Invalid selector term "170". The drag payload reader now refuses a number, "x y" or "x,y" endpoint before dispatch and before its timing checks, with details.reason drag_endpoint_is_coordinates. When both endpoints are points and the timing is valid, details.pan and the hint name the gesture pan --hold-ms command that makes the same move.
|
Thanks for the clear error messages. The change at 944f1c7 is ready. Not blocking, and each can be taken or left: Smoke Tests failed in "Install Linux desktop dependencies" because Before merge, rerun Smoke Tests and the cancelled Body rules checks. No code change is needed. Not verified here: the unit tests and the Pixel 9 before/after run at base or head, and any other place that formats |
* fix(cli): say that an integer flag rounds a fractional value down
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.
* fix(gestures): read a drag endpoint with an empty segment as no coordinate
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.
* fix(daemon): keep a typed fill target refusal on the daemon route
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.
Summary
Three CLI messages sent agents the wrong way:
fill $REF "136849"with an emptyREFsuggestedtext="136849", andfill "" 136849was read as the point (0, 136849).gesture drag "170 1595" "540 160"reached the device and failed there as a selector term.Each refusal now names the fix and carries a typed
details.reason:flag_value_invalid(with the bounds),fill_target_missing, ordrag_endpoint_is_coordinates(with the equivalent pan). Env and config refusals share the range wording.help gesturesnow says that drag takes refs or selectors.Before / after
Pixel 9 AVD (Android 16); base
a4f2dcad0, head944f1c74d:Validation
944f1c74d,check:affected --run --head,exactCommit: true. Every gate passes exceptunit, whereupload-http-deadlineandcommitted-source-treefail the same way on clean main on this macOS host.command-docs,doc-linksanddoc-prosepass when run directly.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.