feat(gateway): inline choice pickers for /reasoning and /fast (Telegram, Discord, Matrix) (#65799)

Bare /reasoning and /fast now render a native one-tap picker on
picker-capable platforms, with automatic fallback to the text status
card everywhere else — parity with the /model picker UX.

- gateway/slash_commands.py: generic send_choice_picker capability gate
  (detected on the adapter type, like send_model_picker); selection and
  typed arguments flow through one shared application path so they can
  never diverge; choices built from VALID_REASONING_EFFORTS so future
  levels appear automatically
- telegram: flat inline-keyboard picker (cp:<idx> callbacks), authorized
  users only (same gate as approval buttons)
- discord: ChoicePickerView select menu, auth mirrors ExecApprovalView,
  2-minute timeout with expiry edit
- matrix: reaction-based picker; reaction set extended to 12 slots to
  fit the full effort ladder + subcommands
- locales: picker_title + choice labels in all 16 languages
- docs: ADDING_A_PLATFORM.md capability table

Closes #61110.
This commit is contained in:
Teknium
2026-07-16 10:38:31 -07:00
committed by GitHub
parent 659d1123c4
commit bd37ff9138
22 changed files with 970 additions and 104 deletions
+8
View File
@@ -124,6 +124,9 @@ gateway:
label_normal: "NORMAL"
status_fast: "fast"
status_normal: "normal"
picker_title: "⚡ **Priority Processing**\\n\\n目前模式:`{mode}`\\n\\n請選擇:"
choice_fast: "fast — 開啟 Priority Processing"
choice_normal: "normal — 標準處理"
footer:
status: "📎 執行階段頁尾:**{state}**\n欄位:`{fields}`\n平台:`{platform}`"
@@ -194,6 +197,11 @@ gateway:
reset_global_unsupported: "⚠️ 不支援 `/reasoning reset --global`。請使用 `/reasoning <level> --global` 變更全域預設值。"
reset_done: "🧠 ✓ 已清除本工作階段的推理覆寫;回退至全域設定。"
unknown_arg: "⚠️ 未知參數:`{arg}`\n\n**有效級別:** none, minimal, low, medium, high, xhigh, max, ultra\n**顯示:** show, hide\n**持久化:** 加上 `--global` 可跨工作階段儲存"
picker_title: "🧠 **推理設定**\\n\\n**強度:** `{level}`\\n**範圍:** {scope}\\n**顯示:** {display}\\n\\n請選擇:"
choice_none: "none — 停用推理"
choice_reset: "reset — 清除工作階段覆寫"
choice_show: "在回覆中顯示推理"
choice_hide: "在回覆中隱藏推理"
set_global: "🧠 ✓ 推理強度已設定為 `{effort}`(已儲存到設定)\n_(下一則訊息生效)_"
set_global_save_failed: "🧠 ✓ 推理強度已設定為 `{effort}`(僅本工作階段 — 設定儲存失敗)\n_(下一則訊息生效)_"
set_session: "🧠 ✓ 推理強度已設定為 `{effort}`(僅本工作階段 — 加上 `--global` 可持久化)\n_(下一則訊息生效)_"