#10828: Filter out bare reset/new session prompts from chat UI
app: web-ui
stale
size: S
Cluster:
Webchat NO_REPLY Handling
## Summary
Filters out bare reset/new session system messages that leak into the chat UI by using exact matching on the full prompt text.
## Problem
When creating a new session via /new or /reset, the system message was visible in the chat interface, creating unnecessary UI clutter.
## Solution
- Created `@openclaw/shared-constants` package to define the reset prompt in a single location
- Updated filter to use exact role + content matching (`===`) instead of substring matching
- Both backend and frontend now import from the shared package, eliminating data duplication
## Addresses Code Review Feedback
- **Greptile:** Fixed overbroad substring filtering that could hide legitimate messages
- **HenryLoenwind:** Eliminated data duplication by referencing the prompt through a shared package instead of copying the text
## Changes
- `packages/shared-constants/` - New shared package with prompt constants
- `ui/src/ui/views/chat.ts` - Updated to use exact matching and import from shared package
- `src/auto-reply/reply/get-reply-run.ts` - Updated to import from shared package
## Testing
Verified in dev environment that only bare reset messages are filtered, not legitimate system messages.
<!-- greptile_comment -->
## Greptile Overview
### Greptile Summary
- Adds a `BARE_SESSION_RESET_PROMPT` constant in a shared package and filters chat history items in `ui/src/ui/views/chat.ts` so reset/new-session system messages don't render in the chat thread.
- Uses exact matching (`===`) on both role and trimmed content to avoid filtering legitimate messages.
- Both backend and frontend import from the shared constants package, eliminating data duplication.
### Confidence Score: 4/5
- The filtering is now precise and only targets bare reset messages.
- Shared constants package properly addresses DRY concerns.
- Small, localized change with clear separation of concerns.
<!-- /greptile_comment -->
Most Similar PRs
#8742: fix(webchat): hide internal system messages from UI (#7440)
by revenuestack · 2026-02-04
73.7%
#14018: fix: auto-remind AI to check workspace context files on session reset
by WalterSumbon · 2026-02-11
73.1%
#12615: Add configurable resetPrompt option to config, customizing prompt a...
by htahboub · 2026-02-09
72.3%
#8334: fix(webchat): Filter NO_REPLY messages from chat history
by vishaltandale00 · 2026-02-03
70.7%
#11613: fix: clear stale model metadata on /new and /reset
by mcaxtr · 2026-02-08
70.5%
#19343: Refactor chat state management: reset chat messages and queue on se...
by saurav470 · 2026-02-17
70.4%
#10898: fix(mac): adopt canonical session key and add reset triggers
by Nachx639 · 2026-02-07
70.4%
#18694: fix(ui): reset session key to main after /new in webchat
by Phineas1500 · 2026-02-17
69.9%
#14309: fix(ui): resolve chat event session key mismatch
by justonlyforyou · 2026-02-11
69.9%
#22465: fix: preserve session history after API error (400/503) in mid-conv...
by hhy5562877 · 2026-02-21
69.9%