Skip to content

fix(addie): surface did_you_mean in billing tools for non-canonical lookup_key aliases#3353

Draft
bokelley wants to merge 1 commit intomainfrom
claude/issue-2550-billing-did-you-mean
Draft

fix(addie): surface did_you_mean in billing tools for non-canonical lookup_key aliases#3353
bokelley wants to merge 1 commit intomainfrom
claude/issue-2550-billing-did-you-mean

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Apr 27, 2026

Closes #2550

Summary

  • getPriceByLookupKey now returns { priceId, canonicalKey } instead of string | null, so alias resolution is a single call and callers learn the canonical key automatically
  • create_payment_link, send_invoice, and confirm_send_invoice include did_you_mean: canonicalKey in their response when the LLM passed a non-canonical alias (e.g. explorer_annualaao_membership_explorer_50), so the model corrects itself on subsequent calls
  • Tool descriptions tightened with explicit prohibition on constructing lookup_key from tier name + billing interval; lookup_key field description simplified to "do not construct or guess this value"
  • getPriceByLookupKey moved inside try/catch with early-return on null — previously a Stripe network error would propagate as an unhandled rejection instead of a { success: false } response
  • Removed now-unnecessary getBillingProducts and resolveLookupKeyAlias imports from billing-tools.ts (alias resolution is handled inside getPriceByLookupKey)
  • CODE_VERSION bumped to 2026.04.6

Non-breaking: adds an optional did_you_mean field to existing success-response JSON; no fields renamed or removed; existing callers unaffected.

Test plan

  • create_payment_link with alias key (e.g. explorer_annual) → response includes did_you_mean: "aao_membership_explorer_50"
  • create_payment_link with canonical key → no did_you_mean field in response
  • create_payment_link with unknown key → { success: false, error: "No product matches..." }
  • Same three cases for send_invoice and confirm_send_invoice
  • Stripe network error during getPriceByLookupKey{ success: false } (not unhandled rejection)

Triage-managed PR. To iterate: push fixup commits directly to this branch, or comment /triage execute on issue #2550 to re-trigger.

https://claude.ai/code/session_01HULrqPhn8kLM76nSmcpj4d

@bokelley bokelley added the claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage. label Apr 27, 2026
…ookup_key aliases

When the LLM passes an aliased lookup_key (e.g. explorer_annual instead of
aao_membership_explorer_50), create_payment_link/send_invoice/confirm_send_invoice
now include did_you_mean: canonicalKey in the JSON response so the model learns
the canonical key for subsequent calls in the same conversation.

Also tightens the three tool descriptions to explicitly forbid constructing the
key from tier name and billing interval. Bumps CODE_VERSION to 2026.04.6.

Closes #2550

https://claude.ai/code/cse_01HULrqPhn8kLM76nSmcpj4d
@bokelley bokelley force-pushed the claude/issue-2550-billing-did-you-mean branch from aad8856 to 22cf57b Compare April 27, 2026 11:36
@bokelley bokelley changed the title feat(addie): surface canonical_lookup_key in billing tools; tighten lookup_key descriptions fix(addie): surface did_you_mean in billing tools for non-canonical lookup_key aliases Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addie billing tools: surface did_you_mean in tool response + tighten lookup_key tool descriptions

2 participants