Repository navigation
fix(telegram): edited-caption history test fails on every changed-extensions run - #199169
Conversation
The edited-caption history case sent to topic 77 and then edited the message, but its provider responses carried message_thread_id without is_topic_message or chat.is_forum. Since openclaw#189231, an edit response shaped like that is classified as a non-forum reply chain and recorded as topicless, so the case failed on main. Mark the fixture as a forum topic message the way Telegram does, and add an edit-path guard that a non-forum reply-chain edit stays in unthreaded group history.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. What this changesThis PR adds forum-topic proof to the edited-caption fixture and checks that non-forum edits remain in unthreaded group history. Example: The caption-history test edits message 902 in topic 77 while later message 903 remains visible.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs an inconsistent Telegram test fixture without weakening its assertions or changing production behavior; no actionable findings remain, and exact-head CI is green. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTelegram edit responses pass through thread classification and the outbound context recorder into SQLite-backed history; these tests exercise that path using a real grammY client and a local HTTP fixture. flowchart LR
A[Test provider response] --> B[Local HTTP server]
B --> C[grammY edit client]
C --> D[Outbound context recorder]
D --> E[Thread classifier]
E --> F[SQLite message history]
F --> G[History assertions]
Technical reviewBest possible solution: Land the fixture correction and focused edit-path regression while preserving the existing production classifier and history assertions. Do we have a high-confidence way to reproduce the issue? Source inspection explains why the original edit response loses its topic binding; the author reports red/green and revert-control runs, which this read-only review did not rerun. Is this the best way to solve the issue? The smallest complete repair is to correct the forum fixture and protect the distinct edit-response boundary using the existing HTTP and SQLite setup, as this PR does. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bb905f76e55d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +21. Total +21 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 14, 2026, 3:29 PM ET / 20:29 UTC. |
…#199169) The edited-caption history case sent to topic 77 and then edited the message, but its provider responses carried message_thread_id without is_topic_message or chat.is_forum. Since openclaw#189231, an edit response shaped like that is classified as a non-forum reply chain and recorded as topicless, so the case failed on main. Mark the fixture as a forum topic message the way Telegram does, and add an edit-path guard that a non-forum reply-chain edit stays in unthreaded group history.
Related: #189231
What Problem This Solves
Fixes:
extensions/telegram/src/send.history.test.ts> "refreshes authoritative edited captions without hiding later group history" fails on every run on main, which turns any PR that triggers the changed-extensions shards red (for example #198489, which only touchesscripts/e2e, docs andpackage.json). Main's own CI does not run those shards, so main looks green.User Impact
No user-visible change. PRs that select the changed-extensions shards stop failing on this test.
Why This Change Was Made
The test was wrong; the product behavior is the one #189231 intended.
6274d9e (#189231) made
resolveTelegramProviderObservedThreadSpecreturn{ scope: "none" }when no topic was requested and a supergroup message hasmessage_thread_idwithout forum proof (is_topic_messageorchat.is_forum). That is how Telegram shapes a reply chain in a non-forum group. The PR names the edit path as a target: "This covers every outbound recorder, including the edit path".editMessageTelegramderives its thread from the edited message, so an edit response without forum proof is now recorded as an explicit topicless correction, and the message cache drops it from topic history by design (see "persists an explicit topicless correction" inmessage-cache.retained.test.ts).The failing case sends to topic 77 and then edits the message, but its fixture message had
message_thread_id: 77with no forum proof. Its edit response therefore had exactly the non-forum reply-chain shape #189231 fixed, so the edited message 902 left topic 77 history. Telegram marks messages in a forum topic withis_topic_message: true.Changes, all in
extensions/telegram/src/send.history.test.ts:is_topic_message: true. It still asserts the same contract: the edited caption replaces the body, the message keeps its topic-77 binding, and the later teammate message stays visible withhasMore: false.editMessageTelegram. The existing fix(telegram): bot replies in non-forum groups drop out of group history #189231 regression only calls the recorder directly with no thread. This case also checks that the fixture change does not hide that behavior.No product code changed.
Evidence
Head:
859770fce302c449b6da757e944e01a3ff36e0d3, on base210458b3d434db20073789863d9e493a54217358. Red was reproduced onda85264b9eab47c6e1aba4ddbd43e3e396d66344. The two main commits since then (#199098, #199138) touch no Telegram code.da85264b9ea):node scripts/run-vitest.mjs extensions/telegram/src/send.history.test.tsgives 1 failed / 28 passed, with the same assertion as CI job 132555493862 (expected 902 then 903, received only 903).provider-thread-proof.tshunk of 6274d9e on main makes the original test pass (29/29).send.history.test.tsgives 30/30 passed (rerun on859770fce30after the rebase).expected [] to match object [ { messageId: '902', … } ]), and the forum case still passes.outbound-message-context,message-cache,message-cache.retained,message-cache.conversation-context,send.telegram-http,send.caption-checkbox.telegram-http,send.literal-fallback.telegram-http,send.recovery.telegram-http,thread-spec,bot.create-telegram-bot.historyandaction-progress-edit.telegram-httpall pass.node scripts/check-changed.mjs(laneextensionTests:tsgo:extensions:test, oxlint, format, ratchets, dead-export scan): exit 0, with no type or lint errors.send.history.test.tsis still used. Temp state comes from the HTTP fixture's media dir, each case gets its own session store path, and mocks and the database are reset inafterEach. Nothing was pruned.Not run: live Telegram proof of forum-topic edit responses. The forum fixture uses the documented Bot API
is_topic_messagefield and was not observed against a live forum.