feat(orchestra): tell the user which options a command is missing - #3563
Draft
amanjeetsingh150 wants to merge 1 commit into
Draft
feat(orchestra): tell the user which options a command is missing#3563amanjeetsingh150 wants to merge 1 commit into
amanjeetsingh150 wants to merge 1 commit into
Conversation
`- tapOn` said only "The command `tapOn` requires additional options", which is the part the user already knew. FlowCommandSchema knows the required arguments, the one-of groups and which commands take a selector, so the error can name them: - inputText Requires `text`. - runFlow Requires one of `file`, `commands`. - extendedWaitUntil Requires one of `visible`, `notVisible`. - addMedia Requires `files`. - tapOn It takes an element selector, for example `tapOn: Login`. Read off the schema rather than written out here, so the message cannot name an option the parser does not accept. Also fills in the `// TODO: Add docs link` sitting next to it. `objectCommands` was re-deriving the command list by the same reflection FlowCommandSchema does; it now asks the schema. Both it and `allCommands` become lazy, because FlowCommandSchema reads `stringCommands` from further down that same file and an eager read would run before that map exists. The characterisation tests from the previous commit still pass unchanged, which is what they were for. Five more describe the new message; each failed against the parser as it was, with "but was: The command `inputText` requires additional options". The docs-link one asserts FlowParseException.docs rather than the message, since that field is rendered separately by the CLI and the workspace planner -- asserting on the message would pass for the wrong reason. Verify: - ./gradlew :maestro-orchestra:test - 445 tests, 0 failures - ./gradlew :maestro-orchestra-models:test - 51 tests, 0 failures - ./gradlew :maestro-cli:compileKotlin - passes Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vHfmsiT7skZdV13zcbeof
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.
Stacked on #3562, which is stacked on #3560. Review those first; the diff here is only the last commit.
- tapOnsaid only "The commandtapOnrequires additional options" — the part the user already knew.FlowCommandSchemaknows the required arguments, the one-of groups and which commands take a selector, so the error can name them:runFlowandextendedWaitUntilare only expressible because of@YamlRequiresOneOffrom #3560 — this is the first thing making that annotation do user-facing work rather than only feeding a test.// TODO: Add docs linknext to it.objectCommandswas re-deriving the command list by the same reflection the schema does; it now asks the schema. Both it andallCommandsbecomelazy—FlowCommandSchemareadsstringCommandsfrom further down that same file, and an eager read would run before that map exists. This is the bit worth a careful look.swipedeliberately gets no options text: its variants are named by Kotlin class (YamlSwipeElement), and those shouldn't reach a user-facing error until variants have YAML-facing names.The six characterisation tests from #3562 pass unchanged, which is what they were for. Five more describe the new message; each failed against the parser as it was. The docs-link test asserts
FlowParseException.docsrather than the message — that field is rendered separately by the CLI and the workspace planner, so asserting on the message would pass for the wrong reason.e020's golden file is regenerated.Verify:
./gradlew :maestro-orchestra:test— 445 tests, 0 failures./gradlew :maestro-orchestra-models:test— 51 tests, 0 failures./gradlew :maestro-cli:compileKotlin— passes🤖 Generated with Claude Code
https://claude.ai/code/session_015vHfmsiT7skZdV13zcbeof