Skip to content

feat: reject feedback prompt (60s window) + timeout UX cleanup#1

Closed
wangyuyan-agent wants to merge 1 commit intoantx-code:mainfrom
wangyuyan-agent:feat/reject-feedback-and-timeout-ux
Closed

feat: reject feedback prompt (60s window) + timeout UX cleanup#1
wangyuyan-agent wants to merge 1 commit intoantx-code:mainfrom
wangyuyan-agent:feat/reject-feedback-and-timeout-ux

Conversation

@wangyuyan-agent
Copy link
Copy Markdown

Summary

Two UX improvements for the Telegram provider:

1. Reject feedback prompt (60-second window)

After clicking Reject, the bot now sends a follow-up message:

Rejected. Reply to this message within 60 seconds to add a reason (or ignore to skip).

  • If the user replies within 60 s → feedback is captured in the JSON output ("feedback": "<reason>")
  • If no reply arrives → exits normally with "feedback": null
  • No change to exit codes; Reject is still exit code 1

This fills the pre-existing feedback field that was always null for rejected requests.

2. Timeout UX cleanup

Previously, when a request timed out the inline keyboard stayed on the original message with no indication that the request had expired.

Now on timeout:

  • The inline keyboard is removed from the original message (editMessageReplyMarkup)
  • A localised notice is sent: ⏰ Request timed out — no response received.
  • Exit code 2 is unchanged

Localisation

New strings added for en, zh-CN, and zh-TW:

  • reject_feedback_prompt
  • reject_feedback_callback
  • timeout_notice

Testing

cargo build  # passes with zero warnings

Manual flow:

  1. openfeedback send --title "Test" --body "body" → click Reject → reply with reason → JSON shows "feedback": "your reason"
  2. Same but ignore the follow-up → JSON shows "feedback": null
  3. Let a short-timeout request expire → buttons removed, timeout notice appears

- After Reject, bot sends a follow-up message prompting for an optional
  reason. User has 60 seconds to reply; if they do, the feedback is
  captured in the JSON output under the existing 'feedback' field.
  If no reply arrives within 60s, the request exits cleanly with
  feedback: null.

- On timeout, the inline keyboard is now removed from the original
  message and a localised '⏰ Request timed out' notice is sent,
  so users aren't left with stale Approve/Reject buttons.

- New i18n strings added for all three locales (en, zh-CN, zh-TW):
  reject_feedback_prompt, reject_feedback_callback, timeout_notice.
@antx-code
Copy link
Copy Markdown
Owner

Thanks for the PR! Both ideas are solid:

  1. Reject feedback prompt — great call, filling the feedback field on reject is exactly what agents need
  2. Timeout cleanup — removing stale buttons + sending a notice is the right UX

We're going to implement these ourselves with a few adjustments:

  • Make the feedback wait window configurable (not hardcoded 60s)
  • Have the follow-up message be a reply_to the original request, so the user replies to the correct message
  • Keep the \u{xxxx} style for emoji consistency

Closing in favor of our own implementation. Thanks again for the contribution and the clean code — it made the review easy. 🙏

@antx-code antx-code closed this Mar 9, 2026
antx-code pushed a commit that referenced this pull request Mar 9, 2026
Inspired by PR #1 (thanks @wangyuyan-agent).

- After reject, send follow-up asking for reason; accept any text
  message from trusted user within configurable window (default 60s)
- On timeout, remove stale inline keyboard + send timeout notice
- New config: reject_feedback_timeout (seconds, 0 to skip)
- New i18n strings: reject_feedback_prompt, timeout_notice
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.

2 participants