Skip to content

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

Merged
morluto merged 1 commit into
morluto:mainfrom
Plastic-time:rrfz/decimal-native-ui-options
Nov 6, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Plastic-time:rrfz/decimal-native-ui-options

Conversation

@Plastic-time

@Plastic-time Plastic-time commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The native UI scope options and the native-command deadline use numeric coercion. Values such as --pid=0x10 and --native-command-timeout-ms=1e3 pass argument validation. The compiled CLI then reaches target and capability lookup instead of refusing the token.

No linked issue. Found while reviewing the numeric options left after #7376.

Problem and expected behavior

These options take decimal integers. A non-decimal token should fail argument validation on its own field.

Change and scope

  • pid, windowId, maxNodes and the native UI and native-command deadlines in src/cli/utilityCommands.ts now use the existing decimal-token parser.
  • Non-decimal tokens return VALIDATION_ERROR on the matching field.
  • Decimal values still reach the downstream target and capability checks.
  • MCP inputs and helper behavior are unchanged.

Follow the contribution scope. Ordinary fix within existing boundaries; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: CLI argument admission in utilityCommands.ts.
  • Contribution scope fit and linked maintainer decision: ordinary fix; not applicable.
  • CLI and MCP/tool-catalog contract: CLI refuses tokens it used to coerce. MCP is unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): a refused token now stops before target lookup.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

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.

The change only refuses arguments earlier; none of the effects above is new.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/cli/utilityIntegerOptions.test.ts. --pid runs six non-decimal spellings. --window-id, --max-nodes, --native-ui-deadline-ms and --native-command-timeout-ms share the parser and run 0x10 each. Deadline and PID bounds and decimal controls are covered once.
  • Base reproduction: with only src/cli/utilityCommands.ts reset to main (89317a3), the file gives 10 failed / 2 passed. On this branch, 12/12 passed.
  • User-visible CLI/MCP output: --pid=0x10 now fails with VALIDATION_ERROR on pid before any target lookup.
  • Remaining proof gaps: Windows only. The native UI helper itself was not exercised.

Validation performed

Windows 11 x64 (10.0.26200), Node 24.22.1, base main 89317a3.

  • npm run test:focused -- tests/boundary/cli/utilityIntegerOptions.test.ts — 12/12 passed. With the source reset to main: 10 failed / 2 passed.
  • npm run check:fast (typecheck and lint) — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for decimal tokens. Hexadecimal and exponent tokens are now refused instead of coerced.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; Windows only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: argument parsing only.

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.

@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-11-04T15:54:55.123552Z
We couldn’t complete this review. Comment @codex review to try again.
22d1214 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 Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

This PR applies the existing decimal-token parser to native UI scope options and native deadlines.

  • Native utility CLI options require decimal text for integer values.

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

@morluto
morluto merged commit f1212b9 into morluto:main Nov 6, 2026
46 of 50 checks passed
@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