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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
H
Help Net Security
Last Week in AI
Last Week in AI
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
B
Blog
C
Check Point Blog
T
Tailwind CSS Blog
云风的 BLOG
云风的 BLOG
D
Docker
Recent Announcements
Recent Announcements
Vercel News
Vercel News
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
月光博客
月光博客
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
B
Blog RSS Feed
The Register - Security
The Register - Security
V
Visual Studio Blog
F
Full Disclosure
Hugging Face - Blog
Hugging Face - Blog
T
Threat Research - Cisco Blogs
Latest news
Latest news
PCI Perspectives
PCI Perspectives
Cisco Talos Blog
Cisco Talos Blog
博客园 - Franky
D
DataBreaches.Net
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
P
Palo Alto Networks Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
T
Tenable Blog
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(media): compact whatsapp terminal qr (#87581) · openclaw/openclaw@492105d
liorb-mounta · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -159,8 +159,8 @@ describe("loginWeb coverage", () => {

159159

);

160160

expect(runtime.log).toHaveBeenCalledWith("terminal:initial-qr");

161161

expect(runtime.log).toHaveBeenCalledWith("terminal:restart-qr");

162-

expect(renderQrTerminalMock).toHaveBeenCalledWith("initial-qr");

163-

expect(renderQrTerminalMock).toHaveBeenCalledWith("restart-qr");

162+

expect(renderQrTerminalMock).toHaveBeenCalledWith("initial-qr", { small: true });

163+

expect(renderQrTerminalMock).toHaveBeenCalledWith("restart-qr", { small: true });

164164

});

165165
166166

it("clears creds and throws when logged out", async () => {

Original file line numberDiff line numberDiff line change

@@ -22,7 +22,7 @@ export async function loginWeb(

2222

const restoredFromBackup = await restoreCredsFromBackupIfNeeded(account.authDir);

2323

const onQr = (qr: string) => {

2424

runtime.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");

25-

void renderQrTerminal(qr)

25+

void renderQrTerminal(qr, { small: true })

2626

.then((output) => {

2727

runtime.log(output.endsWith("\n") ? output.slice(0, -1) : output);

2828

})

Original file line numberDiff line numberDiff line change

@@ -40,6 +40,7 @@ const useMultiFileAuthStateMock = vi.mocked(baileys.useMultiFileAuthState);

4040

let createWaSocket: typeof import("./session.js").createWaSocket;

4141

let formatError: typeof import("./session.js").formatError;

4242

let logWebSelfId: typeof import("./session.js").logWebSelfId;

43+

let renderQrTerminalMock: ReturnType<typeof vi.fn>;

4344

let waitForWaConnection: typeof import("./session.js").waitForWaConnection;

4445

let waitForCredsSaveQueue: typeof import("./session.js").waitForCredsSaveQueue;

4546

let writeCredsJsonAtomically: typeof import("./session.js").writeCredsJsonAtomically;

@@ -224,6 +225,7 @@ describe("web session", () => {

224225

waitForCredsSaveQueue,

225226

writeCredsJsonAtomically,

226227

} = await import("./session.js"));

228+

renderQrTerminalMock = vi.mocked((await import("./qr-terminal.js")).renderQrTerminal);

227229

({ DEFAULT_WHATSAPP_SOCKET_TIMING } = await import("./socket-timing.js"));

228230

});

229231

@@ -271,6 +273,27 @@ describe("web session", () => {

271273

openMock.restore();

272274

});

273275
276+

it("prints compact terminal QR output when requested", async () => {

277+

const authDir = createTempAuthDir("openclaw-wa-terminal-qr");

278+

const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});

279+

const stdoutSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true);

280+
281+

try {

282+

await createWaSocket(true, false, { authDir });

283+

getLastSocket().ev.emit("connection.update", { qr: "qr-data" });

284+

await flushCredsUpdate();

285+
286+

expect(logSpy).toHaveBeenCalledWith(

287+

"Open the WhatsApp app, go to Linked Devices, then scan this QR:",

288+

);

289+

expect(renderQrTerminalMock).toHaveBeenCalledWith("qr-data", { small: true });

290+

expect(stdoutSpy).toHaveBeenCalledWith("ASCII-QR\n");

291+

} finally {

292+

logSpy.mockRestore();

293+

stdoutSpy.mockRestore();

294+

}

295+

});

296+
274297

it.runIf(process.platform !== "win32")(

275298

"rejects symlinked creds before Baileys auth state reads",

276299

async () => {

Original file line numberDiff line numberDiff line change

@@ -124,7 +124,7 @@ async function safeSaveCreds(

124124

}

125125
126126

async function printTerminalQr(qr: string): Promise<void> {

127-

const output = await renderQrTerminal(qr);

127+

const output = await renderQrTerminal(qr, { small: true });

128128

process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);

129129

}

130130
Original file line numberDiff line numberDiff line change

@@ -1,11 +1,61 @@

1+

import QRCode from "qrcode";

12

import { describe, expect, it } from "vitest";

23

import { renderQrTerminal } from "./qr-terminal.ts";

34
5+

const ansiSgr = new RegExp(`${String.fromCharCode(0x1b)}\\[[0-9;]*m`, "g");

6+

const compactMarginModules = 1;

7+
8+

function visibleLines(output: string): string[] {

9+

return output

10+

.split(/\r?\n/)

11+

.map((line) => line.replace(ansiSgr, ""))

12+

.filter((line) => line.length > 0);

13+

}

14+
15+

function maxVisibleWidth(output: string): number {

16+

return Math.max(...visibleLines(output).map((line) => line.length));

17+

}

18+
19+

function decodeCompactBlock(char: string): [boolean, boolean] {

20+

if (char === "█") {

21+

return [true, true];

22+

}

23+

if (char === "▀") {

24+

return [true, false];

25+

}

26+

if (char === "▄") {

27+

return [false, true];

28+

}

29+

if (char === " ") {

30+

return [false, false];

31+

}

32+

throw new Error(`Unexpected compact QR character: ${char}`);

33+

}

34+
35+

function decodeCompactQr(output: string, size: number): boolean[] {

36+

const decoded = Array.from({ length: size * size }, () => false);

37+

visibleLines(output).forEach((line, lineIndex) => {

38+

Array.from(line).forEach((char, columnIndex) => {

39+

const x = columnIndex - compactMarginModules;

40+

const topY = lineIndex * 2 - compactMarginModules;

41+

const [top, bottom] = decodeCompactBlock(char);

42+

for (const [y, value] of [

43+

[topY, top],

44+

[topY + 1, bottom],

45+

] as const) {

46+

if (x >= 0 && x < size && y >= 0 && y < size) {

47+

decoded[y * size + x] = value;

48+

}

49+

}

50+

});

51+

});

52+

return decoded;

53+

}

54+
455

describe("renderQrTerminal (real qrcode runtime)", () => {

556

it("keeps per-row ANSI sequence counts in line with typical rows", async () => {

657

const sample = "https://wa.me/login/2@SAMPLE-TOKEN-1234567890ABCDEF";

758

const rendered = await renderQrTerminal(sample);

8-

const ansiSgr = new RegExp(`${String.fromCharCode(0x1b)}\\[[0-9;]*m`, "g");

959

const escCounts = rendered

1060

.split(/\r?\n/)

1161

.map((line) => (line.match(ansiSgr) ?? []).length)

@@ -17,4 +67,14 @@ describe("renderQrTerminal (real qrcode runtime)", () => {

1767

expect(median).toBeGreaterThan(0);

1868

expect(max).toBeLessThanOrEqual(median * 6);

1969

});

70+
71+

it("renders compact output from the same QR matrix", async () => {

72+

const sample = "https://wa.me/login/2@SAMPLE-TOKEN-1234567890ABCDEF";

73+

const qr = QRCode.create(sample);

74+

const full = await renderQrTerminal(sample);

75+

const compact = await renderQrTerminal(sample, { small: true });

76+
77+

expect(maxVisibleWidth(compact)).toBeLessThan(maxVisibleWidth(full));

78+

expect(decodeCompactQr(compact, qr.modules.size)).toEqual(Array.from(qr.modules.data, Boolean));

79+

});

2080

});

Original file line numberDiff line numberDiff line change

@@ -1,11 +1,18 @@

11

import { beforeEach, describe, expect, it, vi } from "vitest";

22
3-

const { toString } = vi.hoisted(() => ({

3+

const { create, toString } = vi.hoisted(() => ({

4+

create: vi.fn(() => ({

5+

modules: {

6+

data: [1, 0, 0, 1],

7+

size: 2,

8+

},

9+

})),

410

toString: vi.fn(async () => "ASCII-QR"),

511

}));

612
713

vi.mock("qrcode", () => ({

814

default: {

15+

create,

916

toString,

1017

},

1118

}));

@@ -14,6 +21,7 @@ import { renderQrTerminal } from "./qr-terminal.ts";

1421
1522

describe("renderQrTerminal", () => {

1623

beforeEach(() => {

24+

create.mockClear();

1725

toString.mockClear();

1826

});

1927

@@ -25,6 +33,13 @@ describe("renderQrTerminal", () => {

2533

});

2634

});

2735
36+

it("renders compact QR output without qrcode terminal small mode", async () => {

37+

const rendered = await renderQrTerminal("openclaw", { small: true });

38+

expect(rendered).toContain("▄");

39+

expect(create).toHaveBeenCalledWith("openclaw");

40+

expect(toString).not.toHaveBeenCalled();

41+

});

42+
2843

it("rejects empty QR text", async () => {

2944

await expect(renderQrTerminal("")).rejects.toThrow("QR text must not be empty.");

3045

expect(toString).not.toHaveBeenCalled();

Original file line numberDiff line numberDiff line change

@@ -1,12 +1,60 @@

11

import { loadQrCodeRuntime, normalizeQrText } from "./qr-runtime.ts";

22
3+

type QrTerminalModules = {

4+

data: ArrayLike<boolean | number>;

5+

size: number;

6+

};

7+
8+

const COMPACT_MARGIN_MODULES = 1;

9+

const TERMINAL_BLACK_ON_WHITE = "\x1b[47m\x1b[30m";

10+

const TERMINAL_RESET = "\x1b[0m";

11+

const FULL_BLOCK = "█";

12+

const UPPER_HALF_BLOCK = "▀";

13+

const LOWER_HALF_BLOCK = "▄";

14+
15+

function readModule(modules: QrTerminalModules, x: number, y: number): boolean {

16+

if (x < 0 || y < 0 || x >= modules.size || y >= modules.size) {

17+

return false;

18+

}

19+

return Boolean(modules.data[y * modules.size + x]);

20+

}

21+
22+

function compactBlock(top: boolean, bottom: boolean): string {

23+

if (top && bottom) {

24+

return FULL_BLOCK;

25+

}

26+

if (top) {

27+

return UPPER_HALF_BLOCK;

28+

}

29+

if (bottom) {

30+

return LOWER_HALF_BLOCK;

31+

}

32+

return " ";

33+

}

34+
35+

function renderCompactTerminalQr(modules: QrTerminalModules): string {

36+

const lines: string[] = [];

37+

for (let y = -COMPACT_MARGIN_MODULES; y < modules.size + COMPACT_MARGIN_MODULES; y += 2) {

38+

let line = TERMINAL_BLACK_ON_WHITE;

39+

for (let x = -COMPACT_MARGIN_MODULES; x < modules.size + COMPACT_MARGIN_MODULES; x += 1) {

40+

line += compactBlock(readModule(modules, x, y), readModule(modules, x, y + 1));

41+

}

42+

lines.push(`${line}${TERMINAL_RESET}`);

43+

}

44+

return lines.join("\n");

45+

}

46+
347

export async function renderQrTerminal(

448

input: string,

549

opts: { small?: boolean } = {},

650

): Promise<string> {

51+

const text = normalizeQrText(input);

752

const qrCode = await loadQrCodeRuntime();

8-

return await qrCode.toString(normalizeQrText(input), {

9-

small: opts.small ?? false,

53+

if (opts.small === true) {

54+

return renderCompactTerminalQr(qrCode.create(text).modules);

55+

}

56+

return await qrCode.toString(text, {

57+

small: false,

1058

type: "terminal",

1159

});

1260

}

Original file line numberDiff line numberDiff line change

@@ -24,6 +24,14 @@ declare module "qrcode" {

2424

width?: number;

2525

};

2626
27+

export type QrCodeSymbol = {

28+

modules: {

29+

data: ArrayLike<boolean | number>;

30+

size: number;

31+

};

32+

};

33+
34+

export function create(text: string, options?: QrCodeRenderOptions): QrCodeSymbol;

2735

export function toString(text: string, options?: QrCodeRenderOptions): Promise<string>;

2836

export function toDataURL(text: string, options?: QrCodeRenderOptions): Promise<string>;

2937

export function toFile(

@@ -33,6 +41,7 @@ declare module "qrcode" {

3341

): Promise<void>;

3442
3543

const qrcode: {

44+

create: typeof create;

3645

toString: typeof toString;

3746

toDataURL: typeof toDataURL;

3847

toFile: typeof toFile;