Repository navigation
refactor(twitch): consolidate inbound and outbound sending - #135254
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 11:34 AM ET / 15:34 UTC. ClawSweeper reviewWhat this changesThe PR routes Twitch monitor replies and direct outbound sends through one sender that strips Markdown, records intentional no-send outcomes, and creates delivery receipts, while also fixing CI script detection to read the package manifest. Merge readinessThe refactor remains useful and the reviewed delivery paths preserve their responsibilities; no introduced correctness or security defect was found. Keep this maintainer-owned PR open until its exact-head CI completes. Priority: P3 Review scores
Verification
How this fits togetherTwitch chat replies enter through the monitor while agent-initiated sends enter through the outbound adapter; both now pass through one sender before the client manager writes to Twitch. The CI shard reads package scripts to decide which typecheck commands apply to current and historical targets. flowchart LR
A[Twitch chat input] --> B[Twitch monitor]
C[Agent outbound request] --> D[Outbound adapter]
B --> E[Shared Twitch sender]
D --> E
E --> F[Client manager]
F --> G[Twitch chat]
H[Package manifest] --> I[CI script check]
I --> J[Typecheck commands]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -124, Tests -166, Config 0. Total -290 across 12 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single Twitch sender as the owner of formatting and receipts, with monitor and direct outbound callers retaining their separate account and lifecycle preparation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing delivery ownership and repairs CI script detection rather than reporting a separate user bug. Is this the best way to solve the issue? Yes: concentrating Markdown conversion, no-send disposition, and receipt creation in the shared sender removes duplicated monitor/outbound preparation while preserving caller-owned account and manager lifecycle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8361f3704dd5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…135254) * refactor(twitch): consolidate inbound and outbound sending * fix(ci): detect typecheck scripts from package manifest
Twitch outbound and inbound delivery now share one sender. The outbound adapter keeps account and target validation, the sender owns Markdown conversion and receipts, and the client manager keeps transport, chunking, logging and its existing success/error envelope. This removes repeated preparation and error plumbing while preserving the public error shape, including the absence of a cause.
Production is +72/−196 = −124 physical lines, or −114 operational lines after excluding deletion of a test-only clearing method. Tests are net −166 lines, including the CI regression coverage below. There are no configuration, dependency, public API, storage or protocol changes.
Validation:
Before landing: exact-head CI must pass the production/full-tree dead-code gate. Both local attempts reached the existing 600-second limit on an earlier revision; those failures are retained, and the aggregate changed-file command is not claimed as passed. Earlier lint failures were repaired in the final source and rechecked.
The final patch SHA-256 is
9efed5f57efe83b093f4b8cc6874f479d9a93dd615e8a9d650a54fc2c4639556. The original production files match stable v2026.8.1. No runtime bug or speedup is claimed for this refactor.Named follow-ups: the Twitch README and missing-token diagnostic still say
tokenwhere the schema and resolver useaccessToken; a pre-existing rapid-client-creation test comment also contradicts the creation-promise owner. These are recorded separately from this frozen delivery change.The hosted typecheck shard exposed a separate CI defect: package-script presence was inferred from formatted
pnpm runoutput, and the job reported a declared root script as absent. Both remaining listing-based probes now use the step's existing manifest-basedhas_package_scripthelper. Current targets still fail when a required script is genuinely missing; historical targets retain their optional-script behavior. Workflow production delta is zero (two lines replaced).Five behavioral cases execute the actual workflow shell with current/historical package manifests and an unavailable listing command. The old workflow fails three cases; the repaired workflow passes all five plus the existing guard fixture. All 14 selected checks pass. A fresh managed high/P2 review of the combined Twitch and CI change is clean. The exact hosted cause of the listing failure (including any pipe behavior) was not reproduced locally; no such mechanism is asserted. New-head hosted CI, including the full-tree dead-code gate, is still required before landing.
Landing verification: the latest ClawSweeper review (15:34 UTC) has no introduced correctness or security finding. Its CI requests and rank-up are now satisfied by all187 successful/skipped jobs in CI33525719241 on019d3fb1b39c; the hosted dependency checks also close the earlier local dead-code deadlines. A clean three-way merge against current main2cedaddb5e23 retains the independent CI changes and introduces exactly the two reviewed script lookups plus their fixture coverage. The shared sender retains monitor/outbound account and lifecycle ownership; operational production decreases114 lines after excluding10 deleted test-seam lines, and tests decrease166 lines.