Skip to content

fix(cli): reject non-decimal native UI and command deadline options - #8042

Closed
Plastic-time wants to merge 1 commit into
morluto:mainfrom
Plastic-time:rrfz/decimal-utility-options
Closed

Plastic-time wants to merge 1 commit into
morluto:mainfrom
Plastic-time:rrfz/decimal-utility-options

Conversation

@Plastic-time

@Plastic-time Plastic-time commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem and outcome

Native UI scope and native-command deadline options used numeric coercion, so values such as --pid=0x10 and --native-command-timeout-ms=1e3 passed argument validation. The compiled CLI reached target/capability lookup instead of refusing the token.

Use the existing decimal-token parser for pid, windowId, maxNodes and the native UI/command deadlines in utilityCommands.ts. Non-decimal tokens now return VALIDATION_ERROR on 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 onto c0c390220.

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.

Remaining limits: Local runs were Windows-only; the native UI helper did not run. capture-native-ui-scenario shares the option object but the new regression drives observe-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; maxNodes retains its default of 500. MCP number schemas, native helper behavior and cliIntegerArgument itself 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.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Prepared with AI assistance.

Author readiness

Human owner: @Plastic-time

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T16:20:56.123554Z
We couldn’t complete this review. Comment @codex review to try again.
6a0a0ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no actionable regression was found.

Summary

This PR applies cliIntegerArgument to native UI integer options and native command deadlines. It keeps the shared deadline bounds and adds public CLI regression tests.

  • Native utility options accept only decimal integer text.

Reviews (1) · Last reviewed commit: "fix(cli): reject non-decimal native UI a..." · Reviewed by Greptile

@Plastic-time

Copy link
Copy Markdown
Contributor Author

Superseded by #8601, the same change rebased onto d3ab0faf5.

@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants