Skip to content

Agent UX: pm close recovery bundle emits a suggested_retry that cannot parse and drops the flags the caller supplied #953

Closed

Description

@unbraind

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:

  1. --reason is dropped. The supplied reason becomes a bare positional argument, so the retry loses the flag that carried it.
  2. 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 the missing: field's display label (--flag (--flag)) being interpolated directly into the command string instead of the flag token.
  3. --author claude is 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

Activity

  1. coderabbitai commented on Aug 9, 2026

    @coderabbitai
    🔗 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 plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 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:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. unbraind commented on Aug 9, 2026

    @unbraind
    OwnerAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions