Repository navigation
fix(cli): reject non-decimal native UI and command deadline options - #8042
Plastic-time wants to merge 1 commit 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.
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable regression was found. SummaryThis PR applies
Reviews (1) · Last reviewed commit: "fix(cli): reject non-decimal native UI a..." · Reviewed by Greptile |
|
Superseded by #8601, the same change rebased onto |
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
Hosted validation for head
6a0a0ff12709f0c4ad32ca63f0531bbd53df63c4: CI required passed (2026-10-29 16:37:29 UTC). This is the existing completed run, rechecked on 2026-10-30; editing this description did not rerun the code tests.The public-CLI regression covers six non-decimal spellings across five options, deadline/PID bounds and decimal controls. On base
bf115be2c: 30 failed / 2 passed; with the fix: 32/32 passed, including after rebasing ontoc0c390220.Recorded local commands, results and baseline controls
Windows 11 x64 (10.0.26200), Node 24.22.1, npm 11.19.1, base
bf115be2c. The Windows native addon and manifest came from the[email protected]tarball, as CONTRIBUTING describes.npm run test:focused -- tests/boundary/cli/utilityIntegerOptions.test.ts: base 30 failed / 2 passed; with the fix 32/32 passed.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 check:fast: typecheck and lint 2/2 passed.npm run docs:checkpassed.oxfmtran through the pre-commit hook.c0c390220, which made no change toutilityCommands.tsoroptions.tssincebf115be2c:npm run check:fastpassed;git merge-treeagainst the open PRs that editutilityCommands.ts, plus fix(cli): reject non-decimal byte-entropy window options #7877:mainand gain 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 new regression drivesobserve-native-ui. Seven related-suite failures were reproduced with the production file reset to base. The overlap checks below 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.