Repository navigation
Conversation
…malization The monitor builds reply and durable targets as twitch:channel:<name>, but normalizeTwitchChannel only stripped a leading "#", so the prefixed form reached Twitch unchanged and every automatic reply failed with "not a valid user or channel name". Normalize the internal prefix at the same owner so resolveTarget, sendText, and allowlist entries all agree on the bare channel name. Closes openclaw#166672
|
🦞👀 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: needs real behavior proof before merge. What this changesThe branch strips the internal twitch:channel: prefix in Twitch channel normalization and adds target-resolution regressions. Example: A reply uses the target twitch:channel:proofchan
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR repairs a current-main delivery defect with a focused change and no identified patch bugs. The overlapping PR is also unproven, so it does not justify closing this contribution. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Twitch plugin connects incoming chat messages to an OpenClaw agent and sends replies back to chat. Its target normalizer translates internal conversation addresses into channel names for the Twitch client. flowchart LR
A[Twitch chat mention] --> B[Agent reply]
B --> C[Internal channel address]
C --> D[Channel normalization]
D --> E{Target allowed}
E -->|Yes| F[Twitch outbound sender]
E -->|No| G[Delivery error]
F --> H[Twitch chat client]
Technical reviewBest possible solution: Keep the focused normalization repair, preserve delivery safeguards, and track the linked report’s separate runtime-handoff symptoms independently. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the normalization failure: the monitor creates twitch:channel: targets that current-main outbound normalization forwards unchanged. This review did not execute a live Twitch reproduction. Is this the best way to solve the issue? Yes, extending the existing shared channel normalizer is a narrow repair for the invalid-target error and preserves existing valid inputs; it does not establish a fix for the separate runtime-handoff errors. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da67a08b20eb. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +24. Total +29 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 HistoryReview history (1 earlier review cycle)
Reviewed October 9, 2026, 1:17 AM ET / 05:17 UTC (Revision 2). |
|
Boundary proof for the review gate, run at the current head (eb7d0af). No Twitch bot account is available in this environment, so this drives the real plugin outbound path with a transport capture at the client-manager send seam ( Current head: Same harness against the pre-fix normalizer (merge-base version of The rejected string from the report ( @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for digging into this. On current main (fafa5d4) we ran a built Gateway with real Twurple IRC against a local Twitch contract server, with block streaming off so the final reply goes through final delivery. The final-reply target was twitch:channel:proofroom, durable delivery declined it at preflight, and the direct fallback sent PRIVMSG #proofroom correctly. We couldn't reach a real configuration where durable final delivery accepts the prefixed target and then fails. Closing for now. If you can share the config or logs from a run where a Twitch final reply actually failed or went to the wrong channel, reopen and we'll pick it up. |
[AI-assisted] Closes #166672
What Problem This Solves
Fixes: Twitch automatic replies never arrive when the reply target carries the internal
twitch:channel:prefix, which is every reply routed through the monitor.User Impact
User impact: mentioning a connected Twitch bot now gets its reply delivered to the same channel, instead of the send failing with
"twitch:channel:<name>" is not a valid user or channel name. Prefixed and unprefixed allowlist entries also match the same normalized channel either way.Why This Change Was Made
The monitor builds reply and durable targets as
twitch:channel:<name>, but the channel normalization the outbound adapter runs only stripped a leading#. The prefixed form therefore reached Twitch unchanged and was rejected. The prefix is now stripped at the same normalization owner, soresolveTarget,sendText, and allowlist entries all agree on the bare channel name.The reporter's second error (
PlatformMessageNotDispatchedError/ runtime generation superseded) is a separate handoff path and is not claimed here.Evidence
normalizeTwitchChannel("twitch:channel:foo")returned the input unchanged whilemonitor.tssetsreply.toanddelivery.durableto exactly that shape;sendTextthen normalizes again and still passes the prefixed form to the client.resolveTargetcases fail on the original code (twitch:channel:MyChannelresolves to itself; a prefixed target does not match an unprefixed allowlist entry) and pass with the fix.pnpm test extensions/twitch --maxWorkers=1: 227/227 passed across 17 files, 20.9s wall, including the monitor, plugin, config, and access-control suites that exercise this normalizer.twitchOutbound.resolveTarget+sendTextwith the exacttwitch:channel:<name>target shapemonitor.tsbuilds for a mention reply, transport capture standing in at the client-manager send seam that callsclient.say. Current head logsclient.say(channel="proofchan", text="TWITCH-REPRO-1")and the delivered reply lands back in the originating channel; a prefixed#allowlist entry also matches. The same harness against the pre-fix normalizer logsclient.say(channel="twitch:channel:proofchan", ...)(the string Twitch rejects) and fails the allowlist match. Full output in the 2026-10-09 proof comment.oxfmtand scopedoxlintclean on the two touched files.Gap: no live Twitch delivery was run (needs a real bot account); the proof is at the plugin-owned boundary that produces the transport call, red/green against the original normalizer.