Files
hermes-agent/plugins/platforms/discord
kshitijk4poor aecf04f3d8 fix: an answered Discord approval whose click edit fails still retires its card
When a click records the answer but Discord rejects the interaction
edit, the view was stopped but the card kept its pending embed and
dead buttons. The settle observer skips cards whose click owns the
edit, because `_backend_settled` was already set.

Now a failed edit after a recorded answer clears `_backend_settled` and
retires the card through its message: buttons removed, "already
resolved" footer. The retire runs under the same lock as the
observer's, so only one of them edits. The edit error is still raised,
as before. A failed edit on a no-op click (nothing recorded) is
unchanged.

Tests:
- The edit-failure case of test_click_stops_view_even_if_interaction_edit_fails
  now asserts the card is retired.
- A new test fires the observer during the failing edit (the usual
  order, since the waiter wakes before Discord answers). The observer
  skips, and the click's own retire stamps the card.

Both fail on the previous commit. The new test also fails with only
the retire call removed.

Reported by Greptile on #145948.
2026-10-28 15:28:40 +05:30
..