惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
爱范儿
爱范儿
量子位
Martin Fowler
Martin Fowler
V
V2EX
博客园 - 三生石上(FineUI控件)
I
InfoQ
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
Engineering at Meta
Engineering at Meta

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix telegram partial draft fragments · openclaw/openclaw@...
2026-05-10 · via Recent Commits to openclaw:main

@@ -110,6 +110,51 @@ const silentReplyDispatchLogger = createSubsystemLogger("telegram/silent-reply-d

110110

/** Minimum chars before sending first streaming message (improves push notification UX) */

111111

const DRAFT_MIN_INITIAL_CHARS = 30;

112112113+

function appendWithOverlap(previous: string, fragment: string): string {

114+

const maxOverlap = Math.min(previous.length, fragment.length);

115+

for (let overlap = maxOverlap; overlap > 0; overlap -= 1) {

116+

if (previous.endsWith(fragment.slice(0, overlap))) {

117+

return `${previous}${fragment.slice(overlap)}`;

118+

}

119+

}

120+

return `${previous}${fragment}`;

121+

}

122+123+

function looksLikeDraftDeltaFragment(previous: string, text: string): boolean {

124+

if (!previous || !text) {

125+

return false;

126+

}

127+

if (text.startsWith(previous) || previous.startsWith(text)) {

128+

return false;

129+

}

130+

if (/^\s/.test(text)) {

131+

return true;

132+

}

133+

if (previous.length < DRAFT_MIN_INITIAL_CHARS) {

134+

return true;

135+

}

136+

if (/\s$/.test(previous) && text.length <= DRAFT_MIN_INITIAL_CHARS) {

137+

return true;

138+

}

139+

return text.length <= Math.max(16, Math.floor(previous.length / 2));

140+

}

141+142+

function resolveDraftPartialText(previous: string, text: string): string | undefined {

143+

if (!previous) {

144+

return text;

145+

}

146+

if (text === previous) {

147+

return undefined;

148+

}

149+

if (text.startsWith(previous)) {

150+

return text;

151+

}

152+

if (previous.startsWith(text) && text.length < previous.length) {

153+

return undefined;

154+

}

155+

return looksLikeDraftDeltaFragment(previous, text) ? appendWithOverlap(previous, text) : text;

156+

}

157+113158

async function resolveStickerVisionSupport(cfg: OpenClawConfig, agentId: string) {

114159

try {

115160

const catalog = await loadModelCatalog({ config: cfg });

@@ -717,7 +762,8 @@ export const dispatchTelegramMessage = async ({

717762

if (!laneStream || !text) {

718763

return;

719764

}

720-

if (text === lane.lastPartialText) {

765+

const nextText = resolveDraftPartialText(lane.lastPartialText, text);

766+

if (!nextText) {

721767

return;

722768

}

723769

if (lane === answerLane) {

@@ -729,15 +775,8 @@ export const dispatchTelegramMessage = async ({

729775

}

730776

lane.hasStreamedMessage = true;

731777

lane.finalized = false;

732-

if (

733-

lane.lastPartialText &&

734-

lane.lastPartialText.startsWith(text) &&

735-

text.length < lane.lastPartialText.length

736-

) {

737-

return;

738-

}

739-

lane.lastPartialText = text;

740-

laneStream.update(text);

778+

lane.lastPartialText = nextText;

779+

laneStream.update(nextText);

741780

};

742781

const ingestDraftLaneSegments = async (text: string | undefined, isReasoning?: boolean) => {

743782

const split = splitTextIntoLaneSegments(text, isReasoning);