Repository navigation
test(telegram): avoid wall-clock pacing in HTTP conformance - #157281
Conversation
|
🦞👀 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 September 24, 2026, 9:20 AM ET / 13:20 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch gives three synthetic Telegram bot tokens unpaced throttlers in the HTTP conformance fixture, shortening test runs without changing production throttling. Merge readiness✅ Ready for maintainer review This focused test-speed change is still absent from current main. The recorded before-and-after measurements and successful exact-head CI support keeping it open; review found no actionable patch defect. Priority: P3 Review scores
Verification
How this fits togetherTelegram's outbound plugin turns registered message and action calls into Bot API requests. This suite sends those calls to a local HTTP server and checks payloads, account routing, delivery, and authorization outcomes. flowchart LR
A[Conformance cases] --> B[Synthetic bot tokens]
B --> C[Token-scoped throttlers]
C --> D[Registered Telegram adapters]
D --> E[Loopback HTTP server]
E --> F[Captured requests and assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +12. Total +12 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep production rate limits intact and let the dedicated account-throttler suite own pacing, ordering, cancellation, and backoff coverage. Do we have a high-confidence way to reproduce the issue? Not applicable as a product bug; the recorded A–B–B–A runs provide a repeatable file-level command for measuring the test-runtime issue. Is this the best way to solve the issue? Yes; the fixture uses the existing token cache and preserves registered HTTP delivery while leaving production defaults alone. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dda6e1ceda39. 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)
|
|
Merged via squash.
|
* commit '9ccfc7d1bea21e34da48edbd54afd2e1be57db40': (89 commits) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state fix(test): synchronize Git backoff cancellation readiness (#157315) fix: validate Codex model references in Docker (#157175) fix(state): tolerate brief WAL coordinator contention (#157121) fix: unblock conversations after recovery preparation fails (#157214) test(telegram): avoid wall-clock pacing in HTTP conformance (#157281) fix: keep independent database work responsive under load (#157230) refactor(sqlite): centralize WAL checkpoint execution (#157263) improve(android): show tool outcomes in collapsed work (#156950) fix: remove tracked release scratch blocking source capture (#157308) test(update): remove legacy probe stream ordering race fix: preserve steering across reconnects and show queued input (#157135) fix(ui): keep typing focus when the GitHub reader opens (#157202) fix(ios): keep screenshot logs outside capture evidence test(codex): await startup teardown in lifecycle fixtures chore(ui): refresh control ui locales (#157311) refactor(memory): deslop memory plugins (#156867) refactor(test): share CLI diagnostics fixture setup (#157201) fix(release): retry notarization submit/wait on transport failures and name the resume command (#157116) ...
What Problem This Solves
Telegram's registered-adapter HTTP conformance tests spend time waiting for the production per-chat pacing budget while testing payloads, account selection, delivery, and authority.
User Impact
Faster test runs with the same 37 cases and assertions. Production throttling is unchanged.
Why This Change Was Made
Seed the existing account-scoped throttler map with real, unpaced grammY throttlers for the fixture's three synthetic bot tokens, and reset it before and after each case. Real scheduling, single-request group/chat concurrency, registered adapters, HTTP requests, and state/authority checks remain in place. The existing throttler suite continues to own default rate-budget, same-token sharing, ordering, cancellation, and backoff coverage.
Evidence
One natural A–B–B–A on Crabbox's configured Blacksmith Testbox provider, with Linux Node 24.19.0, pnpm 12.4.2 and Vitest 5.0.1. Both arms use frozen base
1ffe47bf5e3ac930e1e00b7fb968c00c6590aee1; only this test fixture differs.Command:
pnpm test extensions/telegram/src/outbound-adapter.telegram-http.test.ts --maxWorkers=1, with stock verbose/JSON reporters and default caches. All four arms passed all 37 cases in the same order, including duplicate display names, and settled naturally. The downloaded archive, all 37 payloads, and 84 source bindings were independently checked.Compared with warm A2, candidates save 19.08–19.31 seconds (40.58–41.08%). A1 was colder; these are measurements of the recorded test command, not whole-suite or production savings. No memory-saving claim.
Crabbox comparison. Independent review is clean; the unchanged patch was audited against current throttler and singleton owners.
Crabbox qualification passed all 13 account-throttler cases (5.199 s), all 57 HTTP-send cases (59.229 s), and all 20 selected changed-gate checks (450.418 s), including extension-test types, type-aware lint, formatting and guards. Source remained unchanged and every command settled naturally. The SSH connection dropped during the gate; the original remote run completed successfully, and its archive and completion records were verified without replaying it.
Exact-head CI passed for
7e9d8854030938a5f9d43a2d74874c74fa2e26b3, tested as mergeaca9d88a04241b4eaa58293e64a110dc9d8bf28cwith main94ad9f072cdea79d94dd5af202872f317ebf7003. The selected extension-database-workers job ran exactly this file: all 37 cases passed, with 16.720 s summed case time, 48.06 s of Vitest time, 50.49 s including the test wrapper, and 52.42 s for the timed CI runner command. The job including checkout/setup took 97 s. CI used Linux Node 24.19.0, pnpm 12.4.2, and Vitest 5.0.1; this is a separate CI observation, not another controlled A–B comparison.Core and extension type-aware lint, extension-test types, all five core-test type stripes, and the selected boundary checks passed. The boundary test row passed 142 cases across 12 files. The changed test and its account-throttler, runtime test-support, and grammY-export owners are byte-identical between the published head and tested merge. CI selected only the changed HTTP-conformance file; the separate 13-case throttler and 57-case HTTP-send runs above remain the sibling qualification.
The exact-head ClawSweeper review has no actionable findings. Required CI and security-review gates are green. Security Review briefly published incomplete-review failures while its existing changed-file consistency recovery ran; that same workflow completed successfully, and its automatic follow-up confirmed success. No test failed and no manual workflow rerun was requested.