Repository navigation
fix(gateway): stop inferring forwarded senders from text - #138579
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
This restores the correct authority boundary: displayed sender identity must come from producer-owned structured provenance, never from relayed message text that can assert an arbitrary sourceSession. Removing the prompt-header fallback prevents false native attribution while preserving the existing generic forwarded-message presentation when provenance is absent. The dual-transport regression is the important one here.
|
Codex review: needs real behavior proof before merge. Reviewed September 16, 2026, 4:16 AM ET / 08:16 UTC (Revision 7). ClawSweeper reviewWhat this changesForwarded chat history derives sender labels and session links only from structured provenance, with regression coverage across HTTP, WebSocket, and pagination. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: the attribution defect remains on current main and the latest release, and this focused patch addresses it without a correctness finding. Recorded Gateway results support the repair, but required before/after UI screenshots are no longer attached. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway converts stored conversation messages into display history consumed by HTTP, WebSocket, and the Control UI. Forwarded-message attribution determines which agent label and source-session link users see. flowchart LR
A[Stored forwarded message] --> B[Shared history projection]
B --> C{Structured source present?}
C -->|Yes| D[Recorded sender and session link]
C -->|No| E[Generic forwarded label]
D --> F[HTTP and WebSocket history]
E --> F
F --> G[Control UI conversation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -14, Tests +83. Total +69 across 3 files. View PR surface stats
Review metricsNone. Mantis proof suggestionTargeted web UI chat evidence could replace the expired screenshots and verify the affected sender chips. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep attribution in the shared projection, preserve stored messages, and render unknown sources generically while leaving broader claimed-origin and adopter semantics to the linked issue. Do we have a high-confidence way to reproduce the issue? Yes, from source: a sessions_send history row with no structured source key but an asserted sourceSession header receives that asserted sender on current main. This review did not execute the runtime; the contributor records matching before/after Gateway observations. Is this the best way to solve the issue? Yes. Removing the fallback at the shared projection uses the existing generic presentation and preserves normal structured attribution without rewriting persisted history. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae88f9aff5fb. 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 (6 earlier review cycles)
|
|
@openclaw-mantis verify web UI chat history renders a source-less forwarded relay generically while retaining the structured-provenance sender label when present. |
|
Added the requested real behavior proof (33f3ccd):
PR body Evidence section updated accordingly (proof tier L3). @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use structured source provenance for forwarded history attribution. Keep legacy entries with unknown sources generic, without changing their stored messages. Preserve both public history transports and paging under the existing shared Gateway test harness. Related: openclaw#138493
|
Rebased onto current main ( Two housekeeping items addressed:
Re-validation on the rebased tree: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Body restored to the maintainer-edited version verbatim; my earlier edit had rewritten parts of it. The only changes now are the 404 screenshot table replaced with the equivalent recorded transport output, and one line noting the rebase onto current main. |
|
landpr-approve-admin-merge |
|
Thanks @LiuwqGit! Proof: Imported historical messages show generic attribution for text-only sources and preserve recorded sender links in history and the chat interface.
|
Related: #138493
What Problem This Solves
Forwarded history could turn a sender asserted in text into another agent's chip and session link.
Why This Change Was Made
This state has one writer: the shared history projection. Only structured provenance identifies the sender. This removes the legacy text fallback from #132054.
User Impact
Unknown sources show “Forwarded message.” Recorded sources keep their chip, color, and navigation.
Evidence
A released Gateway’s public
agentrequests created historical rows; currentdoctor --fiximported them. HTTP history and WebSocketchat.historyinvented a source on main; the fix returns generic attribution withoutsenderSession. Five-page history, access denial, currentsessions_send, source navigation, and byte preservation passed.Compatibility
No stored-data, schema, protocol, config, or import change. Wider provenance design remains in #138493.
Consumers
HTTP, WebSocket, and Control UI share the projection.
Invalidation
Existing history refresh and grouping rules remain.
Tests
The registered HTTP/WebSocket regression covers recorded, asserted, and malformed sources over three pages. It fails on main and passes with the fix. Five selected correction checks pass.