mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:07:39 +00:00
fix(webchat): suppress NO_REPLY token in chat transcript rendering (#32183)
* fix(types): resolve pre-existing TS errors in agent-components and pairing-store
- agent-components.ts: normalizeDiscordAllowList returns {allowAll, ids, names},
not an array — use ids.values().next().value instead of [0] indexing
- pairing-store.ts: add non-null assertions for stat after cache-miss guard
(resolveAllowFromReadCacheOrMissing returns early when stat is null)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(webchat): suppress NO_REPLY token in chat transcript rendering
Filter assistant NO_REPLY-only entries from chat.history responses at
the gateway API boundary and add client-side defense-in-depth guards in
the UI chat controller so internal silent tokens never render as visible
chat bubbles.
Two-layer fix:
1. Gateway: extractAssistantTextForSilentCheck + isSilentReplyText
filter in sanitizeChatHistoryMessages (entry.text takes precedence
over entry.content to avoid dropping messages with real text)
2. UI: isAssistantSilentReply + isSilentReplyStream guards on all 5
message insertion points in handleChatEvent and loadChatHistory
Fixes #32015
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(webchat): align isAssistantSilentReply text/content precedence with gateway
* webchat: tighten NO_REPLY transcript and delta filtering
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -374,10 +374,11 @@ async function readAllowFromStateForPathWithExists(
|
||||
allowFrom: [],
|
||||
});
|
||||
const entries = normalizeAllowFromList(channel, value);
|
||||
// stat is guaranteed non-null here: resolveAllowFromReadCacheOrMissing returns early when stat is null.
|
||||
setAllowFromReadCache(filePath, {
|
||||
exists,
|
||||
mtimeMs: stat.mtimeMs,
|
||||
size: stat.size,
|
||||
mtimeMs: stat!.mtimeMs,
|
||||
size: stat!.size,
|
||||
entries,
|
||||
});
|
||||
return { entries, exists };
|
||||
@@ -419,13 +420,14 @@ function readAllowFromStateForPathSyncWithExists(
|
||||
}
|
||||
return { entries: [], exists: false };
|
||||
}
|
||||
// stat is guaranteed non-null here: resolveAllowFromReadCacheOrMissing returns early when stat is null.
|
||||
try {
|
||||
const parsed = JSON.parse(raw) as AllowFromStore;
|
||||
const entries = normalizeAllowFromList(channel, parsed);
|
||||
setAllowFromReadCache(filePath, {
|
||||
exists: true,
|
||||
mtimeMs: stat.mtimeMs,
|
||||
size: stat.size,
|
||||
mtimeMs: stat!.mtimeMs,
|
||||
size: stat!.size,
|
||||
entries,
|
||||
});
|
||||
return { entries, exists: true };
|
||||
@@ -433,8 +435,8 @@ function readAllowFromStateForPathSyncWithExists(
|
||||
// Keep parity with async reads: malformed JSON still means the file exists.
|
||||
setAllowFromReadCache(filePath, {
|
||||
exists: true,
|
||||
mtimeMs: stat.mtimeMs,
|
||||
size: stat.size,
|
||||
mtimeMs: stat!.mtimeMs,
|
||||
size: stat!.size,
|
||||
entries: [],
|
||||
});
|
||||
return { entries: [], exists: true };
|
||||
|
||||
Reference in New Issue
Block a user