fix(gateway): hide transcript-only history artifacts#79172
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Source inspection shows current main returns raw recent Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land a rebased consumer-history filter that preserves raw transcripts and hides true internal artifacts, while distinguishing visible Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main returns raw recent Is this the best way to solve the issue? No, not as written. Filtering at the shared Gateway history boundary is the right shape, but the predicate must not treat every Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ea16a5e9e10c. |
Summary
chat.historyandsessions.getcould surface transcript-only OpenClaw assistant rows (delivery-mirror/gateway-injected) as normal assistant messages.sessions.getafter the same over-read.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
chat.historyandsessions.get, with limits applied after hidden rows are removed.chat.history,sessions.get, and HTTP/SSE session history paths against JSONL transcript files.pnpm test src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts src/gateway/server.sessions.store-rpc.test.ts src/gateway/sessions-history-http.test.ts;pnpm exec oxfmt --check --threads=1 src/config/sessions/transcript-artifacts.ts src/gateway/chat-display-projection.ts src/gateway/server-methods/chat.ts src/gateway/server-methods/sessions.ts src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts src/gateway/server.sessions.store-rpc.test.ts src/gateway/sessions-history-http.test.ts docs/gateway/protocol.md CHANGELOG.md;git diff --check;pnpm check:changed.Test Files 3 passed (3); Tests 104 passed (104)andTest Files 1 passed (1); Tests 12 passed (12)from the targeted gateway run; copied terminal output:All matched files use the correct format.; copied terminal output:pnpm check:changed ... node scripts/check-changed.mjsexited0; copied terminal output:git diff --checkexited0.chat.historyandsessions.getreturn the older visible user row plus the real assistant row when the raw tail also contains hiddendelivery-mirrorandgateway-injectedrows, preserving visible limit behavior and raw transcript sequence metadata.pnpm check/pnpm testsweeps.mainshowedchat.historyreading only the requested raw tail before projection andsessions.getreturning raw recent messages without filtering transcript-only OpenClaw assistant artifacts.Root Cause (if applicable)
main.Regression Test Plan (if applicable)
src/gateway/server-methods/server-methods.test.ts,src/gateway/server.chat.gateway-server-chat-b.test.ts,src/gateway/server.sessions.store-rpc.test.ts,src/gateway/sessions-history-http.test.ts.provider:"openclaw"withmodel:"delivery-mirror"ormodel:"gateway-injected"still produce the requested visiblechat.history/sessions.getrows after filtering.User-visible / Behavior Changes
chat.historyandsessions.getno longer return transcript-only OpenClaw assistant artifacts as visible assistant messages. Requested history limits now apply to visible rows after those artifacts are removed.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
provider:"openclaw", model:"delivery-mirror",provider:"openclaw", model:"gateway-injected", and a real assistant row.chat.historyorsessions.getwithlimit: 2.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
chat.history, RPCsessions.get, and HTTP/SSE session history behavior; formatting; whitespace; changed gate.delivery-mirrorandgateway-injectedartifact models; visible limit applied after hidden rows; raw sequence metadata preserved across hidden rows.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
sessions.getartifacts may see fewer rows.