Repository navigation
fix(telegram): prevent durable ingress lane spins - #118357
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 9:53 PM ET / August 3, 2026, 01:53 UTC. ClawSweeper reviewWhat this changesThe PR prevents Telegram durable-ingress replay from repeatedly reclaiming a pre-identity control command whose later derived lane is busy, while preserving stored-lane integrity for unrelated mismatches. Merge readinessKeep this maintainer-owned PR open for normal merge review. The patch addresses a source-supported Telegram durable-ingress spin at the intended owner boundaries: the shared drain bounds one pass to one attempt per snapshot row, while Telegram retains only its tightly validated lane exception. No discrete correctness or security defect was found in the proposed patch; active current-head CI still needs to finish. Priority: P1 Review scores
Verification
How this fits togetherTelegram polling first persists updates in the shared durable ingress queue, then a core drain claims and serializes them by lane before Telegram dispatches the update. Telegram owns how a stored lane may be reconciled once bot identity becomes available; the core drain owns bounded scheduling and claim lifecycle. flowchart LR
A[Telegram polling update] --> B[Durable ingress queue]
B --> C[Core ingress drain]
C --> D[Telegram lane policy]
D --> E[Claimed update dispatch]
E --> F[Polling progress and shutdown]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +49, Tests +49, Docs +1. Total +99 across 7 files. View PR surface stats
Review metrics
Mantis proof suggestionA proof-only Telegram transcript would directly demonstrate that a startup-time targeted control command drains without repeated replay and that polling remains responsive. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Merge the focused core scheduling bound and Telegram-specific reconciliation rule after current-head CI completes green; retain the existing fail-closed behavior for all lane changes outside the validated Telegram cases. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the candidate snapshot is reused after a released claim while lane resolution can change after bot identity is available; the PR adds a focused regression for that scheduling pattern. This read-only review did not execute the reproduction. Is this the best way to solve the issue? Yes. The best fix is to bound generic drain attempts in the shared owner while keeping Telegram’s exceptional stored-lane rule inside the Telegram plugin; a generic lane-bypass or Telegram-private claim loop would be a worse boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f2af4e97b356. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: refactor(agents): centralize terminal lifecycle outcomes (#118254) fix(scripts): warm gateway concurrency probes (#118364) test(discord): consolidate activity HTTP fixtures (#118314) fix(qa): restore prerelease validation (#118255) improve(tests): focus overflow compaction owner coverage (#118351) test(telegram): deduplicate dispatch fixtures (#118319) test(xai): consolidate realtime voice fixtures (#118318) fix(telegram): prevent durable ingress lane spins (#118357)
* fix(channels): prevent ingress lane reconciliation spins * fix(ui): restore composer lint budget
Related: #117861
What Problem This Solves
Fixes an issue where Telegram polling could stop making progress when a durable command was admitted before bot identity was available and replay later classified it into a different lane. The drain repeatedly reclaimed and released the same row, spinning SQLite and preventing polling shutdown.
Why This Change Was Made
The shared drain now applies the channel owner's stored-lane reconciliation policy consistently and attempts each row from a pending snapshot at most once per pass. Telegram preserves only the exact pre-identity control lane that the same payload derived before
getMe(), so unrelated persisted-lane mismatches still fail closed.This is the owner-boundary fix: generic drain scheduling owns bounded claim attempts, while Telegram owns the narrow pre/post-identity lane rule.
Current
mainwas also red oncheck-lintafter PR #116104 pushedchat-composer.tsover its max-lines budget. This PR carries the smallest behavior-neutral repair required by landing policy: the new mobile pointer-focus DOM policy now lives in the existing composer DOM helper.User Impact
Telegram polling continues through durable control commands that arrive during startup, and shutdown no longer hangs on a tight ingress replay loop. Existing webhook lane-integrity checks remain enforced. The UI repair does not change pointer behavior.
Evidence
main:/stop@other_botadmitted before bot identity was repeatedly claimed and released while an active topic turn occupied the post-identity lane.f2af4e97b356570dd0cadf66127b1449a0f8c085:pnpm check:changedpassed all selected core, extension, docs, typecheck, lint, boundary, schema, and import-cycle lanes: https://github.com/openclaw/openclaw/actions/runs/30776861324bc93ba8c72770104af96f62f9709abe2d47e990fpassed all 73 terminal jobs with zero failures, includingcheck-lint, UI unit tests, four UI E2E shards, QA smoke, build artifacts, channel contracts, and compact Node shards: https://github.com/openclaw/openclaw/actions/runs/30777738575oxlint,oxfmt, andgit diff --checkpassed.scripts/pr prepare-run 118357passed and stamped the exact hosted head.AI-assisted: yes. I reviewed the implementation, root cause, owner boundaries, red-main repair, and proof directly.