Parent issue
#145
Problem
When the session fell back to the Copilot engine for ContentTwin/pull/72, the triage step immediately failed:
error: Invalid command format.
Did you mean: copilot -i "suggest -p # Tier 1: Triage..."
The copilot CLI rejected the command that review-one-pr.sh issued during the triage tier. This indicates one or both of:
- The CLI invocation syntax used by the script no longer matches the installed CLI version (flags / subcommand changed).
- The prompt is being passed in a way the CLI rejects (e.g., positional arg vs
--prompt flag, unescaped characters, length).
Because the CLI exited non-zero with this message, the rate-limit detector (see #147) classified it as a rate limit and aborted the entire session, skipping 18 PRs.
Acceptance criteria
- Root cause confirmed: identify the exact
copilot CLI invocation in review-one-pr.sh (and any shared helper) that produces the format error, and document the correct invocation for the installed CLI version.
- Invocation fixed: the corrected command is applied and manually verified to succeed locally against a test prompt.
- Version pinned or detected: either pin the CLI version in the workflow's setup step, or add a version-check that emits a clear error when the installed CLI is below the minimum supported version.
- Smoke test step: add a lightweight
copilot CLI smoke test (e.g., copilot --version and a one-liner prompt) as a pre-flight step so format errors surface as a clear setup failure rather than a mid-run rate-limit false-positive.
- The triage tier completes successfully against a real low-risk PR on the Copilot engine.
Expected tests
- Unit (shellcheck / bats): the helper that builds the
copilot CLI invocation string is tested with edge-case prompts (long prompt, prompts with quotes/newlines) to confirm no format errors.
- Integration (dry-run): a dry-run workflow step runs the fixed Copilot triage command and asserts exit code 0.
- Integration: a full end-to-end review of a known low-risk PR succeeds on the Copilot engine without format errors.
Parent issue
#145
Problem
When the session fell back to the Copilot engine for
ContentTwin/pull/72, the triage step immediately failed:The
copilotCLI rejected the command thatreview-one-pr.shissued during the triage tier. This indicates one or both of:--promptflag, unescaped characters, length).Because the CLI exited non-zero with this message, the rate-limit detector (see #147) classified it as a rate limit and aborted the entire session, skipping 18 PRs.
Acceptance criteria
copilotCLI invocation inreview-one-pr.sh(and any shared helper) that produces the format error, and document the correct invocation for the installed CLI version.copilotCLI smoke test (e.g.,copilot --versionand a one-liner prompt) as a pre-flight step so format errors surface as a clear setup failure rather than a mid-run rate-limit false-positive.Expected tests
copilotCLI invocation string is tested with edge-case prompts (long prompt, prompts with quotes/newlines) to confirm no format errors.