Repository navigation
improve(telegram): reduce reply preparation overhead [AI] - #128308
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready evidence for exact head
No live Telegram message was sent: the changed contract is local provider-boundary preparation, final provider calls are byte-identical, and a network send would not exercise a distinct behavior. The full ClawSweeper review is still replacing its in-progress placeholder; no |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 1:54 PM ET / 17:54 UTC. ClawSweeper reviewWhat this changesThis PR reuses prepared Telegram reply and thread parameters across chunked text and media sends to reduce repeated local preparation work. Merge readinessKeep open. The planner already owns reply/thread projection, and the patch reuses that result without a concrete semantic regression found; scoped Telegram policy still calls for after-fix reply-context proof before landing. Likely related people: steipete and Jesse Merhi. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTelegram outbound delivery prepares a target, topic, and reply context before sending text chunks or media through the Telegram API. This change sits between outbound planning and the text/media delivery paths. flowchart LR
A[Outbound send request] --> B[Telegram outbound planner]
B --> C[Prepared reply and topic parameters]
C --> D[Text chunk delivery]
C --> E[Media delivery]
D --> F[Telegram API]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +3. Total +3 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep reply/thread projection canonical in the outbound planner and add a redacted after-fix bot-to-bot trace or mock-gateway verdict that demonstrates unchanged reply and topic payloads. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a performance optimization, not a report of broken existing behavior; source comparison shows the former per-call projection and the planner-owned equivalent. Is this the best way to solve the issue? Yes. The planner already owns target and thread resolution, so reusing its prepared result is cleaner than adding separate caches in text and media delivery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bca206d794bd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Telegram text and media delivery repeated the same reply/thread parameter projection for every chunk, adding avoidable local preparation work to ordinary outbound sends.
Why This Change Was Made
Reuse the canonical reply/thread parameters already prepared by the outbound plan. For implicit single-use replies, lazily prepare the no-reply variant at most once and reuse it for later chunks or media. Provider payloads, chunk ordering, retry behavior, and reply semantics remain unchanged.
User Impact
Chunked Telegram sends spend less CPU time in local outbound preparation. There is no provider-visible behavior change.
Evidence
c92a044beba4fc2ffff633e06be69581569354efc9ace1f0693a080f591c81a5.node scripts/check-changed.mjs -- extensions/telegram/src/send-message.ts: passed all classified format, type, lint, dead-export, doctor, boundary, database, media, and import-cycle checks.gpt-5.6-sol/high autoreview: no P0/P1 findings; correctness confidence 0.90.AI-assisted implementation and review were used. No agent transcript is published.