Files
xarmian 786406e569 fix(cli): print the op_key of a failed write; stop claiming a re-run is safe (BUG-3999) (#2346)
* fix(cli): print the op_key of a failed write; stop claiming a re-run is safe (BUG-3999)

Each CLI invocation sends a new idempotency key, so re-running a command
after an unclear outcome is a new request. Failed writes that sent an
op_key (create, comment, update/note/decide, patch, undo, push, copy) now
wrap the error in cli.OpKeyError, and the root error writer prints the key
on stderr with the --op-key re-run hint. Chat is excluded (caller-owned
key). SKILL.md no longer says a re-run never applies a patch twice.

Claude-Session: https://claude.ai/code/session_01Pa22hHHb1atXYf1JmBYE1v

* fix(cli): read APIError through the op-key wrapper at every call site (BUG-3999)

A write that sent an op_key comes back wrapped in OpKeyError, which a direct
err.(*cli.APIError) assertion does not see through: pad item create lost its
plan-limit structured marker. Add cli.AsAPIError (errors.As) and use it at all
17 command-side sites. Add the plan-limit, --format json, decide and push tests.

Claude-Session: https://claude.ai/code/session_01Pa22hHHb1atXYf1JmBYE1v

* fix(cli): keep the op-key hint when create replaces a plan-limit refusal (BUG-3999)

Claude-Session: https://claude.ai/code/session_01Pa22hHHb1atXYf1JmBYE1v

* fix(skill): drop the false retry claim from the plugin's SKILL.md copy too (BUG-3999)

plugin/skills/pad/SKILL.md is maintained separately from the embedded
skills/pad/SKILL.md (it is not synced from it), and it still said a plain
re-run "never applies it twice". It now carries the same corrected text,
and the prose pin checks both files. Adds a test that a failed write which
sent no op_key prints no hint (r1 H1, H2).

Claude-Session: https://claude.ai/code/session_01Pa22hHHb1atXYf1JmBYE1v
2026-10-29 12:39:35 -04:00
..