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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

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
perf: combine pty exec coverage · openclaw/openclaw@56ef633
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -23,21 +23,6 @@ function currentNodeEvalCommand(source: string): string {

2323

return process.platform === "win32" ? `& ${node} -e ${script}` : `${node} -e ${script}`;

2424

}

252526-

async function runPtyCommand(command: string) {

27-

const handle = await runExecProcess({

28-

command,

29-

workdir: process.cwd(),

30-

env: currentEnv(),

31-

usePty: true,

32-

warnings: [],

33-

maxOutput: 20_000,

34-

pendingMaxOutput: 20_000,

35-

notifyOnExit: false,

36-

timeoutSec: 5,

37-

});

38-

return await handle.promise;

39-

}

40-4126

async function startPtySession(command: string) {

4227

const processTool = createProcessTool();

4328

const run = await runExecProcess({

@@ -58,8 +43,11 @@ async function startPtySession(command: string) {

5843

async function waitForSessionCompletion(params: {

5944

processTool: ReturnType<typeof createProcessTool>;

6045

sessionId: string;

61-

expectedText: string;

46+

expectedText: string | string[];

6247

}) {

48+

const expectedTexts = Array.isArray(params.expectedText)

49+

? params.expectedText

50+

: [params.expectedText];

6351

await expect

6452

.poll(

6553

async () => {

@@ -72,7 +60,9 @@ async function waitForSessionCompletion(params: {

7260

return false;

7361

}

7462

expect(details.status).toBe("completed");

75-

expect(details.aggregated ?? "").toContain(params.expectedText);

63+

for (const expectedText of expectedTexts) {

64+

expect(details.aggregated ?? "").toContain(expectedText);

65+

}

7666

return true;

7767

},

7868

{

@@ -83,20 +73,22 @@ async function waitForSessionCompletion(params: {

8373

.toBe(true);

8474

}

857586-

test("exec supports pty output and OPENCLAW_SHELL", async () => {

87-

const result = await runPtyCommand(

88-

currentNodeEvalCommand('process.stdout.write(`ok:${process.env.OPENCLAW_SHELL || ""}`)'),

89-

);

90-91-

expect(result.status).toBe("completed");

92-

expect(result.aggregated).toContain("ok");

93-

expect(result.aggregated).toContain("exec");

94-

});

95-96-

test("process send-keys and submit send Enter for pty sessions", async () => {

76+

test("exec supports pty output, OPENCLAW_SHELL, send-keys, and submit", async () => {

9777

const { processTool, sessionId } = await startPtySession(

9878

currentNodeEvalCommand(

99-

"const dataEvent=String.fromCharCode(100,97,116,97);const submitted=String.fromCharCode(115,117,98,109,105,116,116,101,100);let first=false;process.stdin.on(dataEvent,d=>{process.stdout.write(d);if(d.includes(10)||d.includes(13)){if(first){process.stdout.write(submitted);process.exit(0);}first=true;}});",

79+

[

80+

"process.stdout.write(`ok:${process.env.OPENCLAW_SHELL || ''}`);",

81+

"const dataEvent=String.fromCharCode(100,97,116,97);",

82+

"const submitted=String.fromCharCode(115,117,98,109,105,116,116,101,100);",

83+

"let first=false;",

84+

"process.stdin.on(dataEvent,d=>{",

85+

"process.stdout.write(d);",

86+

"if(d.includes(10)||d.includes(13)){",

87+

"if(first){process.stdout.write(submitted);process.exit(0);}",

88+

"first=true;",

89+

"}",

90+

"});",

91+

].join(""),

10092

),

10193

);

10294

@@ -111,5 +103,9 @@ test("process send-keys and submit send Enter for pty sessions", async () => {

111103

sessionId,

112104

});

113105114-

await waitForSessionCompletion({ processTool, sessionId, expectedText: "submitted" });

106+

await waitForSessionCompletion({

107+

processTool,

108+

sessionId,

109+

expectedText: ["submitted", "ok", "exec"],

110+

});

115111

});