Repository navigation
fix(cli): parse explicit desktop capture limits - #9161
ShuaixinHuang wants to merge 2 commits into
Conversation
Codex Review Summary: ❌ FailedThis 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 reviewed changes appear safe to merge, with no blocking issue found. SummaryThe capture command uses
Reviews (3) · Last reviewed commit: "test(cli): restore desktop capture test ..." · Reviewed by Greptile |
Summary
Allow explicit positive integer limits on
capture-desktop-application. For example:Previously every explicitly supplied capture limit was rejected as “expected number, received string”. Omitting the flags worked because numeric defaults bypassed argv coercion.
Change and scope
The command registered
z.int()fields, whoseZodNumberFormatconstructor is not coerced by the pinned Incur parser. Use the existingcliIntegerArgument(1)owner for all four limits: duration, entries, per-file bytes and total content bytes. Keep existing defaults and positive safe-integer bounds, and reject non-decimal spellings before coercion.This is an existing CLI admission fix, with no new capture capability, target authority or lifecycle behavior. No maintainer scope decision is applicable. The sibling CLI registrations were checked; no other direct
z.int()registration remained. #9061 addresses the separate inspect-desktop-application limits, not this capture command. Issue and open/closed PR searches found no equivalent capture-limit fix; no issue is linked.Evidence and validation
Against current main
cfa7ebb0206aaf3cf5aeaf583f9b9336d2f9fea4, the registered CLI regression failed both explicit-limit cases, while its default and invalid-input controls passed (2 failed, 8 passed). After the fix, all 10 passed.Tests serve the actual registered command and use a scoped spy only at the capture backend. They verify all four forwarded numeric values using spaced kebab-case and equals-form camelCase flags, unchanged defaults, and refusal of zero, negative, fractional, hexadecimal, exponent, empty and unsafe-integer input before backend invocation.
Executed on Windows with the existing Node 22.20.0/dependency set:
node node_modules/vitest/vitest.mjs run --config .cache/vitest-existing-saxes.mts tests/boundary/cli/desktopCaptureOptions.test.ts— 10 passed; the same command with main's original numeric field reproduced the two failures.oxfmt --check,oxlintandgit diff --check— passed.The checkout's dependency set lacks
saxes; the ignored local Vitest config resolves the already-existing[email protected]from another checkout. No dependencies were installed or modified. Full typecheck, compiled launcher and real Linux/X11 capture were not run locally; remote CI is pending. The test does not launch an application or create capture output.Contract and compatibility
The owning boundary is CLI argv interpretation; the existing application request remains numeric. No MCP schema, Evidence, package, dependency or generated metadata changes. The capture backend's authority and cleanup are unchanged.
Author readiness
Human owner: @ShuaixinHuang
Review cleanup update
Each CLI case now saves process.exitCode before execution and restores it in afterEach before restoring spies, including after failed assertions. The 10 registered-command tests, targeted formatter/lint and whitespace checks passed after this change. New HEAD CI remains pending.