Skip to content

fix(skills): re-call partner_generate on a bounce only for the same product and shape - #50

Merged
mattmillerai merged 2 commits into
mainfrom
fix/partner-bounce-recall-gates
Nov 11, 2026
Merged

mattmillerai merged 2 commits into
mainfrom
fix/partner-bounce-recall-gates

Conversation

@mattmillerai

@mattmillerai mattmillerai commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

ELI5

When an agent guesses the wrong name for a paid AI model, the service replies with a close match, and the agent was told to retry with it. That retry can quietly charge the user for a different kind of output than they asked for, like a text-only video when they gave a reference image, or sound effects when they wanted speech. This change tells the agent to retry only when the suggestion is really the same thing, to use the recommended template when the service names one, and to ask when several priced options are listed.

What

Rewrites the guess-and-bounce re-call sentence in the generate-audio/image/video slash commands (claude-code/commands/) and their legacy copies (skills/) so a partner_generate re-call now requires all of these:

  1. A named template wins. If the bounce names a run_template ("served by the bundled template … Do not retry this slug"), run that template and don't re-call.
  2. Same provider prefix AND same product/shape. A -t2v suggestion is not a retry for an -i2v/-r2v/-flf2v request, and a sound-effects slug is not a retry for speech. In those cases use the family's own api_* template (found with search_templates), or ask.
  3. Several slugs or several params.model tiers. Pick the one that matches the request. If none clearly does, ask (tiers are priced differently).
  4. Tier-shaped guesses go in as params: {"model": "<tier>"} on the named slug. Say which slug or tier you switched to.

The sentences that follow it are unchanged: the "bounces twice → unknown model" rule, the "ranked by token overlap … stop and ask" rule, and the submit_batch "resend only the bounced item" rule.

The MiniMax/Hailuo note in skills/comfy-generate-video.md now re-calls the suggested minimax/hailuo-03-t2v only for a text-to-video request. For r2v/flf2v it points to run_template with api_minimax_h3_r2v / api_minimax_h3_flf2v.

This ports the two narrower clauses the MCP server's own routing instructions already carry ("unless the bounce names a run_template for the product", "several tiers listed → pick the one matching the user's request, or ask"). Prose only; no server change.

Why the wording is true

These are server bounce replies observed with an in-process probe of the server's unknown-model message builder:

  • minimax/hailuo-03-r2v / -flf2v / -i2v → Did you mean: minimax/hailuo-03-t2v? (same provider, different shape).
  • kling/kling-v3-i2v → Did you mean: kling/kling-v3-t2v, kling/kling-3.0-turbo-t2v?
  • elevenlabs/eleven_v3 → Did you mean: elevenlabs/sound-generation? (speech → sound effects).
  • elevenlabs/text-to-speech → names run_template({ name: "api_elevenlabs_text_to_speech" }) plus "Do not retry this slug".
  • xai/grok-imagine-image-quality / vertexai/nano-banana → several slugs and/or a tier menu.

I checked the quoted phrases ("is served by the bundled template", "Do not retry this slug", "Did you mean:") against the server source on its current main. All three api_* template ids above are in the server's bundled template catalog.

Testing

  • Ticket checks: every one of the six files contains the new clause. diff of skills line 5 against commands line 9 is empty for audio and image. git diff --stat shows one changed line per file, and two in skills/comfy-generate-video.md (the Step 0 line plus the MiniMax bullet).
  • claude plugin validate ./claude-code: passed.
  • Doc-drift sweep: 23 references checked, 0 updated. All 23 are generic README/AGENTS mentions of the commands and search tools; none describes the bounce rule. A repo-wide grep for the old phrases (provider prefix, still a `minimax/` ) outside the edited files finds nothing.

Judgment calls

  • Video lines 7 vs 11 were already not byte-identical on main. The legacy skills/comfy-generate-video.md Step 0 bullet uses different surrounding prose ("so guessing costs one call — re-call once with the named slug …"). I swapped in the same new clause in both files, kept the surrounding text, and did not force the two lines into alignment. Aligning them would rewrite unrelated legacy prose. The new clause is byte-identical in all six files.
  • The MiniMax bullet exists only in the legacy skills/ copy. claude-code/commands/generate-video.md has no "re-call with that slug if it is still a minimax/ one" sentence (its MiniMax notes are structured differently), so there was nothing to patch there.
  • Kept the parenthetical about the bare slug running "the entry's default tier at a different price", because it explains why the tier goes in params.model.

Provenance

  • Authored by: agent-work loop
  • Verified:
  • Deviations:
    • Video legacy line and command line still differ (they already did on main; see Judgment calls)
    • The MiniMax bullet edit applies only to skills/, because the commands file has no equivalent sentence

Residual

…roduct and shape

Run a run_template the bounce names instead of re-calling, skip a
same-provider suggestion that changes the product or shape (t2v for
i2v/r2v/flf2v, sound effects for speech), and ask when the bounce lists
several slugs or tiers with no clear match. Ports the narrower clauses
the server's own routing bullet already carries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmillerai mattmillerai added cursor-review Request the Cursor multi-model review matrix agent-coded Implemented by the agent-work loop labels Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Partner-model retry instructions for audio, image, and video now check provider, product, and output shape before retrying. They direct ambiguous suggestions or mismatches to a template or user question, and clarify tier handling and video task types.

Changes: Partner model bounce routing

Layer / File(s) Summary
Retry and template rules
claude-code/commands/generate-audio.md, claude-code/commands/generate-image.md, claude-code/commands/generate-video.md, skills/comfy-generate-audio.md, skills/comfy-generate-image.md, skills/comfy-generate-video.md
Retries now require a matching provider, product, and output shape. Ambiguous suggestions lead to a user question; mismatches can route to a named or family-specific template. Tier-shaped retries pass the tier through params.model. Video instructions distinguish text-to-video from other input shapes and limit retries after a bounce.

Possibly related PRs

  • Comfy-Org/comfy-skills#19: Introduced same-provider bounce retry rules in the command and skill files that this change further constrains.
  • Comfy-Org/comfy-skills#46: Added partner-generation routing in other skill paths with related provider-preserving retries and params.model tiers.

Suggested reviewers: vqt123

Merge Risk: Minimal · up to 41289

This PR narrows partner-model retry guidance in the audio, image, and video instructions. It has no code-level risk. Agents are told to ask when no suggested slug or tier clearly matches the request, so it is safe to merge after normal checks.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 15969e8e-8c86-4898-9111-2692f97f1224
Commits

Reviewing files that changed from the base of the PR and between 9e03dd1 and 4128978.

Files selected for processing: 6

  • claude-code/commands/generate-audio.md
  • claude-code/commands/generate-image.md
  • claude-code/commands/generate-video.md
  • skills/comfy-generate-audio.md
  • skills/comfy-generate-image.md
  • skills/comfy-generate-video.md

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot requested a review from vqt123 November 11, 2026 04:52
@vqt123

vqt123 commented Nov 11, 2026

Copy link
Copy Markdown

Starting review at 4128978.

@vqt123

vqt123 commented Nov 11, 2026 •

Copy link
Copy Markdown

Approving at 4128978. Checked: read the six command changes against the base, the server's template redirects and tier guidance, and the bundled template names; nothing run.

~82k effective tokens for this review (229k raw; cache reads weighted 0.1x, cache writes 1.25-2x)

@mattmillerai
mattmillerai merged commit 93d2042 into main Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Implemented by the agent-work loop cursor-review Request the Cursor multi-model review matrix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants