Skip to content

refactor(tests): reuse Telegram deferred fixtures - #148501

Merged
steipete merged 1 commit into
mainfrom
codex/test-telegram-deferred-fixtures
Sep 15, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-telegram-deferred-fixtures

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Telegram race and shutdown tests repeat deferred-promise construction already provided by the shared test helper.

User Impact

No user-visible change. Existing offset persistence, command synchronization, and polling lifecycle coverage remains intact.

Why This Change Was Made

Reuse the SDK's createDeferred in three test files, preserving assertions, await points, and release → abort → await-run ordering. Production code is unchanged; test code shrinks by 18 lines.

Evidence

All 134 cases passed before and after the fixture change. After rebasing onto the canonical CI repair in #148504, the same five complete suites passed again, with matching per-file case identities, order, and results. The normal runtime prerequisite rebuilt successfully on the refreshed candidate.

All 19 normal local changed checks passed on the refreshed candidate, including extension test types, all three dead-export scans, formatting, and type-aware lint. Fresh independent Codex review found no actionable P0–P2 findings.

The original CI failures came from the upstream Radius test boundary and are addressed by #148504; fresh exact-head hosted CI remains required before landing. These are fixture and regression checks, with no performance, universal scheduling, or live Telegram claim.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:00 PM ET / September 15, 2026, 00:00 UTC (Revision 3).

ClawSweeper review

What this changes

The PR replaces repeated deferred-promise setup in Telegram tests with the existing shared SDK helper, without changing production behavior.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded cleanup: current main still contains the duplicated fixtures, and the replacement preserves the tested ordering and assertions. No actionable patch defect was found; maintainer-authored work also remains protected from automatic closure.

Priority: P3
Reviewed head: a6c11c10643038d210f3f3faab9a01b8a1e0ff92

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with useful reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored fixture cleanup changes no production owner or Telegram behavior; reported before/after suite results support preservation of the test contract, and live Telegram proof is unnecessary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored fixture cleanup changes no production owner or Telegram behavior; reported before/after suite results support preservation of the test contract, and live Telegram proof is unnecessary.
Evidence reviewed 6 items Introduced patch: The pinned parent-to-head diff only replaces deferred construction and its references; assertions, await points, and release-before-abort shutdown ordering remain intact.
Existing helper contract: The SDK createDeferred delegates to createDeferredCore, which returns native Promise.withResolvers. Its promise and resolve semantics match the removed fixtures; no SDK API is added or changed.
Still distinct from current main: Fetched main retains both local deferred helper declarations and polling's releaseOffsetWrite construction, so the requested consolidation remains outstanding.
Findings None None.
Security None None.

How this fits together

Telegram’s lifecycle tests pause asynchronous operations to check command synchronization, polling progress, and update-offset persistence. The shared deferred helper supplies the promise and release function used to control those pauses.

flowchart LR
  A[Telegram test scenarios] --> B[Shared deferred helper]
  B --> C[Pause asynchronous operation]
  C --> D[Check ordering and progress]
  D --> E[Release promise]
  E --> F[Verify completion and shutdown]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -18. Total -18 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 10 28 -18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 10 28 -18

Review metrics

None.

Technical review

Best possible solution:

Use the existing SDK deferred helper while retaining the current race, persistence, and shutdown assertions.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR consolidates test fixtures rather than reporting a runtime defect; the duplicate constructions are directly visible on current main.

Is this the best way to solve the issue?

Yes: the existing SDK helper supplies the same promise settlement contract without introducing another helper or changing the covered behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 969e7971308d.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored fixture cleanup changes no production owner or Telegram behavior; reported before/after suite results support preservation of the test contract, and live Telegram proof is unnecessary.

Label justifications:

  • P3: This is test-fixture cleanup with unchanged production behavior and assertions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored fixture cleanup changes no production owner or Telegram behavior; reported before/after suite results support preservation of the test contract, and live Telegram proof is unnecessary.

Evidence

What I checked:

  • Introduced patch: The pinned parent-to-head diff only replaces deferred construction and its references; assertions, await points, and release-before-abort shutdown ordering remain intact. (extensions/telegram/src/polling-session.test.ts:1202, a6c11c106430)
  • Existing helper contract: The SDK createDeferred delegates to createDeferredCore, which returns native Promise.withResolvers. Its promise and resolve semantics match the removed fixtures; no SDK API is added or changed. (src/plugin-sdk/extension-shared.ts:151, a6c11c106430)
  • Still distinct from current main: Fetched main retains both local deferred helper declarations and polling's releaseOffsetWrite construction, so the requested consolidation remains outstanding. (extensions/telegram/src/update-offset-persistence.test.ts:5, 969e7971308d)
  • Related CI repair is merged and distinct: GitHub confirms test: route provider integration and wizard recovery tests correctly #148504 merged at the pinned parent. Its supplied body addresses provider integration and wizard test routing, rather than these Telegram fixtures. (867e655d51d8)
  • Validation and review continuity: The captured PR body reports 134 passing cases before and after the change and 19 passing local changed checks after rebasing. These are author-reported test results, not independently executed proof. The previous review projection contains no findings; this read-only review ran no tests. The introduced diff passed git diff --check. (a6c11c106430)
  • Area history and inspection limits: Current-main logs identify prior deferred consolidation by Dallin Romney and offset persistence work by YangManBOBO. Deeper blame, the earlier reviewed head comparison, and the release-file check encountered unavailable Git objects; exact line introduction and release inclusion were not established. (extensions/telegram/src/update-offset-persistence.test.ts, 969e7971308d)

Likely related people:

  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • YangManBOBO: 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 (2 earlier review cycles)
  • reviewed 2026-09-14T20:00:26.033Z sha b4b6a77 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-14T20:50:20.172Z sha b4b6a77 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 14, 2026 20:45
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 14, 2026
@steipete
steipete force-pushed the codex/test-telegram-deferred-fixtures branch from b4b6a77 to a6c11c1 Compare September 14, 2026 23:54
@clawsweeper clawsweeper Bot added 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. and removed 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 14, 2026
@steipete steipete self-assigned this Sep 15, 2026
@steipete
steipete merged commit 97dde71 into main Sep 15, 2026
116 of 118 checks passed
@steipete
steipete deleted the codex/test-telegram-deferred-fixtures branch September 15, 2026 03:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
vincentkoc added a commit that referenced this pull request Sep 15, 2026
* commit 'd8e50a38fd1c4df6dd69bcbc155697c464e1be45': (23 commits)
  fix(cron): release queued reservations when activation fails (#141008)
  fix(gateway): reduce CPU work in session lists and searches (#148713)
  feat(gateway): add admin CPU profile diagnostics (#148004)
  fix(gateway): cap device-required probe cache to prevent unbounded growth (#147708)
  fix(ci): align Gateway E2E expectations (#148653)
  refactor(ai): remove unused overflow wrapper (#148719)
  feat: stage selected chat text as editable comments (#148649)
  fix(ci): admit reachable release refs with large histories (#148161)
  fix(agents): allow authorized email CLI actions (#148521)
  improve(agents): trim large tool results with less CPU (#148718)
  refactor(docker): share image version parsing (#148243)
  fix(ci): retain passing hosted checks after skipped duplicates (#148722)
  fix(update): report configuration failures during repair (#144819)
  refactor(imessage): share handle classification (#148229)
  fix(ui): keep the selected agent across Settings pages (#148667)
  test(telegram): reuse deferred fixture helper (#148501)
  fix(media): resize images before understanding (#122431)
  fix: preserve unfinished work during completed PR cleanup (#148704)
  refactor(migrate-hermes): reuse canonical config record coercion (#148645)
  perf(channels): reduce history worker metadata footprint (#148711)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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