Skip to content

apple_reply_review: preview first, send only with the preview's confirm_token - #13

Open
FidelisMM wants to merge 3 commits into
mainfrom
reply-review-confirm
Open

FidelisMM wants to merge 3 commits into
mainfrom
reply-review-confirm

Conversation

@FidelisMM

@FidelisMM FidelisMM commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Closes #12

What

  • apple_reply_review is now two-step. The first call (no confirm_token) runs every check (empty text, 4000-character limit, attachments exist, HEVC → H.264 conversion, an open UNRESOLVED_ISSUES submission) and returns a preview plus a confirm_token without sending. The token is a hash of the app, the submission, the exact text and each attachment's bytes. The second call sends only if the token matches, so if the draft, an attachment or the submission changed since the preview, nothing goes out. A token sends once, so two confirms in a row don't double-post. It's released for a retry only when apple_review.reply raises ReplyNotSent, meaning the harness never printed its post-click marker. Timeouts, logouts and anything after the click keep it burned, and the error tells the agent to check apple_review_messages first.
  • MCP annotations on external actions. _register_tool adds ToolAnnotations(readOnlyHint=False, destructiveHint=True, openWorldHint=True) to every tool whose docstring says "External action". That's the convention CONTRIBUTING already asks for, so it stays in sync without a second list. That covers 27 tools today, including apple_submit_for_review, play_promote_release, play_submit_for_review and eas_submit. Tools without that phrase are left unannotated, so none of them is wrongly marked read-only.
  • README and CHANGELOG updated.

Why

Suggested on r/mcp: the App Review reply goes to a real person at Apple and can't be edited or taken back. Until now the only guard was the description text.

Tests

tests/test_reply_review.py: preview doesn't send; matching token sends; changed text / attachment / submission are rejected; two confirms in a row send once; failure before the click allows a retry and failure after it doesn't; reply() classifies script errors, timeouts and other errors conservatively; validation runs before the preview; annotations land on external-action tools but not on read tools. CI checks pass locally (ruff, unittest, compile, 60 tools).

Notes / follow-ups

  • Used tokens live in memory, so a server restart forgets them. That's fine for the double-confirm case, which happens inside one session.
  • On the confirm call, attachments are converted again (same input, same output). That's fine for one video, and caching the conversion can come later.
  • Hash-bound confirm suggested by u/QuanTradin.
  • A few tools change store state but don't say "External action" yet (apple_update_listing, apple_attach_build, apple_create_version, eas_build_start…). Adding the phrase to their docstrings would also annotate them. I left that for a separate PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SLMNEsRnY7MTSn1KDauZzf


Generated by Claude Code

claude added 2 commits October 1, 2026 21:51
The reply reaches a person at Apple and cannot be taken back, so the
default call now validates and returns a preview; it only sends on a
second call with confirm=True. Tools whose docstring says "External
action" also get MCP annotations (destructiveHint, openWorldHint).

Closes #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLMNEsRnY7MTSn1KDauZzf
The confirm call now carries the token returned by the preview: a hash
of the app, the rejected submission, the exact text and each
attachment's bytes. If anything changed since the preview, nothing is
sent. A token sends once, so two confirms in a row don't double-post;
it is released only when the failure happened before the click.

Suggested by u/QuanTradin on r/mcp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLMNEsRnY7MTSn1KDauZzf
@FidelisMM FidelisMM changed the title apple_reply_review: preview first, send only with confirm=True apple_reply_review: preview first, send only with the preview's confirm_token Oct 2, 2026
apple_review.reply now raises ReplyNotSent only when the failure provably
happened before the Reply click (the harness prints a marker right after
clicking). Timeouts, logouts and anything after the click keep the token
burned, and the error tells the agent to check apple_review_messages
before sending again. Attachments are converted before the token is
burned, so a conversion failure doesn't block a retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLMNEsRnY7MTSn1KDauZzf

This branch has not been deployed

No deployments
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.

apple_reply_review: preview + explicit confirm before sending to App Review

2 participants