fix(threading): keep compaction notices threaded after first assistant block
In replyToMode=first, the hasThreaded flag was set by the first assistant chunk, causing the completion notice (emitted after flush) to hit the `if (hasThreaded)` branch and have its replyToId stripped — making it an unthreaded top-level message. Fix: add an isCompactionNotice exemption inside the `hasThreaded` branch so that compaction notices (both start and completion) always retain their replyToId regardless of hasThreaded state, while non-notice payloads continue to behave as before. Addresses review comment https://github.com/openclaw/openclaw/pull/38805#discussion_r2901465625
This commit is contained in:
parent
1e381c6c8c
commit
e2dc9b1682
@ -42,6 +42,12 @@ export function createReplyToModeFilter(
|
||||
return payload;
|
||||
}
|
||||
if (hasThreaded) {
|
||||
// Compaction notices are transient status messages that should always
|
||||
// appear in-thread, even after the first assistant block has already
|
||||
// consumed the "first" slot. Let them keep their replyToId.
|
||||
if (payload.isCompactionNotice) {
|
||||
return payload;
|
||||
}
|
||||
return { ...payload, replyToId: undefined };
|
||||
}
|
||||
// Compaction notices are transient status messages — they should be
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user