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

推荐订阅源

V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
罗磊的独立博客
小众软件
小众软件
I
InfoQ
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
P
Proofpoint News Feed
博客园 - 司徒正美
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
N
Netflix TechBlog - Medium

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(e2e): ignore inline kitchen sink json diagnostics · o...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -624,7 +624,7 @@ async function resolveOpenClawCommand(runner, args, env, options = {}) {

624624

};

625625

}

626626
627-

function parseJsonOutput(stdout) {

627+

export function parseJsonOutput(stdout) {

628628

const trimmed = stdout.trim();

629629

if (!trimmed) {

630630

throw new Error("command produced no JSON output");

@@ -757,6 +757,9 @@ function extractBalancedJsonObjects(text) {

757757

if (text[index] !== "{") {

758758

continue;

759759

}

760+

if (!isJsonObjectRecordStart(text, index)) {

761+

continue;

762+

}

760763

const end = findBalancedJsonObjectEnd(text, index);

761764

if (end > index) {

762765

candidates.push(text.slice(index, end + 1));

@@ -766,6 +769,17 @@ function extractBalancedJsonObjects(text) {

766769

return candidates;

767770

}

768771
772+

function isJsonObjectRecordStart(text, index) {

773+

if (index === 0) {

774+

return true;

775+

}

776+

let cursor = index - 1;

777+

while (cursor >= 0 && (text[cursor] === " " || text[cursor] === "\t")) {

778+

cursor -= 1;

779+

}

780+

return cursor < 0 || text[cursor] === "\n" || text[cursor] === "\r";

781+

}

782+
769783

function findBalancedJsonObjectEnd(text, startIndex) {

770784

let depth = 0;

771785

let inString = false;

Original file line numberDiff line numberDiff line change

@@ -43,6 +43,7 @@ import {

4343

listKitchenSinkAuthorizationRpcProbeNames,

4444

listKitchenSinkReadOnlyRpcProbeNames,

4545

makeEnv,

46+

parseJsonOutput,

4647

parseGatewayCliRequestFailure,

4748

readPositiveInt,

4849

readBoundedResponseText,

@@ -913,6 +914,18 @@ await runCommand(process.execPath, [${JSON.stringify(scriptPath)}], {

913914

});

914915
915916

describe("kitchen-sink RPC payload unwrapping", () => {

917+

it("parses the final JSON record without accepting inline diagnostic objects", () => {

918+

const parsed = parseJsonOutput(

919+

[

920+

'debug: ignored inline diagnostic {"ok":false,"result":{"stale":true}}',

921+

JSON.stringify({ ok: true, result: { current: true } }, null, 2),

922+

'warning: ignored trailing diagnostic {"ok":false,"result":{"stale":true}}',

923+

].join("\n"),

924+

);

925+
926+

expect(parsed).toEqual({ ok: true, result: { current: true } });

927+

});

928+
916929

it("preserves explicit nullish JSON-RPC result fields", () => {

917930

expect(unwrapRpcPayload({ jsonrpc: "2.0", result: null })).toBeNull();

918931

expect(unwrapRpcPayload({ jsonrpc: "2.0", result: undefined })).toBeUndefined();