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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园_首页
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
V
V2EX
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队

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): report draining state in readiness (#94915)...
markoub · 2026-06-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -53,7 +53,7 @@ import {

5353

pinActivePluginSessionExtensionRegistry,

5454

} from "../plugins/runtime.js";

5555

import type { PluginRuntime } from "../plugins/runtime/types.js";

56-

import { getTotalQueueSize } from "../process/command-queue.js";

56+

import { getTotalQueueSize, isGatewayDraining } from "../process/command-queue.js";

5757

import type { RuntimeEnv } from "../runtime.js";

5858

import {

5959

clearSecretsRuntimeSnapshot,

@@ -876,6 +876,7 @@ export async function startGatewayServer(

876876

startedAt: serverStartedAt,

877877

getStartupPending: isGatewayStartupPending,

878878

getStartupPendingReason: () => startupPendingReason,

879+

getGatewayDraining: isGatewayDraining,

879880

getEventLoopHealth: readinessEventLoopHealth.snapshot,

880881

shouldSkipChannelReadiness: () =>

881882

isTruthyEnvValue(process.env.OPENCLAW_SKIP_CHANNELS) ||

Original file line numberDiff line numberDiff line change

@@ -68,6 +68,7 @@ function createReadinessHarness(params: {

6868

accounts?: Record<string, Partial<ChannelAccountSnapshot>>;

6969

getStartupPending?: () => boolean;

7070

getStartupPendingReason?: Parameters<typeof createReadinessChecker>[0]["getStartupPendingReason"];

71+

getGatewayDraining?: Parameters<typeof createReadinessChecker>[0]["getGatewayDraining"];

7172

getEventLoopHealth?: Parameters<typeof createReadinessChecker>[0]["getEventLoopHealth"];

7273

shouldSkipChannelReadiness?: Parameters<

7374

typeof createReadinessChecker

@@ -83,6 +84,7 @@ function createReadinessHarness(params: {

8384

startedAt,

8485

getStartupPending: params.getStartupPending,

8586

getStartupPendingReason: params.getStartupPendingReason,

87+

getGatewayDraining: params.getGatewayDraining,

8688

getEventLoopHealth: params.getEventLoopHealth,

8789

shouldSkipChannelReadiness: params.shouldSkipChannelReadiness,

8890

cacheTtlMs: params.cacheTtlMs,

@@ -178,6 +180,35 @@ describe("createReadinessChecker", () => {

178180

});

179181

});

180182
183+

it("reports not ready while the gateway command queue is draining for restart", () => {

184+

withReadinessClock(() => {

185+

const { manager, readiness } = createReadinessHarness({

186+

getGatewayDraining: () => true,

187+

cacheTtlMs: 1_000,

188+

});

189+
190+

expect(readiness()).toEqual(failingSnapshot(["gateway-draining"]));

191+

expect(manager.getRuntimeSnapshot).not.toHaveBeenCalled();

192+

});

193+

});

194+
195+

it("does not cache gateway-draining readiness", () => {

196+

withReadinessClock(() => {

197+

let gatewayDraining = true;

198+

const { manager, readiness } = createReadinessHarness({

199+

getGatewayDraining: () => gatewayDraining,

200+

cacheTtlMs: 1_000,

201+

});

202+
203+

expect(readiness()).toEqual(failingSnapshot(["gateway-draining"]));

204+

expect(manager.getRuntimeSnapshot).not.toHaveBeenCalled();

205+
206+

gatewayDraining = false;

207+

expect(readiness()).toEqual(readySnapshot());

208+

expect(manager.getRuntimeSnapshot).toHaveBeenCalledTimes(1);

209+

});

210+

});

211+
181212

it("ignores disabled and unconfigured channels", () => {

182213

withReadinessClock(() => {

183214

const { readiness } = createReadinessHarness({

Original file line numberDiff line numberDiff line change

@@ -42,6 +42,7 @@ export function createReadinessChecker(deps: {

4242

startedAt: number;

4343

getStartupPending?: () => boolean;

4444

getStartupPendingReason?: () => string | undefined;

45+

getGatewayDraining?: () => boolean;

4546

getEventLoopHealth?: () => GatewayEventLoopHealth | undefined;

4647

shouldSkipChannelReadiness?: () => boolean;

4748

cacheTtlMs?: number;

@@ -61,6 +62,12 @@ export function createReadinessChecker(deps: {

6162

deps.getEventLoopHealth,

6263

);

6364

}

65+

if (deps.getGatewayDraining?.()) {

66+

return withEventLoopHealth(

67+

{ ready: false, failing: ["gateway-draining"], uptimeMs },

68+

deps.getEventLoopHealth,

69+

);

70+

}

6471

if (deps.shouldSkipChannelReadiness?.()) {

6572

return withEventLoopHealth({ ready: true, failing: [], uptimeMs }, deps.getEventLoopHealth);

6673

}