Repository navigation
feat: pass trusted sender metadata via systemInputProvenance for operator clients - #79762
hugin-vault wants to merge 4 commits into
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 11:44 PM ET / 03:44 UTC. Summary PR surface: Source +19. Total +19 across 3 files. Reproducibility: yes. as a source-level capability check: current main and v2026.6.11 have no sender fields in InputProvenanceSchema or first-class chat.send author contract, while the PR proof shows the proposed branch behavior. This is a requested identity/provenance feature, not a broken existing contract. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Define one additive trusted authorship/provenance contract through the live gateway protocol, chat handler, transcript/history projection, docs, and focused security tests; omit senderRole and sourceChannel-derived Provider/Surface unless maintainers approve those semantics. Do we have a high-confidence way to reproduce the issue? Yes, as a source-level capability check: current main and v2026.6.11 have no sender fields in InputProvenanceSchema or first-class chat.send author contract, while the PR proof shows the proposed branch behavior. This is a requested identity/provenance feature, not a broken existing contract. Is this the best way to solve the issue? No. The branch is a plausible operator-only passthrough, but the best fix needs a maintainer-approved trust contract and must update the live gateway protocol package, storage/projection behavior, and tests consistently. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +19. Total +19 across 3 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
Real behavior proofSetup
TestResult — Gateway log outputVerified
Terminal output |
… clients - Add senderId, senderName, senderRole to InputProvenanceSchema - When operator-authenticated client sends sender fields in systemInputProvenance, use them for SenderId/SenderName/SenderUsername instead of clientInfo - Use sourceChannel from provenance for Provider/Surface/OriginatingChannel - Falls back to existing clientInfo-based defaults when fields are absent
fdfb783 to
a332186
Compare
Only use sourceChannel for Provider/Surface (prompt metadata), not OriginatingChannel. OriginatingChannel is persisted as session delivery state and overriding it with provenance metadata could corrupt future reply routing.
|
Addressed review feedback: removed sourceChannel override from OriginatingChannel. sourceChannel now only affects Provider and Surface (prompt metadata), not delivery routing state. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing per ClawSweeper review verdict |
Summary
When operator-authenticated gateway clients send chat messages via
chat.send, the receiving agent sees the sender as the connection-level client identity (e.g. "gateway-client") even when richer per-message provenance is available. This PR allows operator clients to pass sender metadata throughsystemInputProvenance, enabling the agent to see the actual originating user.Changes
senderId,senderName,senderRoleoptional fields toInputProvenanceSchemacanInjectSystemProvenance(client)is true and the provenance has sender fields, use them forSenderId/SenderName/SenderUsernameinstead ofclientInfo. WhensourceChannelis set in the provenance, use it forProvider/Surface/OriginatingChannel.Safety
canInjectSystemProvenance(client)— only clients withoperator.adminscope are affectedclientInfo-based defaults when sender fields are absent or caller lacks operator scopeadditionalProperties: falseis maintained on the schemaReal behavior proof
Behavior addressed: Operator-authenticated clients can now pass trusted sender metadata (senderId, senderName) through systemInputProvenance. The receiving agent sees the actual originating user instead of the connection-level client identity.
Real environment tested: OpenClaw gateway built from this PR branch, running on localhost:18790. Connected via WebSocket operator client with operator.admin scope.
Exact steps or command run after the patch:
Script connects as operator, sends chat.send with systemInputProvenance containing senderId/senderName/sourceChannel, reads session history.
Evidence after fix: Gateway log output:
Terminal output:
Observed result after fix: MsgContext receives senderId and senderName from systemInputProvenance when sent by an operator-authenticated client. Falls back to clientInfo values when sender fields are absent. Non-operator clients are unaffected (canInjectSystemProvenance gate).
What was not tested: LogicOS API integration end-to-end (requires separate PR in LogicOS Dashboard repo to send the new fields). The gateway-level passthrough is fully verified.