fix(gateway): preserve mixed assistant history text#78157
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. by source inspection: current main drops commentary-phase assistant messages and filters phased assistant text down to Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this focused projection fix after maintainer review and exact-head checks finish, then handle any remaining provider-specific disappearing-history shape as a separate follow-up. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main drops commentary-phase assistant messages and filters phased assistant text down to Is this the best way to solve the issue? Yes for the mixed tool-use transcript shape: projecting non-empty text out of assistant turns that include tool history keeps durable progress visible while pure commentary-only turns stay hidden. It should not be treated as the complete answer for a separate provider-specific What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b9f711089a1a. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a Gateway chat.history regression where persisted assistant transcript turns that include both visible progress text and tool-use metadata were being filtered out (due to being classified as “commentary”), causing prior assistant messages to vanish from the Control UI after subsequent user messages.
Changes:
- Adjust assistant-message projection to preserve visible assistant text when the same assistant turn also contains tool-use blocks.
- Keep “pure commentary” assistant turns hidden to preserve existing Control UI filtering behavior.
- Add unit + JSONL-backed gateway regression tests covering the mixed tool-use + visible text case (issue #77374), and document the fix in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/gateway/chat-display-projection.ts | Projects visible assistant text from mixed tool-use content so these assistant turns remain displayable, while still hiding pure commentary-only turns. |
| src/gateway/server-methods/server-methods.test.ts | Adds unit coverage for mixed tool-use assistant messages retaining visible text, plus a regression asserting pure commentary remains hidden. |
| src/gateway/server.chat.gateway-server-chat-b.test.ts | Adds JSONL-backed gateway regression test ensuring chat.history returns the assistant visible text for mixed tool-use transcript turns. |
| CHANGELOG.md | Records the Control UI chat-history fix and references #77374. |
|
@copilot resolve the merge conflicts in this pull request |
Resolved. The only conflict was in |
9e6a02e to
b71c86c
Compare
b71c86c to
048266c
Compare
Summary
chat.historydisplay projection so persisted assistant transcript turns with both visible text and tool-use metadata still produce a visible assistant message.Fixes #77374.
Verification
pnpm test src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts- passed, 2 files / 100 tests.pnpm exec oxfmt --check --threads=1 src/gateway/chat-display-projection.ts src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts- passed.git diff --check- passed.pnpm changed:lanes --json- selected core, coreTests, docs for the four-file patch.pnpm check:changed- passed ontbx_01kqxc13vce62hpyv3kza2ne19/ https://github.com/openclaw/openclaw/actions/runs/25410429032. Note: the Testbox sync reported 1230 changed files and selectedlanes=all; the local diff remained the intended four files.