fix(webchat): suppress NO_REPLY control token in chat UI#32045
fix(webchat): suppress NO_REPLY control token in chat UI#32045liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 260cd5982d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (finalMessage && !isSilentAssistantMessage(finalMessage)) { | ||
| state.chatMessages = [...state.chatMessages, finalMessage]; | ||
| return null; | ||
| } |
There was a problem hiding this comment.
Return null for silent final events from other runs
In the cross-run branch (payload.runId !== state.chatRunId), a final assistant message that is filtered as NO_REPLY now falls through to return "final" instead of returning null. That return value is treated as a terminal event by handleTerminalChatEvent (in ui/src/ui/app-gateway.ts), which always calls resetToolStream and flushChatQueueForEvent, so background housekeeping finals can clear tool-stream UI for an unrelated active run. Since non-silent cross-run finals already return null, silent filtered finals should follow the same non-terminal path.
Useful? React with 👍 / 👎.
Greptile SummaryFixes the visibility of Key changes:
Implementation quality:
Confidence Score: 5/5
Last reviewed commit: 260cd59 |
|
Closing as superseded by #32183, which is now merged and covers the NO_REPLY history/UI guardrails with regression tests. |
Summary
Describe the problem and fix in 2–5 bullets:
NO_REPLY, leaking a silent control token into visible chat.chat.history) and live chat events (delta/final/abortedfallback paths).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Control UI no longer renders assistant messages that are exact
NO_REPLYcontrol tokens when loading chat history or processing live chat events.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
NO_REPLY.chat.eventflows where assistant delta/final/aborted fallback can carryNO_REPLYtext.Expected
NO_REPLYcontrol-token messages are not visible in chat history.NO_REPLYtoken text.Actual
NO_REPLYcould appear as a visible assistant message.Evidence
Attach at least one:
Validation run on this branch:
pnpm --dir ui exec vitest run src/ui/controllers/chat.test.ts --config vitest.config.tspnpm lint ui/src/ui/controllers/chat.ts ui/src/ui/controllers/chat.test.ts CHANGELOG.mdpnpm tsgopnpm exec oxfmt --check ui/src/ui/controllers/chat.ts ui/src/ui/controllers/chat.test.ts CHANGELOG.mdHuman Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
ui/src/ui/controllers/chat.ts,ui/src/ui/controllers/chat.test.ts,CHANGELOG.md.Risks and Mitigations