Repository navigation
fix(cli): reject non-decimal native UI and command deadline options - #8601
Closed
Plastic-time wants to merge 3 commits into
Closed
Plastic-time wants to merge 3 commits into
Plastic-time wants to merge 3 commits into
Conversation
The native UI scope options (--pid, --window-id, --max-nodes, --native-ui-deadline-ms) and --native-command-timeout-ms were numeric Zod fields, so Incur converted argv text with Number() before validation. Tokens such as "0x10", "0b10000", "1e1", "+16", "16.0" and " 16" were accepted as integers instead of being refused. Parse these options as decimal integer text with cliIntegerArgument, as other CLI integer arguments already do. The deadline options keep the bounds of their shared native deadline fields. MCP request schemas are unchanged.
12 of 19 tasks
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issue was found. SummaryUses
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
The native UI and command deadline options share cliIntegerArgument, so run every malformed spelling against --pid and one hexadecimal token against each other option instead of the full option-by-spelling matrix.
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.
Supersedes #8042, which was closed without review. This is the same change rebased onto
d3ab0faf5. Greptile's earlier review (5/5) is on #8042. After Greptile's review here,fab7287a7replaces the option-by-spelling test matrix with representative cases; the source is unchanged.Problem and outcome
Native UI scope and native-command deadline options used numeric coercion, so values such as
--pid=0x10and--native-command-timeout-ms=1e3passed argument validation. The compiled CLI reached target/capability lookup instead of refusing the token.Use the existing decimal-token parser for
pid,windowId,maxNodesand the native UI/command deadlines inutilityCommands.ts. Non-decimal tokens now returnVALIDATION_ERRORon the corresponding field. Decimal controls still reach the downstream target/capability checks. No issue is linked; this was found while reviewing remaining numeric options after #7376/#7493.Evidence and validation
Updated with upstream
9bea563e3on 2026-11-02 (merge commit393f6e588). Windows, Node 24.22.1, npm 11.19.1:npm run test:focused -- tests/boundary/cli/utilityIntegerOptions.test.ts12/12 passed;npm run check:fastandnpm run docs:checkpassed. The upstream update includes00c4f44a1, which repairs the old formatting/verifier failures. Earlier evidence below is historical; see the checks on the current head for hosted CI status.Local environment: Windows 11 x64 (10.0.26200), Node 24.22.1, npm 11.19.1, head
fab7287a7ond3ab0faf5(main, 2026-11-01).npm run test:focused -- tests/boundary/cli/utilityIntegerOptions.test.ts: 12/12 passed.src/cli/utilityCommands.tsreset tod3ab0faf5: 10 failed / 2 passed. The defect still reproduces on currentmain.--pidruns all six non-decimal spellings.--window-id,--max-nodes,--native-ui-deadline-msand--native-command-timeout-msshare the parser and run0x10each. Deadline/PID bounds and decimal controls are covered once.npm run check:fastpassed.Earlier hosted CI (before the 2026-11-02 upstream merge):
Static checks, one test shard andPortable testsfail the same way on maintainer PRs opened ond3ab0faf5(#8602, #8605). The causes areformat:checkon files onmain,providerVerifierCleanupandjavascriptRuntimeObservationMcp.Earlier local checks of the same source change
These ran on base
bf115be2c;utilityCommands.tshas not changed since.npm run test:focused --over 36 related files. These are every test that namesobserve-native-ui,capture-native-ui-scenario,inspect-plist,inspect-macho,demangle-swift, the deadline options orregisterUtilityCommands, plus the product-catalog, option-alias and native UI test files. Result: 178 passed, 59 skipped, 7 failed.NativeUiHelperRuntime.test.ts(2),cliOptionAliases.test.ts(1) andnativeUiRuntimeOwnership.test.ts(4).utilityCommands.tsreset tobf115be2c. Both runs gave 7 failed / 1 passed with identical test names.npm run docs:checkpassed.git merge-treeagainst the open PRs that editedutilityCommands.tsat the time:mainand gained no newly conflicted file.nativeUiScopeOptions. It replaces thescreenshot/accessibilitylines betweenwindowIdandmaxNodes; resolving it keeps both edits.Remaining limits: Local runs were Windows-only; the native UI helper did not run.
capture-native-ui-scenarioshares the option object but the regression drivesobserve-native-ui. Seven related-suite failures were reproduced with the production file reset to base. The overlap checks above describe the branches at implementation time, not a fresh compatibility guarantee for other PRs.Contract and boundary impact
The shared deadline schemas retain their descriptions and 1–2147483647 bounds;
maxNodesretains its default of 500. MCP number schemas, native helper behavior andcliIntegerArgumentitself are unchanged. Browser observation-duration options are outside this change. No new dependency, target-execution capability or authority; ordinary correction within existing scope.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Prepared with AI assistance.
Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.