Repository navigation
Description
Summary
When pm close rejects an invocation for missing closure fields, the suggested_retry line in the recovery bundle is not a runnable command. It renders each missing flag as a quoted positional value with the flag name duplicated in parentheses, and it silently drops the --reason flag that the operator did supply, leaving the reason text as a bare positional.
An agent that copies suggested_retry verbatim — which is exactly what the field invites — produces a second, differently-broken invocation.
Reproduction
Tracker configured with a strict close policy (requires --resolution, --expected-result, --actual-result).
pm close pmc-s2bk --reason "Aligned changelog:check to the replace-mode generator" --author claude
Actual recovery bundle
provided_fields: --reason, --author
missing: --resolution (--resolution), --expected-result (--expected-result), --actual-result (--actual-result)
suggested_retry: pm close pmc-s2bk "Aligned changelog:check to the replace-mode generator" "--resolution (--resolution)" "<value>" "--expected-result (--expected-result)" "<value>" "--actual-result (--actual-result)" "<value>"
Three defects in that one line:
--reasonis dropped. The supplied reason becomes a bare positional argument, so the retry loses the flag that carried it.- Flag names are emitted as quoted values.
"--resolution (--resolution)"is passed as an argument rather than as the flag--resolution. The parenthesised duplicate appears to be themissing:field's display label (--flag (--flag)) being interpolated directly into the command string instead of the flag token. --author claudeis dropped, so a retry that did parse would fail authorship validation next.
Expected
suggested_retry should be a command that runs as-is once the <value> placeholders are filled:
pm close pmc-s2bk --reason "Aligned changelog:check to the replace-mode generator" --author claude --resolution "<value>" --expected-result "<value>" --actual-result "<value>"
That is: preserve every flag the caller already provided, and append each missing flag as --flag "<value>".
Why this matters for agents
The recovery bundle is the single most machine-readable part of the error surface, and suggested_retry reads as the authoritative "do this next" instruction. When it is malformed, an agent burns a full retry cycle on a command that cannot parse, then has to reconstruct the invocation from the missing: list anyway — which makes suggested_retry net-negative compared to omitting it.
The same generator appears to back other commands' recovery bundles, so the fix is likely one shared code path.
Related
- Agent UX: pm close recovery bundle suggests --validate-close "<value>" but the flag is an enum (off|warn|strict), causing a guaranteed invalid retry #519 —
pm closerecovery bundle suggests--validate-close "<value>"when the flag is an enum. Same field, but that issue is about an invalid value placeholder; this one is about the command structure being unparseable and dropping caller-supplied flags. - Agent UX: pm show rejects --id while create/close/notes/activity accept it, and the recovery points at the wrong command #950 — recovery text pointing at the wrong command.
Activity
coderabbitai commentedon Aug 9, 2026
🔗 Related PRs
#91 - Guard agent query typo recovery after ecosystem dogfood [closed]
#146 - fix: agent never-block reliability, MCP/version coherence, and CI/docs hardening [merged]
#200 - Add validation self-repair and agent ergonomics primitives [closed]
#502 - Atomic agent work selection, dependency integrity, and recovery primitives [merged]
#712 - SDK context integrity: atomic Plans, batch similarity, sparse settings, and tombstones [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
unbraind commentedon Aug 9, 2026
pm tracker item:
pm-p316vn— canonical implementation and evidence lineage for Agent UX: pm close recovery bundle emits a suggested_retry that cannot parse and drops the flags the caller supplied #953