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

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - 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
fix(gateway): preserve active runs during plugin finaliza...
scotthuang · 2026-06-14 · via Recent Commits to openclaw:main

@@ -7,12 +7,14 @@ import { getRuntimeConfig } from "../config/io.js";

77

import { normalizeAgentId } from "../routing/session-key.js";

88

import type { SessionLifecycleEvent } from "../sessions/session-lifecycle-events.js";

99

import type { SessionTranscriptUpdate } from "../sessions/transcript-events.js";

10+

import type { ChatAbortControllerEntry } from "./chat-abort.js";

1011

import { projectChatDisplayMessage } from "./chat-display-projection.js";

1112

import type { GatewayBroadcastToConnIdsFn } from "./server-broadcast-types.js";

1213

import type {

1314

SessionEventSubscriberRegistry,

1415

SessionMessageSubscriberRegistry,

1516

} from "./server-chat.js";

17+

import { hasTrackedActiveSessionRun } from "./server-methods/session-active-runs.js";

1618

import { resolveSessionKeyForTranscriptFile } from "./session-transcript-key.js";

1719

import {

1820

attachOpenClawTranscriptMeta,

@@ -49,6 +51,7 @@ function buildGatewaySessionSnapshot(params: {

4951

label?: string;

5052

displayName?: string;

5153

parentSessionKey?: string;

54+

hasActiveRun?: boolean;

5255

}): Record<string, unknown> {

5356

const { sessionRow } = params;

5457

if (!sessionRow) {

@@ -61,6 +64,9 @@ function buildGatewaySessionSnapshot(params: {

6164

if (session && omitUnscopedGlobalGoal) {

6265

delete session.goal;

6366

}

67+

if (session && params.hasActiveRun !== undefined) {

68+

session.hasActiveRun = params.hasActiveRun;

69+

}

6470

return {

6571

...(session ? { session } : {}),

6672

updatedAt: sessionRow.updatedAt ?? undefined,

@@ -107,6 +113,7 @@ function buildGatewaySessionSnapshot(params: {

107113

modelProvider: sessionRow.modelProvider,

108114

model: sessionRow.model,

109115

status: sessionRow.status,

116+

...(params.hasActiveRun === undefined ? {} : { hasActiveRun: params.hasActiveRun }),

110117

subagentRunState: sessionRow.subagentRunState,

111118

hasActiveSubagentRun: sessionRow.hasActiveSubagentRun,

112119

startedAt: sessionRow.startedAt,

@@ -122,6 +129,7 @@ export function createTranscriptUpdateBroadcastHandler(params: {

122129

broadcastToConnIds: GatewayBroadcastToConnIdsFn;

123130

sessionEventSubscribers: SessionEventSubscribers;

124131

sessionMessageSubscribers: SessionMessageSubscribers;

132+

chatAbortControllers: Map<string, ChatAbortControllerEntry>;

125133

}) {

126134

let broadcastQueue = Promise.resolve();

127135

return (update: SessionTranscriptUpdate): void => {

@@ -138,6 +146,7 @@ async function handleTranscriptUpdateBroadcast(

138146

broadcastToConnIds: GatewayBroadcastToConnIdsFn;

139147

sessionEventSubscribers: SessionEventSubscribers;

140148

sessionMessageSubscribers: SessionMessageSubscribers;

149+

chatAbortControllers: Map<string, ChatAbortControllerEntry>;

141150

},

142151

update: SessionTranscriptUpdate,

143152

): Promise<void> {

@@ -176,13 +185,24 @@ async function handleTranscriptUpdateBroadcast(

176185

)

177186

: undefined;

178187

}

188+

const sessionRow = loadGatewaySessionRow(sessionKey, {

189+

agentId: visibleAgentId,

190+

transcriptUsageMaxBytes: 64 * 1024,

191+

});

192+

const hasActiveRun = sessionRow

193+

? hasTrackedActiveSessionRun({

194+

context: params,

195+

requestedKey: sessionKey,

196+

canonicalKey: sessionRow.key,

197+

...(sessionRow.key === "global" && visibleAgentId ? { agentId: visibleAgentId } : {}),

198+

defaultAgentId: normalizeAgentId(resolveDefaultAgentId(getRuntimeConfig())),

199+

})

200+

: false;

179201

const sessionSnapshot = buildGatewaySessionSnapshot({

180-

sessionRow: loadGatewaySessionRow(sessionKey, {

181-

agentId: visibleAgentId,

182-

transcriptUsageMaxBytes: 64 * 1024,

183-

}),

202+

sessionRow,

184203

agentId: visibleAgentId,

185204

includeSession: true,

205+

hasActiveRun,

186206

});

187207

const rawMessage = attachOpenClawTranscriptMeta(update.message, {

188208

...(typeof update.messageId === "string" ? { id: update.messageId } : {}),