Skip to content

[Bug]: Telegram ask_user 卡片按钮永远提示 "This question has expired."(fence 守卫挡住 channel 侧 AdvanceInteraction) #1154

Description

@qqqqqf-q

Bug Description

Telegram 的 ask_user 卡片按钮(单选/多选/Other…/Skip/Submit,即 aui~ wizard 回调)全部不可用:点任何按钮都弹「This question has expired.」。这是潜伏 bug,与问题是否真的过期无关——卡片刚渲染出来、问题仍处于 pending 时按钮就是死的。

根因是 runtime fence 守卫与 wizard 解析路径的契约错位:

  1. turn 创建 ask_user 时 CreatePending 会把 run 的 runtime fence 打到 user_input_requests.runtime_fencing_token(internal/agent/decision/input/service.go:164)。
  2. Telegram 按钮回调走 channel 进程内 DB 直连的 AdvanceInteraction(ctx 无 fence,internal/channel/adapters/telegram/telegram.go:737cmd/internal/channel/providers.go:125-131)。
  3. GetRespondableUserInputRequest 的 NULL-token 分支要求 runtime_fencing_token IS NULL(db/postgres/queries/user_input.sql)。带 fence 的行对 unfenced 查询永远不可见 → ErrNotFoundHandled=false → 弹 expired(telegram.go:749-752)。

时间线:wizard 建于 #817(2026-07-16);次日 #800(07-17)给 GetRespondableUserInputRequest 加 fence 守卫并让 CreatePending 打 token;#865(07-28)/#960(08-06)使 durable runtime + decision parking 成为默认后,所有 turn 创建的 ask_user 行都是 fenced,该路径自此全灭。web 不受影响:web 作答走 WS user_input_responseRouteDecisionResponseDecisionContinuationContext 携带 fence(internal/handlers/local_channel.go:1856-1920),所以此前 QA 没有暴露。

Steps to Reproduce

  1. bot 接 Telegram,触发 ask_user 产生带按钮的卡片。
  2. 立即点任意按钮(单选选项 / Other… / Skip)。
  3. 弹窗提示 This question has expired.,卡片无法作答。

Error Messages / Logs

# Telegram 弹窗
This question has expired.

# 无服务端报错日志:AdvanceInteraction 对查不到的行返回 Handled=false,属静默路径

Version

main(2026-09-03;#800 之后所有版本)

Channel

Telegram

Additional Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions