Skip to content

fix(cli): measure and diff tell an agent what to type after a wrong call - #7072

Merged
WaterrrForever merged 1 commit into
mainfrom
miao/measure-usage-hints
Nov 3, 2026
Merged

WaterrrForever merged 1 commit into
mainfrom
miao/measure-usage-hints

Conversation

@WaterrrForever

Copy link
Copy Markdown
Collaborator

What

The most common measure/diff errors since 0.9.4 (PostHog cli_error, CLI project) come from how agents call them, not from bad videos:

Error agents hit Users Now
Unknown flag: --from / --to / -o ~5 Did you mean --start? (--end, --out; extract the other way round)
Missing required argument: --roi (measure sync) 5 sync's own message: the mouth box, and measure face to find the face
Missing required positional argument: YOURS (diff) 4 diff compares two: the original and yours + the command
no file at D:video-studio작업대상… (bash dropped a Windows path's backslashes) 7+ fix line: quote the path or write it with /

measure <file> with no command (20 users) already prints the commands to put first (#6997), so it's unchanged.

Test plan

fails without the fix: reject-unknown-flags.test.ts "names the flag that means the same here…"

  • Ran each call above on the dev CLI and read the output.
  • reject-unknown-flags, src/measure, diff tests; typecheck; oxlint/oxfmt.

The top measure and diff errors since 0.9.4 (PostHog, CLI project) were
agents' calls, not bad videos:

- A flag from another command: --from/--to on ops that take --start/--end
  (extract is the other way round), -o for --out. The unknown-flag error now
  names the flag that means the same here.
- measure sync without --roi stopped at citty's bare "Missing required
  argument"; diff with one video at "Missing required positional argument:
  YOURS". Both now reach their own message with the command to run.
- A Windows path whose backslashes bash dropped (D:videoclip.mp4) was only
  "no file at". The fix line now says to quote it or write it with /.
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 115 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at e202feef1e122c1afb8bec3ed9308cbc3444d9a1.

No Important finding. Synonym suggestions are limited to flags actually declared by the receiving command; unknown flags remain rejected rather than becoming execution aliases. Missing diff input and mouth ROI now reach actionable guidance, and raw mangled Windows paths get the quoting/slash suggestion.

Nit: the two newly manual missing-argument checks use Fix and exit 1, where the previous required-argument validation exited 2. CLI AGENTS.md distinguishes usage errors from execution failures. Keep the improved guidance while returning usage exit 2, and pin missing-YOURS/ROI output alongside the new synonym test. This remains nonblocking: both paths still fail clearly. On POSIX, diff's existing resolve-before-probe path prevents the Windows regex hint from matching; measure's raw path does receive it.

Validation: full workspace build succeeds. CLI bun run test src/utils/reject-unknown-flags.test.ts src/measure src/commands/diff.exit.test.ts → 120 passed / 16 files. Independent flag suite → 33 passed; actual CLI calls verified human/JSON missing-YOURS guidance, ROI guidance, --from suggestion and mangled path advice. No user media or reported bug-bash films rerun. The shared flag rejection and stderr/data conventions remain in place.

Need: yes · Size: ok · Reuse: existing Fix, flag-rejection and nearest-name helpers · Simpler: bounded synonym map and explicit guidance · Structure: fine
Risk: low — corrective error messages, with a nonblocking exit-code note.

Verdict: APPROVE
Reasoning: Guidance matches the supported commands and does not silently accept mistaken flags. Focused tests and actual wrong-call outputs pass.

— hf-review

@WaterrrForever
WaterrrForever added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 91e7f4d Nov 3, 2026
136 of 138 checks passed
@WaterrrForever
WaterrrForever deleted the miao/measure-usage-hints branch November 3, 2026 10:16
@WaterrrForever WaterrrForever mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants