Repository navigation
refactor(telegram): remove test-only bot dependency bags - #174256
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR replaces private Telegram dependency bags with direct owner imports and moves test substitutions to module mocks. Example: A Telegram user sends /status.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: the maintainer-directed cleanup is useful, but two fixture migrations break existing Telegram tests and need repair. Priority: P3 Before merge
Findings
Agent review detailsHow this fits togetherThe Telegram plugin receives Bot API updates, prepares authorized conversation context, dispatches agent or native-command work, and delivers replies through Telegram and shared SDK owners. flowchart LR
A[Telegram update] --> B[Bot and handlers]
B --> C[Authorization and context]
C --> D[Agent or native command]
D --> E[SDK and Telegram owners]
E --> F[Telegram reply]
Technical reviewBest possible solution: Keep the direct-owner refactor and repair mock initialization and resolver identity without weakening the existing assertions. Do we have a high-confidence way to reproduce the issue? This refactor reports no product defect; exact-head CI annotations establish the two fixture failures, and source inspection explains their triggers. Is this the best way to solve the issue? Direct imports are a reasonable replacement for test-only production injection, provided module mocks preserve initialization order and shared function identity. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e9e0717d9cf7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -176, Tests +524, Other -3. Total +345 across 61 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 9:53 AM ET / 13:53 UTC. |
|
Exact-head landing evidence for The full hosted CI run 38913795276 completed successfully: every planned runtime, type, lint, architecture, boundary and ratchet job passed, including the three jobs and two fixture suites that failed on the original head. Those original failures were PR-caused and repaired, not classified as inherited. All exact-head check runs were enumerated; no failure, cancellation or running suite remains. The CodeQL aggregate is neutral with its six applicable Security High checks successful; inapplicable jobs are skipped. Current dependency, security-sensitive-review and CI status contexts are successful. Targeted package types and formatting passed. Fresh independent P0-P2 review of the area and its three-file repair completed scoped-clean. The local runtime/lint wrappers attempted broader artifact preparation than the campaign's host budget allows; those attempts were stopped and are not claimed as passes or code failures. Exact-head hosted CI supplies the broad/runtime proof. Existing assertions, real authorization, lazy sends, cancellation and settlement remain. Native preparation is unavailable under shared provisioning capacity. Two earlier lane attempts stalled on that same capacity. This PR's first attempt then lost its process during the coordinator restart, without review artifacts or a merge intent. Its resumed attempt spent about fifteen minutes in startup/managed-worktree capacity admission and was stopped by its owner. It returned an aborted allocation state lease and no READY/preparation result; this is not represented as a completed native review or an automatic deadline verdict. All prior owned processes and their process group were verified gone. Exact-token native lock recovery is running separately; it has no merge intent and cannot submit a merge. No merge request was submitted by the preparation attempts. Using the coordinator's explicitly authorized exact-head REST fallback for the broken native workflow. Checks, security and required reviews are not waived. No CI rerun, dispatch or push was made to chase green. Production delta: +174/-351, 177 net lines removed; tests/support: +892/-368. |
…essor fixture Upstream removed TelegramBotDeps and the processor's telegramDeps (openclaw#174256). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PiKbtQbHKKfq82arnmwBYp
…4256) * refactor(telegram): remove test-only bot dependency bags * test(telegram): install mocks before importing command handlers
What Problem This Solves
Telegram threaded a single default dependency object through bot creation, message handling, reply dispatch and native commands. Alternate implementations came only from tests, and a second native-command object duplicated the same forwarding plumbing.
What Changed
Call the existing SDK and Telegram owners directly, remove both private dependency bags and the bot-construction forwarding wrapper, and move test alternatives to module boundaries. Keep actual runtime/transport inputs, prepared context handoffs, current authorization reads, lazy send loading, cancellation and delivery settlement unchanged.
This is an area slice of a wider cleanup family. Public SDK exports, Gateway protocol, config keys, CLI flags and persisted shapes do not change. No migration or user action is required. No dependency or schema change.
Against pinned main base e3278ef: 27 production files, +174/-351 (177 net production lines removed). Tests/support: 33 files, +892/-368 (524 net lines added), including the new fixture-only type file. Two ratchets shrink by three lines. Retained fixture assertions are unchanged; the added setup replaces production injection with module mocks.
Best-effort tradeoffs accepted
None. This removes test-only indirection, not runtime guards. Security-effect authority checks and write-capable work settlement remain with their current owners.
Evidence
Release-note context: internal simplification only; user-visible Telegram features and public contracts remain unchanged.