Skip to content

fix(policy): keep a chat's send button a commit when only its history shows prices - #134

Merged
DIYgod merged 1 commit into
mainfrom
fix/chat-send-not-payment
Nov 15, 2026
Merged

DIYgod merged 1 commit into
mainfrom
fix/chat-send-not-payment

Conversation

@DIYgod

@DIYgod DIYgod commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Fixes #132

The bug

In Meituan's 小美 AI chat (com.meituan.android.beam), tapping 发送 asked as a payment ("Pay: “发送”?", rule Payments). 发送 is a commit, and detect makes any commit a Payment when screenHasCurrency finds an amount anywhere on the screen. The chat's history showed ¥ prices, so a harmless question needed a payment approval.

The exception

sendsChatMessage in internal/policy/detect.go. An amount in static text elsewhere on the screen no longer makes a tap a payment when all of these hold:

  • the button's label says only "send": one Latin word from Send / Enviar / Envoyer / Senden / Absenden / Invia / Inviare / Отправить, or a CJK label whose core is exactly 发送, 發送, 傳送, 送信, 보내기 or 전송. "Send money", "Send $20", "发送红包" and "确认发送" do not count;
  • the app is not in the finance or stores category (finance apps a task allowed through AllowBlocked included);
  • the screen has exactly one text field that is not a search box (the composer). It is not a password or code field, and it sits on the button's row: their vertical extents overlap, or are at most half the button's height apart;
  • no text field, search boxes included, has an amount in its label or text, or holds a number alone ("0.5", as a wallet's amount field does);
  • the button and the composer both have bounds.

The tap stays a Commit, so the person's rules for commits still apply (preset 1 still asks "Commits"). Nothing else changes: an amount in the button's own label, a label that moves money (commitParts money), a money icon, and installs keep their payment checks as before. Swipes (sliders) are unchanged.

What stays a payment (tested)

  • a wallet's send screen with the amount typed into a field (0.5 ETH), and one with a bare 0.5 in a field on the Send button's row
  • a wallet's confirmation page with no field ("0.5 ETH ≈ $1,500", Send)
  • a chat whose composer holds an amount (转你 ¥200)
  • "Send $20", "Send money", "发送红包" in a chat
  • a chat screen with two non-search fields, or a field far from the button, or no bounds
  • a finance app's chat (allowed for the task) with prices on screen

Tests that are now a commit, not a payment: the 小美 case, WeChat with prices in history (Chinese and English), and a chat with a search box at the top. They fail on main ("ask Payments") and pass here. make check passes.

DESIGN.md (payment kind) and SKILL.md (what waits for the person) mention the exception in one sentence each.

Limits

  • An icon-only send button (paper plane without a label) gets no exception and stays a payment on a screen with an amount.
  • An app that draws its own composer, so that no editable field shows up, gets no exception.
  • A chat whose composer is not on the send button's row (for example a text field with its send button well below it in a toolbar) gets no exception.

Suggested release notes

  • Tapping Send in a chat no longer asks as a payment just because the chat shows prices. It counts as a commit, so your rules for commits still apply.
  • 在聊天里点「发送」,不会再因为聊天记录里有价格就被当成付款来请你批准。它现在算作「提交」,你为「提交」设的规则照常生效。

🤖 Generated with Claude Code

… shows prices

Tapping "发送" in Meituan's 小美 chat asked as a payment ("Pay: “发送”?")
because any commit on a screen that shows an amount was a payment, and
the chat's history listed prices.

A button whose label says only "send" (Send, 发送, 發送, 傳送, 送信, 보내기,
전송 and the like) on the row of the screen's one text field (search
boxes aside) now stays a commit when the amount is only in static text.
It stays a payment when the amount is in its label or in any text
field, when a field holds a number alone, in a finance or store app,
without such a composer (a wallet's confirmation page), when there are
two fields, when bounds are missing, or when the label says more
("Send money", "发送红包").

Fixes #132

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DIYgod
DIYgod merged commit e548a14 into main Nov 15, 2026
3 checks passed
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.

Xiaomei AI chat Send button misclassified as Payments

1 participant