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

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
M
MIT News - Artificial intelligence
量子位
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
罗磊的独立博客
F
Fortinet All Blogs
美团技术团队
博客园_首页
博客园 - 【当耐特】
L
LangChain Blog
月光博客
月光博客
腾讯CDC
The Cloudflare Blog
D
Docker
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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(cli): honor route-first log level (#93460) · openclaw...
ooiuuii · 2026-06-16 · via Recent Commits to openclaw:main

@@ -47,6 +47,7 @@ describe("tryRouteCli", () => {

4747

let loggingState: typeof import("../logging/state.js").loggingState;

4848

let originalDisableRouteFirst: string | undefined;

4949

let originalHideBanner: string | undefined;

50+

let originalLogLevel: string | undefined;

5051

let originalForceStderr: boolean;

51525253

beforeAll(async () => {

@@ -58,8 +59,10 @@ describe("tryRouteCli", () => {

5859

vi.clearAllMocks();

5960

originalDisableRouteFirst = process.env.OPENCLAW_DISABLE_ROUTE_FIRST;

6061

originalHideBanner = process.env.OPENCLAW_HIDE_BANNER;

62+

originalLogLevel = process.env.OPENCLAW_LOG_LEVEL;

6163

delete process.env.OPENCLAW_DISABLE_ROUTE_FIRST;

6264

delete process.env.OPENCLAW_HIDE_BANNER;

65+

delete process.env.OPENCLAW_LOG_LEVEL;

6366

originalForceStderr = loggingState.forceConsoleToStderr;

6467

loggingState.forceConsoleToStderr = false;

6568

findRoutedCommandMock.mockReturnValue({

@@ -82,6 +85,11 @@ describe("tryRouteCli", () => {

8285

} else {

8386

process.env.OPENCLAW_HIDE_BANNER = originalHideBanner;

8487

}

88+

if (originalLogLevel === undefined) {

89+

delete process.env.OPENCLAW_LOG_LEVEL;

90+

} else {

91+

process.env.OPENCLAW_LOG_LEVEL = originalLogLevel;

92+

}

8593

});

86948795

it("keeps config guard for routed status --json commands", async () => {

@@ -166,6 +174,11 @@ describe("tryRouteCli", () => {

166174

});

167175168176

it("routes status when root options precede the command", async () => {

177+

const capturedLogLevels: Array<string | undefined> = [];

178+

ensureConfigReadyMock.mockImplementationOnce(async () => {

179+

capturedLogLevels.push(process.env.OPENCLAW_LOG_LEVEL);

180+

});

181+169182

await expect(tryRouteCli(["node", "openclaw", "--log-level", "debug", "status"])).resolves.toBe(

170183

true,

171184

);

@@ -181,6 +194,50 @@ describe("tryRouteCli", () => {

181194

expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({

182195

scope: "channels",

183196

});

197+

expect(capturedLogLevels).toEqual(["debug"]);

198+

expect(process.env.OPENCLAW_LOG_LEVEL).toBe("debug");

199+

});

200+201+

it("applies routed log level options after the command", async () => {

202+

const capturedLogLevels: Array<string | undefined> = [];

203+

ensureConfigReadyMock.mockImplementationOnce(async () => {

204+

capturedLogLevels.push(process.env.OPENCLAW_LOG_LEVEL);

205+

});

206+207+

await expect(tryRouteCli(["node", "openclaw", "status", "--log-level=trace"])).resolves.toBe(

208+

true,

209+

);

210+211+

expect(ensureConfigReadyMock).toHaveBeenCalledTimes(1);

212+

expect(runRouteMock).toHaveBeenCalledTimes(1);

213+

expect(capturedLogLevels).toEqual(["trace"]);

214+

expect(process.env.OPENCLAW_LOG_LEVEL).toBe("trace");

215+

});

216+217+

it("uses the last valid routed log level option", async () => {

218+

await expect(

219+

tryRouteCli(["node", "openclaw", "--log-level", "debug", "status", "--log-level=trace"]),

220+

).resolves.toBe(true);

221+222+

expect(ensureConfigReadyMock).toHaveBeenCalledTimes(1);

223+

expect(runRouteMock).toHaveBeenCalledTimes(1);

224+

expect(process.env.OPENCLAW_LOG_LEVEL).toBe("trace");

225+

});

226+227+

it.each([

228+

["invalid value", ["node", "openclaw", "status", "--log-level", "verbose"]],

229+

["missing value", ["node", "openclaw", "status", "--log-level"]],

230+

[

231+

"later invalid value",

232+

["node", "openclaw", "--log-level", "debug", "status", "--log-level", "verbose"],

233+

],

234+

])("falls back for %s routed log level options before bootstrap", async (_name, argv) => {

235+

await expect(tryRouteCli(argv)).resolves.toBe(false);

236+237+

expect(ensureConfigReadyMock).not.toHaveBeenCalled();

238+

expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();

239+

expect(runRouteMock).not.toHaveBeenCalled();

240+

expect(process.env.OPENCLAW_LOG_LEVEL).toBeUndefined();

184241

});

185242186243

it("respects OPENCLAW_HIDE_BANNER for routed commands", async () => {