mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 01:24:31 +00:00
fix: stabilize Telegram draft boundaries and suppress NO_REPLY lead leaks (#33169)
* fix: stabilize telegram draft stream message boundaries * fix: suppress NO_REPLY lead-fragment leaks * fix: keep underscore guard for non-NO_REPLY prefixes * fix: skip assistant-start rotation only after real lane rotation * fix: preserve finalized state when pre-rotation does not force * fix: reset finalized preview state on message-start boundary * fix: document Telegram draft boundary + NO_REPLY reliability updates (#33169) (thanks @obviyus)
This commit is contained in:
@@ -74,7 +74,8 @@ describe("stripSilentToken", () => {
|
||||
});
|
||||
|
||||
describe("isSilentReplyPrefixText", () => {
|
||||
it("matches uppercase underscore prefixes", () => {
|
||||
it("matches uppercase token lead fragments", () => {
|
||||
expect(isSilentReplyPrefixText("NO")).toBe(true);
|
||||
expect(isSilentReplyPrefixText("NO_")).toBe(true);
|
||||
expect(isSilentReplyPrefixText("NO_RE")).toBe(true);
|
||||
expect(isSilentReplyPrefixText("NO_REPLY")).toBe(true);
|
||||
@@ -84,9 +85,17 @@ describe("isSilentReplyPrefixText", () => {
|
||||
it("rejects ambiguous natural-language prefixes", () => {
|
||||
expect(isSilentReplyPrefixText("N")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("No")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("no")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("Hello")).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps underscore guard for non-NO_REPLY tokens", () => {
|
||||
expect(isSilentReplyPrefixText("HE", "HEARTBEAT_OK")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("HEART", "HEARTBEAT_OK")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("HEARTBEAT", "HEARTBEAT_OK")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("HEARTBEAT_", "HEARTBEAT_OK")).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects non-prefixes and mixed characters", () => {
|
||||
expect(isSilentReplyPrefixText("NO_X")).toBe(false);
|
||||
expect(isSilentReplyPrefixText("NO_REPLY more")).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user