Repository navigation
fix(twitch): retain native sender identity in execution audits - #130730
Conversation
Forward the registered channel runtime and actual account identity, keeping native participants distinct from role authorization. Normalize the all role at the Twitch policy producer and preserve unknown and disabled-collection paths. Cover actual registered-plugin ingress and native reply delivery, and drain asynchronous monitor test work before cleanup. Related to #122863; no shared authorization or storage change.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 27, 2026, 2:31 AM ET / 06:31 UTC. ClawSweeper reviewWhat this changesThe PR preserves account-scoped native Twitch sender identity in opt-in execution audits while keeping role-based admission separate from participant identity. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the provenance repair follows the correct registered-runtime boundary, but its new Twitch source-inventory entry still asserts the removed global-runtime marker and will fail the focused contract test. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTwitch callbacks are admitted by the bundled plugin and handed to the registered channel runtime. That runtime builds agent context and attaches validated diagnostic provenance before a reply is dispatched. flowchart LR
A[Twitch callback] --> B[Twitch plugin]
B --> C[Access and route resolution]
C --> D[Registered channel runtime]
D --> E[Context and audit provenance]
E --> F[Agent reply dispatch]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +358, Docs +13. Total +379 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Update the Twitch inventory to the injected registered-runtime marker, then complete the focused and exact-head validation before merge. Do we have a high-confidence way to reproduce the issue? Yes: the source inventory and changed monitor call provide a high-confidence deterministic failure path, although this read-only review did not execute it. Is this the best way to solve the issue? Yes for the provenance repair: only the host-wrapped runtime can attach host-minted one-shot evidence; the inventory assertion needs the corresponding update. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a3eb0692a24f. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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.
|
…law#130730) * fix(twitch): retain native sender identity in execution audits Forward the registered channel runtime and actual account identity, keeping native participants distinct from role authorization. Normalize the all role at the Twitch policy producer and preserve unknown and disabled-collection paths. Cover actual registered-plugin ingress and native reply delivery, and drain asynchronous monitor test work before cleanup. Related to openclaw#122863; no shared authorization or storage change. * test(twitch): track the registered context builder in inventory * test(twitch): honor host and plugin contract boundaries
What Problem This Solves
Opt-in Twitch execution audits lost the native sender's account-scoped provenance even though replies succeeded. Moderator authorization could substitute a role for the participant, and
allowedRoles: ["all"]could overstate sender-policy enforcement.Fixes #130728. Related: #122863.
Why This Change Was Made
The Twitch producer now forwards the Gateway's registered runtime, passes the real account ID through both access checks, and keeps the native user ID primary with roles used only as authorization aliases. The declared
allrole becomes the existing SDK wildcard at the policy boundary. This removes duplicate wildcard logic without changing shared authorization or widening plugin trust.The reply fixture now awaits and drains accepted delivery work, fixing an observed cold-dispatch race that leaked a reply into the next case. Current-main integration also updates evidence expectations for its identifier-authentication contract; no assertion or build budget was weakened.
User Impact
Enabled audit collection attributes allowed Twitch turns to the correct native sender and account. Missing native IDs stay unknown; external installations remain untrusted for this evidence path; disabled collection permits normal replies without collecting identity. Stored identities are opaque rather than raw Twitch IDs. Mention gating, allowlist precedence, explicit-empty denial, and supported role decisions remain unchanged.
No configuration, schema, storage, SDK API, or host authorization change. AI-assisted.
Release-note intent: Fix account-scoped native sender attribution in opt-in Twitch execution audits while preserving existing admission and reply behavior.
Evidence
c9c2f0071dccb056a8ba8dfa1e019c47897dd634: 95 focused functional tests pass across registered-host ingress, all supported roles, native-ID absence, external-origin and disabled-collection negatives, startup lifecycle, reply delivery, and context-builder inventory. An additional 35 plugin-artifact and SDK-shape tests pass. The final host test uses the real account resolver through the canonical public-artifact contract.c9c2f007: four isolated policy configurations, 24 transport inputs, exactly 14 replies/model requests/successful terminal runs, and 10 negative inputs with no extra output. Public audit inspection verifies stable native identity, distinct participants, account separation, role/open/wildcard attribution-only evidence, missing-ID unknown state, and disabled identity collection. All four Gateways exited cleanly, all listeners closed, and the frozen source/runtime graph remained unchanged.ci-gate. Native prepare/merge is next.Relative to the integrated main baseline: production +41/-42 (net -1), tests +469/-102, docs +13. The existing producer owns the repair; no additional identity or authorization layer is introduced.
The generic normalized-wildcard diagnostic fact remains a separate, unproven follow-up because sibling adapters and shared
hasWildcardalso participate in authoritative DM and mutable-identifier policy. This PR does not claim that shared-policy repair.