Repository navigation
fix(telegram): drop expired approval callbacks - #82455
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. The linked bug gives concrete Telegram polling steps, the PR body reports a current-main Crabbox reproduction, and current-main source shows approval-not-found failures enter the retry-preserving spool path. Real behavior proof Next step before merge Security Review detailsBest possible solution: Keep the fix scoped to Telegram callback error classification and use the landed result as the canonical resolution for #82347 and the duplicate PR #82388. Do we have a high-confidence way to reproduce the issue? Yes. The linked bug gives concrete Telegram polling steps, the PR body reports a current-main Crabbox reproduction, and current-main source shows approval-not-found failures enter the retry-preserving spool path. Is this the best way to solve the issue? Yes. Reusing the shared approval-not-found classifier inside the Telegram approval callback handler is the narrow maintainable fix, while generic resolver failures remain retryable and ambiguous target-only fallback buttons are preserved. Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against dccf5f684211. |
34ed6d0 to
d224d0e
Compare
d224d0e to
5bd6786
Compare
5bd6786 to
27af965
Compare
* fix(telegram): drop expired approval callbacks * changelog: credit expired Telegram callback fix
* fix(telegram): drop expired approval callbacks * changelog: credit expired Telegram callback fix
* fix(telegram): drop expired approval callbacks * changelog: credit expired Telegram callback fix
* fix(telegram): drop expired approval callbacks * changelog: credit expired Telegram callback fix
Summary
Fixes #82347.
unknown or expired approval iderrors as terminal instead of retryable so isolated polling removes the spooled update.Verification
node scripts/run-vitest.mjs extensions/telegram/src/bot.test.ts -t "drops target-only approval not-found misses without clearing legacy fallback buttons|drops expired approval callbacks for configured approvers after clearing buttons"node scripts/run-vitest.mjs extensions/telegram/src/bot.create-telegram-bot.test.ts -t "retries exec approval callbacks after a bubbled resolution failure"node scripts/run-vitest.mjs src/infra/approval-errors.test.tsgit diff --checkcodex review --uncommitted(final pass: no actionable bugs)run_0fc16a32632c, leasecbx_74628cb44ad1.run_50cde10f39b0, leasecbx_caf441a2b36d.Real behavior proof
Behavior addressed: Telegram isolated polling no longer retries an expired approval callback forever after Telegram returns an expired/invalid callback query and the gateway returns
unknown or expired approval id.Real environment tested: AWS Crabbox with real Telegram Bot API credentials leased from Convex using credential kind
telegram; gateway ran with Telegram polling enabled and a mock OpenAI-compatible provider.Exact steps or command run after this patch:
pnpm crabbox:run -- --idle-timeout 90m --ttl 180m --timing-json --env-from-profile /private/tmp/openclaw-82347-convex.local.env --allow-env OPENCLAW_QA_CONVEX_SITE_URL,OPENCLAW_QA_CONVEX_SECRET_CI --script .artifacts/qa-e2e/issue-82347/repro-telegram-expired-callback.mjsEvidence after fix: Crabbox run
run_50cde10f39b0seeded a stale approval callback update intotelegram/ingress-spool-default, observed the real TelegramanswerCallbackQuery400 and gatewayunknown or expired approval id, then confirmedbeforeRestart.spoolExists=false,beforeRestart.retryFailures=0,afterRestart.spoolExists=false, andafterRestart.retryFailures=0.Observed result after fix: The stale callback was consumed once, did not reappear after gateway restart, and a later normal Telegram message received a bot reply (
postStormMessage.replyFound=true).What was not tested: A real human Telegram Desktop button press was not used because no
telegram-usercredentials were available; the live proof used bot credentials plus a seeded stale callback update to exercise the same Telegram Bot API, gateway resolver, and isolated polling spool path.