Repository navigation
feat(qa): drive forwarded text+photo bursts in Telegram userbot scenarios - #162906
Conversation
…rios Add a forwardBurst scenario action to the Telegram Test Server userbot harness. The SUT bot posts a text and a photo into the QA user's DM through the direct Test Bot API, the recorder correlates both source messages from its own TDLib ingestion, and the QA user forwards both back with one TDLib forwardMessages call (TDLib 1.8.67 schema). The action row records the forwarded and source message ids; a receipt without forward_info fails the action because the SUT forward lane would not engage. The runner rejects forwardBurst without --dm before leasing. The source is bot-authored because a live run showed Telegram strips the forward origin when a user forwards their own Saved Messages posts: both forwards arrived with forward_info null and the Gateway handled them as plain messages. The local Test Bot API proxy timing log gains doneAt on every row, log-only file-download rows without paths, and count-only rows for nonempty getUpdates responses, so a run can show getFile/download latency and whether burst members reached the Gateway in one long-poll response. The Gateway itself logs no getFile/download timing. Live proof (Test Server, --source-gateway --dm, mock provider): on current main the burst produced two agent-turn provider requests (text-only, then photo-only) and two replies; getFile+download measured 571+175 ms. Telegram delivered the two forwards in separate getUpdates responses 208 ms apart. Tests: user-driver 37, user-record 13, scenario/proxy/runner/scenario-run 65 passing. telegram-run-composition is load-sensitive on the unchanged harness too (different cases fail per run at load ~40 on the host).
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 3:20 PM ET / 19:20 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR adds forwarded text-and-photo scenarios to the Telegram QA userbot, records transport timing and update counts, and fixes CI routing for the skill’s tests. Merge readiness✅ Ready for maintainer review This remains useful, distinct QA work: current main lacks the forwarded-burst scenario, and the live evidence demonstrates the harness while identifying a separate product batching gap. No blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Telegram QA harness drives a leased test user and bot through Telegram’s Test Server into an isolated OpenClaw Gateway. Its recorder and API proxy produce evidence about messages, agent turns, and transport timing. flowchart TD
A[QA scenario] --> B[Validate direct chat]
B --> C[Bot posts source text and photo]
C --> D[Test user forwards both messages]
D --> E[Telegram Test Server]
E --> F[Gateway and mock provider]
E --> G[Message and transport evidence]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +223, Docs +4, Other +414. Total +641 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep forwarding and timing measurement in the existing QA harness, and use its evidence to guide the separate Telegram batching repair. Do we have a high-confidence way to reproduce the issue? Not applicable to the harness enhancement itself; the captured live runs provide a concrete forwarding scenario and measurements of the separate product batching failure. Is this the best way to solve the issue? Yes. Extending the existing userbot and proxy owners provides the missing real-transport measurement path, and reusing the CI routing predicate avoids competing selection rules. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 32dc6c861d3e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
bbb074a made aggressive PR Node selection add every changed path matching isTestFileTarget as a direct target. A PR that changed node:test files under .agents/skills/telegram-e2e-userbot/scripts/ then handed them to the Vitest unit config, which exited 1 with "No test files found" and failed checks-node-changed and openclaw/ci-gate. Aggressive mode now applies the same isRoutableChangedTarget predicate that default mode already uses for direct changed-test selection. Across all 18,695 tracked test files, this drops only non-Vitest files from direct selection: 16 skill node:test files (still run once by their Vitest owner test/scripts/telegram-e2e-userbot-skill.test.ts), 4 CodeQL fixtures, and 140 credentialed .live.test.ts files that default mode already excluded. The regression test fails without the fix (it selects the skill file) and passes with it; all 37 ci-changed-node-test-plan selection/integration/dependency-input tests pass.
|
Merged via squash.
|
* origin/main: fix(gateway): report approved-but-narrowed scope upgrades truthfully (#162951) fix: allow session-scoped shared publication reads (#162984) refactor(sessions): share session creation orchestration (#161336) perf(gateway): show the first chat sooner after a Gateway start (#162936) refactor(scripts): share npm verification command execution (#162978) fix(browser): clear MCP runtime cache after profile tests (#162982) fix(test): checkout fixture tests fail healthy runs on loaded macOS hosts (#162888) ci: bound PR extension lint to direct owners and smoke packages fix(ci): await native declaration discovery teardown feat(qa): drive forwarded text+photo bursts in Telegram userbot scenarios (#162906) build(macos): pin the app runtime to OpenClaw Bun 17c9ecf9eb (#162570) fix(test): frozen admission test fails with spawn ETXTBSY when a sibling test forks during the native parser copy (#162969) fix(ci): give direct published-driver callers the CI cell envelope (#162837) test(gateway): remove low-value tests (batch d136) (#162921)
…rios (openclaw#162906) * feat(qa): drive forwarded text+photo bursts in Telegram userbot scenarios Add a forwardBurst scenario action to the Telegram Test Server userbot harness. The SUT bot posts a text and a photo into the QA user's DM through the direct Test Bot API, the recorder correlates both source messages from its own TDLib ingestion, and the QA user forwards both back with one TDLib forwardMessages call (TDLib 1.8.67 schema). The action row records the forwarded and source message ids; a receipt without forward_info fails the action because the SUT forward lane would not engage. The runner rejects forwardBurst without --dm before leasing. The source is bot-authored because a live run showed Telegram strips the forward origin when a user forwards their own Saved Messages posts: both forwards arrived with forward_info null and the Gateway handled them as plain messages. The local Test Bot API proxy timing log gains doneAt on every row, log-only file-download rows without paths, and count-only rows for nonempty getUpdates responses, so a run can show getFile/download latency and whether burst members reached the Gateway in one long-poll response. The Gateway itself logs no getFile/download timing. Live proof (Test Server, --source-gateway --dm, mock provider): on current main the burst produced two agent-turn provider requests (text-only, then photo-only) and two replies; getFile+download measured 571+175 ms. Telegram delivered the two forwards in separate getUpdates responses 208 ms apart. Tests: user-driver 37, user-record 13, scenario/proxy/runner/scenario-run 65 passing. telegram-run-composition is load-sensitive on the unchanged harness too (different cases fail per run at load ~40 on the host). * fix(ci): PR checks fail when a change touches skill node:test files 15e7fc0 made aggressive PR Node selection add every changed path matching isTestFileTarget as a direct target. A PR that changed node:test files under .agents/skills/telegram-e2e-userbot/scripts/ then handed them to the Vitest unit config, which exited 1 with "No test files found" and failed checks-node-changed and openclaw/ci-gate. Aggressive mode now applies the same isRoutableChangedTarget predicate that default mode already uses for direct changed-test selection. Across all 18,695 tracked test files, this drops only non-Vitest files from direct selection: 16 skill node:test files (still run once by their Vitest owner test/scripts/telegram-e2e-userbot-skill.test.ts), 4 CodeQL fixtures, and 140 credentialed .live.test.ts files that default mode already excluded. The regression test fails without the fix (it selects the skill file) and passes with it; all 37 ci-changed-node-test-plan selection/integration/dependency-input tests pass.
Related: #162787
What Problem This Solves
The Telegram Test Server userbot harness could not drive a forwarded burst, so the forward-lane behavior #162787 targets (a forwarded text and attachment split into two turns) had no live proof path.
User Impact
No user-visible product change. Maintainers can now reproduce forwarded text+photo bursts against a real Telegram Test Server bot and see whether the Gateway answers them as one turn or two. The proxy log also shows Gateway getFile/download latency and how many updates each
getUpdatesresponse delivered.Why This Change Was Made
forwardBurst(DM-only; the runner rejects it without--dmbefore leasing a credential). The SUT bot posts a text and a photo into the DM through the Test Bot API. The QA user then forwards both back with one TDLibforwardMessagescall (TDLib 1.8.67 schema). The action row records the forwarded and source message ids. A forward withoutforward_infofails the action, because the forward lane would not engage.forward_info: nullon both forwards), and the Gateway treated them as plain messages.*.test.*path directly. This PR'snode:testfiles under.agents/skills/telegram-e2e-userbot/scripts/were then handed to Vitest, which exited 1 with "No test files found" and failedchecks-node-changed. Aggressive mode now applies the sameisRoutableChangedTargetpredicate default mode already used. The skill'snode:testsuite keeps its Vitest owner,test/scripts/telegram-e2e-userbot-skill.test.ts, which runsnode --testover the skill directory.doneAton every row, log-onlyfiledownload rows (no paths), and count-only rows for non-emptygetUpdatesresponses. The Gateway itself logs no getFile/download timing. Controls still match Bot API methods only.Evidence
Live Telegram Test Server runs (
--source-gateway --dm, mock provider). The burst fires at t≈25–30 s; each row is one run:getUpdatesresponses, 208 ms apartDownload latency is well above the 80 ms forward window, as #162787 assumed. But Telegram also delivers the two forwarded updates in separate
getUpdatesresponses, 200–800 ms apart. The window has already closed before the photo update reaches the Gateway, so forwarded bursts still split on the live path. Follow-up work tracks that gap; this PR only adds the harness that measures it.Harness tests (CI runs the skill's
node:testfiles once, through the Vitest ownertest/scripts/telegram-e2e-userbot-skill.test.ts; wall times measured locally):user-driver.test.py: 37 passed (~0.04 s)user-record.test.py: 13 passed (~0.05 s)scenario.test.mjs,telegram-test-api-proxy.test.mjs,run-mock-sut-user-e2e.test.mjs,telegram-test-scenario.test.mjs: 65 passed (~5 s)telegram-run-composition.test.mjsis load-sensitive on the unchanged harness as well (a different case fails per run at host load ~40). A/B runs against the base harness showed the same failures, so they are not attributable to this change.CI planner fix: the new aggressive-selection regression in
test/scripts/ci-changed-node-test-plan.selection.test.tsfails without the fix (it selects.agents/skills/example/scripts/driver.test.mjs) and passes with it (~0.7 s). All 37 tests across the threeci-changed-node-test-planselection/integration/dependency-input files pass.Autoreview (Codex): scoped-clean at P0–P2 for the harness diff; the planner fix is reviewed separately.