Skip to content

refactor: remove Telegram session deps adapter#96524

Merged
jalehman merged 2 commits into
openclaw:mainfrom
jalehman:josh/path3-telegram-injected-deps-cleanup
Jun 24, 2026
Merged

refactor: remove Telegram session deps adapter#96524
jalehman merged 2 commits into
openclaw:mainfrom
jalehman:josh/path3-telegram-injected-deps-cleanup

Conversation

@jalehman

@jalehman jalehman commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

This removes the remaining Telegram-only compatibility adapter that translated injected loadSessionStore dependencies into the current session accessor contract. Telegram production code now consumes getSessionEntry and listSessionEntries directly, matching the Path 3 accessor boundary used by the rest of the bundled plugin migration.

Why This Change Was Made

The adapter was only supporting the local test harness/custom injected-deps shape. Keeping it in extensions/telegram/src/bot.ts left a steady-state runtime fallback for a retired internal dependency shape, so the test harness now supplies the canonical accessors directly and the production file is covered by the session accessor ratchet.

User Impact

No user-visible Telegram behavior is intended to change. Telegram still starts in polling mode, resolves the same stored Telegram session, sends outbound messages through the gateway, and supports message deletion. External runtime callers are expected to use the current injected dependency contract.

Evidence

  • node scripts/check-session-accessor-boundary.mjs
    • Passed after adding extensions/telegram/src/bot.ts to the migrated bundled plugin ratchet.
  • node scripts/run-vitest.mjs extensions/telegram/src/bot.create-telegram-bot.test.ts extensions/telegram/src/bot.test.ts extensions/telegram/src/bot.command-menu.test.ts extensions/telegram/src/bot.fetch-abort.test.ts
    • Passed: 4 files, 210 tests.
  • .agents/skills/autoreview/scripts/autoreview --mode local
    • Clean before PR open and clean again after the CI ratchet-test expectation fix.
  • CI follow-up after initial push:
    • checks-node-compact-large-whole-1 failed because test/scripts/check-session-accessor-boundary.test.ts still expected the old migrated bundled-plugin file set.
    • Fixed by adding extensions/telegram/src/bot.ts to that test expectation.
    • node scripts/check-session-accessor-boundary.mjs passed.
    • node scripts/run-vitest.mjs test/scripts/check-session-accessor-boundary.test.ts passed: 1 file, 28 tests.
    • Later checks-node-compact-small-whole-2 failure was unrelated benchmark timing noise in untouched test/scripts/bench-gateway-restart.test.ts; failed job rerun passed.
    • Final CI state on 72d3ebf0c1d: green.
  • Local live OpenClaw proof on runtime-equivalent head 6aeefb8938ded8f91543f16b53d00c97ef7867f2:
    • Final PR head adds only the ratchet test expectation for the already-live-proofed production ratchet change; production/runtime code is unchanged from the live proof.
    • Recorded live checkout before proof: detached 352c4a40d838d7deb0bfdf38fa33665aef00be72, clean, OpenClaw 2026.6.10 (352c4a4).
    • Loaded PR head into /Users/phaedrus/Projects/clawdbot, ran pnpm build, restarted the local gateway, and verified OpenClaw 2026.6.10 (6aeefb8).
    • pnpm openclaw gateway call channels.status --json --timeout 20000 showed telegram configured/running with event loop not degraded.
    • pnpm openclaw gateway call send --json --timeout 30000 --params '{"channel":"telegram","to":"telegram:-1003774691294","sessionKey":"agent:main:main","message":"Path 3 Telegram injected-deps cleanup live proof: gateway send from 6aeefb8.","idempotencyKey":"path3-telegram-injected-deps-6aeefb8-20260624T1058"}' returned messageId: "28761".
    • sessions.preview for agent:main:main showed Path 3 Telegram injected-deps cleanup live proof: gateway send from 6aeefb8.
    • message.action delete for Telegram messageId: "28761" returned { "ok": true, "deleted": true }.
    • Restored live checkout to detached 352c4a40d838d7deb0bfdf38fa33665aef00be72, rebuilt, restarted gateway, and verified OpenClaw 2026.6.10 (352c4a4) plus healthz live.

Refs #88838

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 2:14 PM ET / 18:14 UTC.

Summary
The PR removes the private Telegram loadSessionStore injected-deps adapter, updates the Telegram bot test harness to inject canonical session accessors, and ratchets the session-accessor boundary guard and test.

PR surface: Source -1, Other +1. Total 0 across 3 files.

Reproducibility: not applicable. this is a refactor PR, not a bug report. The prior source-reproducible ratchet-test issue is addressed by the final head's matching test expectation update.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #88838
Summary: This PR is an implementation slice for the broader Path 3 session/transcript accessor-seam tracker; the related merged runtime-barrel cleanup is adjacent but does not replace the Telegram-specific cleanup.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Let exact-head CI finish on 72d3ebf0c1d49015e71d7c8107d4da39a21a2fec and fix only PR-caused failures.

Risk before merge

  • [P1] Exact-head CI was still running in the live PR view; merge should wait for required checks on 72d3ebf0c1d49015e71d7c8107d4da39a21a2fec and investigate only PR-caused failures.

Maintainer options:

  1. Decide the mitigation before merge
    Land the cleanup if exact-head CI stays green and maintainers accept removing the private test-harness compatibility adapter in favor of the canonical session accessor contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair remains; maintainers should handle the protected-label cleanup after exact-head CI completes.

Security
Cleared: The diff changes Telegram TypeScript/test harness code plus a local boundary script/test and does not add dependencies, workflows, secret handling, package resolution, or code-download behavior.

Review details

Best possible solution:

Land the cleanup if exact-head CI stays green and maintainers accept removing the private test-harness compatibility adapter in favor of the canonical session accessor contract.

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

Not applicable; this is a refactor PR, not a bug report. The prior source-reproducible ratchet-test issue is addressed by the final head's matching test expectation update.

Is this the best way to solve the issue?

Yes; the private Telegram entry now uses the same accessor-backed dependency contract already used by default deps and handlers, while tests inject those canonical accessors directly.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d01c2906015d.

Label changes

Label changes:

  • add P3: This is a small internal Telegram/session-accessor cleanup with no intended user-visible behavior change and a fixed prior test-ratchet issue.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides live Telegram gateway output for the runtime-equivalent production head, and the final head only adds the adjacent ratchet-test expectation.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a small internal Telegram/session-accessor cleanup with no intended user-visible behavior change and a fixed prior test-ratchet issue.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides live Telegram gateway output for the runtime-equivalent production head, and the final head only adds the adjacent ratchet-test expectation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides live Telegram gateway output for the runtime-equivalent production head, and the final head only adds the adjacent ratchet-test expectation.
Evidence reviewed

PR surface:

Source -1, Other +1. Total 0 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 38 39 -1
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 39 39 0

What I checked:

Likely related people:

  • jalehman: Recent merged Path 3 session-accessor work introduced the current Telegram adapter baseline and updated the same boundary ratchet surfaces; this PR and the linked tracker continue that sequence. (role: recent area contributor; confidence: high; commits: c588606a9bf3, 4d4769c0d6a5, b58e6e0734f2; files: extensions/telegram/src/bot.ts, scripts/check-session-accessor-boundary.mjs, test/scripts/check-session-accessor-boundary.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 24, 2026
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 24, 2026
@jalehman
jalehman merged commit 4c841ac into openclaw:main Jun 24, 2026
173 of 179 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 25, 2026
* refactor: remove telegram session deps adapter

* test: update telegram session ratchet expectation
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* refactor: remove telegram session deps adapter

* test: update telegram session ratchet expectation
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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