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

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security Blog

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
Feat/main session durable delivery pr (#75280) · openclaw...
MertBasar0 · 2026-05-05 · via Recent Commits to openclaw:main

@@ -116,12 +116,15 @@ function resolveMainSessionResumeBlockReason(messages: unknown[]): string | null

116116

return null;

117117

}

118118119-

function buildResumeMessage(): string {

120-

return (

119+

function buildResumeMessage(pendingFinalDeliveryText?: string | null): string {

120+

const base =

121121

"[System] Your previous turn was interrupted by a gateway restart while " +

122122

"OpenClaw was waiting on tool/model work. Continue from the existing " +

123-

"transcript and finish the interrupted response."

124-

);

123+

"transcript and finish the interrupted response.";

124+

if (pendingFinalDeliveryText) {

125+

return `${base}\n\nNote: The interrupted final reply was captured: "${pendingFinalDeliveryText}"`;

126+

}

127+

return base;

125128

}

126129127130

async function markSessionFailed(params: {

@@ -140,6 +143,13 @@ async function markSessionFailed(params: {

140143

entry.abortedLastRun = true;

141144

entry.endedAt = Date.now();

142145

entry.updatedAt = entry.endedAt;

146+

entry.pendingFinalDelivery = undefined;

147+

entry.pendingFinalDeliveryText = undefined;

148+

entry.pendingFinalDeliveryCreatedAt = undefined;

149+

entry.pendingFinalDeliveryLastAttemptAt = undefined;

150+

entry.pendingFinalDeliveryAttemptCount = undefined;

151+

entry.pendingFinalDeliveryLastError = undefined;

152+

entry.pendingFinalDeliveryContext = undefined;

143153

store[params.sessionKey] = entry;

144154

},

145155

{ skipMaintenance: true },

@@ -150,12 +160,13 @@ async function markSessionFailed(params: {

150160

async function resumeMainSession(params: {

151161

storePath: string;

152162

sessionKey: string;

163+

pendingFinalDeliveryText?: string | null;

153164

}): Promise<boolean> {

154165

try {

155166

await callGateway<{ runId: string }>({

156167

method: "agent",

157168

params: {

158-

message: buildResumeMessage(),

169+

message: buildResumeMessage(params.pendingFinalDeliveryText),

159170

sessionKey: params.sessionKey,

160171

idempotencyKey: crypto.randomUUID(),

161172

deliver: false,

@@ -170,13 +181,24 @@ async function resumeMainSession(params: {

170181

if (!entry) {

171182

return;

172183

}

184+

const now = Date.now();

173185

entry.abortedLastRun = false;

174-

entry.updatedAt = Date.now();

186+

entry.updatedAt = now;

187+

if (entry.pendingFinalDelivery || entry.pendingFinalDeliveryText) {

188+

entry.pendingFinalDeliveryLastAttemptAt = now;

189+

entry.pendingFinalDeliveryAttemptCount =

190+

(entry.pendingFinalDeliveryAttemptCount ?? 0) + 1;

191+

entry.pendingFinalDeliveryLastError = null;

192+

}

175193

store[params.sessionKey] = entry;

176194

},

177195

{ skipMaintenance: true },

178196

);

179-

log.info(`resumed interrupted main session: ${params.sessionKey}`);

197+

log.info(

198+

`resumed interrupted main session: ${params.sessionKey}${

199+

params.pendingFinalDeliveryText ? " (with pending payload)" : ""

200+

}`,

201+

);

180202

return true;

181203

} catch (err) {

182204

log.warn(`failed to resume interrupted main session ${params.sessionKey}: ${String(err)}`);

@@ -290,6 +312,7 @@ async function recoverStore(params: {

290312

const resumed = await resumeMainSession({

291313

storePath: params.storePath,

292314

sessionKey,

315+

pendingFinalDeliveryText: entry.pendingFinalDeliveryText,

293316

});

294317

if (resumed) {

295318

params.resumedSessionKeys.add(sessionKey);