Repository navigation
fix(telegram): finalize streamed questions in place - #126248
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 10:01 PM ET / August 20, 2026, 02:01 UTC. ClawSweeper reviewWhat this changesThe PR finalizes streamed Telegram ask-user prompts on their existing message, registers that concrete message with the question gateway, and turns failed control attachment into a terminal partial-delivery outcome to prevent duplicate fallback messages. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open. The prior P1 is addressed at the exact head, but the stated evidence remains mock-only while the scoped Telegram policy requires real Telegram proof for streaming/callback behavior; exact-head CI is also still incomplete. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTelegram’s dispatcher streams a visible preview, attaches interactive controls, and registers ask-user messages with the shared question gateway. When a question resolves, the gateway calls the channel finalizer to remove controls and annotate that same Telegram message. flowchart LR
A[Agent asks a question] --> B[Reply dispatcher]
B --> C[Telegram preview message]
C --> D[Attach controls and register question]
D --> E{Controls attached?}
E -->|Yes| F[Question gateway finalizes in place]
E -->|No| G[Terminal partial-delivery outcome]
G --> H[No fallback duplicate]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +153, Tests +195. Total +348 across 19 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA Telegram Desktop proof would directly show the changed in-place prompt, controls, and terminal state while avoiding disclosure of credentials or private chat content. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Capture a redacted real Telegram run that shows one streamed ask-user message becoming terminal in place, including the controlled edit-failure path with no fallback message, then land only after the exact-head checks are green. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is supplied; the focused tests source-reproduce the injected control-edit failure, but do not exercise a real Telegram transport. Is this the best way to solve the issue? Unclear. The exact head centralizes both Telegram finalization callers and fixes the prior propagation gap, but a current-main comparison and real Telegram fault proof remain unavailable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19316660e418. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
HistoryReview history (5 earlier review cycles)
|
bd06ce9 to
8fb7526
Compare
d88d887 to
86ff4b6
Compare
8fb7526 to
032d6ce
Compare
86ff4b6 to
2c5a610
Compare
c042765 to
03bb33c
Compare
|
Addressed the exact-head P1 in 7e5a59b. Pre-rotation materialization now uses the same canonical finalized-preview handler as ordinary reply delivery: it emits one terminal hook, marks the visible delivery final, and throws a merged partial-delivery error carrying the preview receipt, content, and platform message IDs. Because rotation awaits this handler, a failed control edit cannot rotate the lane or trigger a duplicate fallback. Successful rotation and final/media preview behavior keep the existing path. Regression proof covers a queued Validation:
The optional deterministic real-adapter failpoint proof was not staged: current Crabline accepts valid Telegram edits and has no edit-failure injection surface, so an exact run needs a temporary proxy, mock fixture, and scenario. The focused dispatcher regression is the authoritative proof for the internal partial-delivery contract. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* fix(telegram): finalize streamed questions in place * test(telegram): align partial question delivery coverage * fix(telegram): propagate partial question finalization * test(telegram): assert typed partial delivery error
What Problem This Solves
Fixes an issue where streamed Telegram ask_user prompts could bypass question registration, report button attachment failure as success, or generate a duplicate fallback after a visible partial delivery.
Why This Change Was Made
Register the concrete preview message, share control-first bounded finalization with durable delivery, and treat visible-but-unusable prompts as terminal delivery failures while preserving answer races.
User Impact
Telegram questions finalize on the same message, clear buttons when answered, and cancel cleanly without duplicate output when controls fail.
Evidence
node scripts/check-changed.mjs,pnpm build, and autoreview passed.