Skip to content

test(telegram): avoid wall-clock pacing in HTTP conformance - #157281

Merged
steipete merged 1 commit into
mainfrom
codex/test-telegram-http-throttler-1ffe47bf
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-telegram-http-throttler-1ffe47bf

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

Arm Command wall Summed case duration Worker preparation Peak command RSS
A1 63.766 s 30.707 s 12.791 s 2,936,572 KiB
B1 27.936 s 8.909 s 11.924 s 3,051,652 KiB
B2 27.702 s 7.997 s 11.939 s 3,003,884 KiB
A2 47.013 s 25.530 s 14.892 s 3,131,196 KiB

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 merge aca9d88a04241b4eaa58293e64a110dc9d8bf28c with main 94ad9f072cdea79d94dd5af202872f317ebf7003. 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.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 24, 2026 12:25
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 9:20 AM ET / 13:20 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: 7e9d8854030938a5f9d43a2d74874c74fa2e26b3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The small fixture change has credible measured speedup, preserved assertions, sibling qualification, and successful exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed test fixture was exercised through the registered adapters and loopback HTTP server on a configured Testbox; the recorded A–B–B–A commands passed all 37 cases with shorter wall time, and exact-head CI independently passed the suite. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed test fixture was exercised through the registered adapters and loopback HTTP server on a configured Testbox; the recorded A–B–B–A commands passed all 37 cases with shorter wall time, and exact-head CI independently passed the suite. No stored-data contract changes.
Evidence reviewed 9 items Introduced change: The pinned merge-base-to-head diff adds only throttler imports, per-case seeding for three fixture tokens, and cleanup in the Telegram HTTP conformance test.
Still needed on main: The fetched main revision retains the original fixture setup without unpaced throttler seeding.
Production throttler ownership: Production creates or reuses a throttler by bot token and retains its group scheduler; the patch uses this existing cache and does not edit production code.
Findings None None.
Security None None.

How this fits together

Telegram'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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +12. Total +12 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 0 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 12 0 +12

Review metrics

Metric Value Why it matters
HTTP suite command wall time 47.013 s warm baseline; 27.702–27.936 s candidate The recorded A–B–B–A comparison measures this test command directly without claiming whole-suite savings.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a bounded test-runtime improvement with no change to user-facing Telegram behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed test fixture was exercised through the registered adapters and loopback HTTP server on a configured Testbox; the recorded A–B–B–A commands passed all 37 cases with shorter wall time, and exact-head CI independently passed the suite. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed test fixture was exercised through the registered adapters and loopback HTTP server on a configured Testbox; the recorded A–B–B–A commands passed all 37 cases with shorter wall time, and exact-head CI independently passed the suite. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • ga oanze888: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-24T12:33:17.396Z sha 7e9d885 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS labels Sep 24, 2026
@steipete
steipete merged commit d0984b5 into main Sep 24, 2026
179 of 181 checks passed
@steipete
steipete deleted the codex/test-telegram-http-throttler-1ffe47bf branch September 24, 2026 14:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 24, 2026
* 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)
  ...
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant