Skip to content

test(telegram): delivery trace goldens for the edit-preview lifecycle#104581

Merged
steipete merged 1 commit into
mainfrom
claude/chanref-p0-traces-telegram
Jul 11, 2026
Merged

test(telegram): delivery trace goldens for the edit-preview lifecycle#104581
steipete merged 1 commit into
mainfrom
claude/chanref-p0-traces-telegram

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #104318

What Problem This Solves

Extends the delivery trace harness (#104478) to Telegram — the derived-edit-preview reference channel whose invariants (one visible preview edited forward, finalize in place, flood-wait suspension honoring retry_after, chained pagination) the planned core preview engine must reproduce exactly.

Why This Change Was Made

Five golden scenarios drive the real message-context → dispatch → draft-stream → send pipeline with a mocked grammY API under fake timers: streaming with block boundary and finalize-in-place; final-only; cancel; flood-wait during preview (suspension holds newest snapshot, single recovery edit); overflow pagination (retained page + chained continuations, replyTo consumed exactly once). Warts pinned as Phase-4 oracles: double typing cue at turn start; 30-char initial debounce parking short partials; draft-final pagination splitting rendered HTML at hard boundaries mid-word (funnel-parity divergence — flagged separately for a fix); cancel deletes rather than finalizes the preview after dwell.

User Impact

None at runtime — test infrastructure pinning Telegram's streaming contract.

Evidence

  • Testbox tbx_01kx91ts1vfsbattmk598dgk7w: full telegram suite + pnpm check:changed green; verify-mode trace runs ×4 byte-stable (incl. warm-lease tbx_01kx90h6d5bdgsncpnpbhfq9sd reruns).
  • Autoreview (codex gpt-5.6-sol, xhigh): first run caught a fixture-transfer artifact (fixed, amended); final run clean (0.94).
  • Note: scenarios run replyToMode:"first" (vs prod default "off") to expose single-consumption — commented in the test.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: M maintainer Maintainer-authored PR labels Jul 11, 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. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 1:27 PM ET / 17:27 UTC.

Summary
Adds Telegram delivery-trace golden fixtures and a test harness covering streaming preview, final-only delivery, cancellation, flood-wait recovery, and pagination.

PR surface: Source +47, Tests +340. Total +387 across 6 files.

Reproducibility: not applicable. This PR creates deterministic regression oracles rather than addressing a reported runtime failure.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104318
Summary: This PR implements part of the Phase 0 behavior-lock work in the channel-adapter refactor program using the harness introduced by the merged predecessor PR.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
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:

  • none.

Next step before merge

  • [P1] No automated repair is needed; this protected-label PR is suitable for ordinary maintainer landing review.

Security
Cleared: The test-only diff adds no dependencies, workflows, permissions, secret handling, downloaded code, or production execution surface.

Review details

Best possible solution:

Land the focused Telegram trace coverage as an executable oracle for the current preview lifecycle while leaving runtime behavior unchanged.

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

Not applicable: this PR creates deterministic regression oracles rather than addressing a reported runtime failure.

Is this the best way to solve the issue?

Yes. Extending the existing shared trace harness at the real Telegram dispatcher boundary is narrower and less drift-prone than introducing a separate test framework or duplicating production logic.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: This is low-risk test infrastructure that does not change user-visible runtime behavior.
  • 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: The repository identifies this as maintainer-labeled test-only work, so the external-contributor real-setup proof gate does not apply; Testbox identifiers and successful exact-head checks provide supplemental validation.

Label justifications:

  • P3: This is low-risk test infrastructure that does not change user-visible runtime behavior.
  • 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: The repository identifies this as maintainer-labeled test-only work, so the external-contributor real-setup proof gate does not apply; Testbox identifiers and successful exact-head checks provide supplemental validation.
Evidence reviewed

PR surface:

Source +47, Tests +340. Total +387 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 47 0 +47
Tests 1 340 0 +340
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 387 0 +387

What I checked:

Likely related people:

  • Peter Steinberger: Prior merged history includes the default partial-streaming behavior and shared draft-stream refactors central to the lifecycle captured here. (role: recent area contributor; confidence: high; commits: fc1787fd4bea, 3451159174c8; files: extensions/telegram/src/draft-stream.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • Ayaan Zaidi: Multiple merged commits introduced and stabilized Telegram draft previews, block rotation, private-chat streaming, and in-place finalization. (role: feature owner; confidence: high; commits: 6edb512efaeb, a69e82765f20, 8b1fe0d1e240; files: extensions/telegram/src/draft-stream.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • Hongwei Ma: Merged history ties this contributor to the initial-message debounce behavior deliberately preserved by the trace fixtures. (role: adjacent owner; confidence: medium; commits: 7ffc8f9f7ccf; files: extensions/telegram/src/draft-stream.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.

@steipete
steipete merged commit 444d7df into main Jul 11, 2026
138 of 145 checks passed
@steipete
steipete deleted the claude/chanref-p0-traces-telegram branch July 11, 2026 17:31
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: M 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