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

推荐订阅源

U
Unit 42
Vercel News
Vercel News
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
量子位
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)

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(openwebui): redact failed chat diagnostics · openclaw...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -147,7 +147,9 @@ function escapeRegExp(value) {

147147

}

148148
149149

function redactDiagnosticText(text, extraSecrets = []) {

150-

let redacted = text;

150+

let redacted = text

151+

.replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/giu, "Bearer <redacted>")

152+

.replace(/openwebui-session=[^;"\s]+/giu, "openwebui-session=<redacted>");

151153

for (const secret of [email, password, ...extraSecrets]) {

152154

if (!secret) {

153155

continue;

@@ -175,6 +177,13 @@ function cookieSecretValues(cookieHeader) {

175177

.filter(Boolean);

176178

}

177179
180+

function authDiagnosticSecretValues(authHeaders) {

181+

const authorization = typeof authHeaders.authorization === "string" ? authHeaders.authorization : "";

182+

const bearerToken = authorization.startsWith("Bearer ") ? authorization.slice("Bearer ".length) : "";

183+

const cookie = typeof authHeaders.cookie === "string" ? authHeaders.cookie : "";

184+

return [bearerToken, authorization, cookie, ...cookieSecretValues(cookie)].filter(Boolean);

185+

}

186+
178187

async function fetchSignin() {

179188

return await withRequestTimeout(

180189

"Open WebUI signin",

@@ -325,7 +334,11 @@ const chatJson = await fetchChatCompletion(authHeaders, targetModel, diagnosticS

325334

const reply =

326335

chatJson?.choices?.[0]?.message?.content ?? chatJson?.message?.content ?? chatJson?.content ?? "";

327336

if (typeof reply !== "string" || !reply.includes(expectedNonce)) {

328-

throw new Error(`chat reply missing nonce: ${JSON.stringify(reply)}`);

337+

const diagnosticReply = redactDiagnosticText(JSON.stringify(reply), [

338+

...diagnosticSecrets,

339+

...authDiagnosticSecretValues(authHeaders),

340+

]);

341+

throw new Error(`chat reply missing nonce: ${diagnosticReply}`);

329342

}

330343
331344

console.log(JSON.stringify({ ok: true, model: targetModel, reply }, null, 2));

Original file line numberDiff line numberDiff line change

@@ -258,9 +258,9 @@ describe("scripts/e2e/openwebui-probe.mjs", () => {

258258

if (request.url === "/api/v1/auths/signin") {

259259

response.writeHead(200, {

260260

"content-type": "application/json",

261-

"set-cookie": "openwebui-session=test; Path=/",

261+

"set-cookie": "openwebui-session=chat=secret=cookie; Path=/",

262262

});

263-

response.end(JSON.stringify({ token: "test-token" }));

263+

response.end(JSON.stringify({ token: "chat-secret-token" }));

264264

return;

265265

}

266266

if (request.url === "/api/models") {

@@ -329,9 +329,9 @@ describe("scripts/e2e/openwebui-probe.mjs", () => {

329329

if (request.url === "/api/v1/auths/signin") {

330330

response.writeHead(200, {

331331

"content-type": "application/json",

332-

"set-cookie": "openwebui-session=test; Path=/",

332+

"set-cookie": "openwebui-session=chat=secret=cookie; Path=/",

333333

});

334-

response.end(JSON.stringify({ token: "test-token" }));

334+

response.end(JSON.stringify({ token: "chat-secret-token" }));

335335

return;

336336

}

337337

if (request.url === "/api/models") {

@@ -461,8 +461,16 @@ describe("scripts/e2e/openwebui-probe.mjs", () => {

461461

return;

462462

}

463463

if (request.url === "/api/chat/completions") {

464+

const authorization = request.headers.authorization ?? "";

465+

const cookie = request.headers.cookie ?? "";

464466

response.writeHead(200, { "content-type": "application/json" });

465-

response.end(JSON.stringify({ message: { content: "missing the marker" } }));

467+

response.end(

468+

JSON.stringify({

469+

message: {

470+

content: `missing the marker with ${authorization} and ${cookie}`,

471+

},

472+

}),

473+

);

466474

return;

467475

}

468476

response.writeHead(404).end();

@@ -473,7 +481,11 @@ describe("scripts/e2e/openwebui-probe.mjs", () => {

473481
474482

expect(result.error).toBeUndefined();

475483

expect(result.status).not.toBe(0);

476-

expect(result.stderr).toContain('chat reply missing nonce: "missing the marker"');

484+

expect(result.stderr).toContain("chat reply missing nonce");

485+

expect(result.stderr).toContain("<redacted>");

486+

expect(result.stderr).not.toContain("chat-secret-token");

487+

expect(result.stderr).not.toContain("chat=secret=cookie");

488+

expect(result.stderr).not.toContain("openwebui-session=chat");

477489

} finally {

478490

server.close();

479491

}