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

推荐订阅源

人人都是产品经理
人人都是产品经理
博客园_首页
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
小众软件
小众软件
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Announcements
Recent Announcements
M
MIT News - Artificial intelligence
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog

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(tui): keep stderr visible when local shell stdout fil...
Alix-007 · 2026-06-16 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -16,6 +16,7 @@ const createSelector = () => {

1616

function createShellHarness(params?: {

1717

spawnCommand?: typeof import("node:child_process").spawn;

1818

env?: Record<string, string>;

19+

maxOutputChars?: number;

1920

}) {

2021

const messages: string[] = [];

2122

const chatLog = {

@@ -40,6 +41,7 @@ function createShellHarness(params?: {

4041

createSelector: createSelectorSpy,

4142

spawnCommand,

4243

...(params?.env ? { env: params.env } : {}),

44+

...(params?.maxOutputChars !== undefined ? { maxOutputChars: params.maxOutputChars } : {}),

4345

});

4446

return {

4547

messages,

@@ -112,4 +114,36 @@ describe("createLocalShellRunner", () => {

112114

expect(spawnOptions.env?.PATH).toBe("/tmp/bin");

113115

expect(harness.messages).toContain("local shell: enabled for this session");

114116

});

117+
118+

it("keeps stderr visible instead of evicting it when stdout fills the output cap", async () => {

119+

const stdout = new EventEmitter();

120+

const stderr = new EventEmitter();

121+

const spawnCommand = vi.fn(() => ({

122+

stdout,

123+

stderr,

124+

on: (event: string, callback: (...args: unknown[]) => void) => {

125+

if (event === "close") {

126+

setImmediate(() => {

127+

// stdout fills the entire cap; stderr then carries the failure reason.

128+

stdout.emit("data", Buffer.from("0".repeat(20)));

129+

stderr.emit("data", Buffer.from("FATAL"));

130+

callback(0, null);

131+

});

132+

}

133+

},

134+

}));

135+
136+

const harness = createShellHarness({

137+

spawnCommand: spawnCommand as unknown as typeof import("node:child_process").spawn,

138+

maxOutputChars: 20,

139+

});

140+
141+

const run = harness.runLocalShellLine("!noisy");

142+

harness.getLastSelector()?.onSelect?.({ value: "yes", label: "Yes" });

143+

await run;

144+
145+

// The failure reason in stderr must survive even though stdout filled the cap;

146+

// the previous head-cut kept all stdout and dropped stderr entirely.

147+

expect(harness.messages.some((m) => m.includes("FATAL"))).toBe(true);

148+

});

115149

});

Original file line numberDiff line numberDiff line change

@@ -125,8 +125,11 @@ export function createLocalShellRunner(deps: LocalShellDeps) {

125125

});

126126
127127

child.on("close", (code, signal) => {

128+

// Keep the tail (consistent with the streaming appendWithCap above) so a

129+

// large stdout cannot evict stderr: the failure reason (FATAL etc.) at the

130+

// end is what the operator needs most when output overflows the cap.

128131

const combined = (stdout + (stderr ? (stdout ? "\n" : "") + stderr : ""))

129-

.slice(0, maxChars)

132+

.slice(-maxChars)

130133

.trimEnd();

131134
132135

if (combined) {