Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(codex): hide app-server console on Windows (#3234)

Tsai Yuan793ed36aafbe
diff --git a/packages/maker-core/src/agents/codex/app-server/stdioTransport.test.ts b/packages/maker-core/src/agents/codex/app-server/stdioTransport.test.ts
index 0ef81cb884..017c8b51cb 100644
--- a/packages/maker-core/src/agents/codex/app-server/stdioTransport.test.ts
+++ b/packages/maker-core/src/agents/codex/app-server/stdioTransport.test.ts
@@ -56,6 +56,22 @@ beforeEach(() => {
});
describe('createStdioTransport process observer', () => {
+ it('starts the app-server without a visible Windows console', () => {
+ mocks.spawn.mockReturnValue(makeChild());
+
+ createStdioTransport({ binaryPath: '/codex', cwd: '/workspace' });
+
+ expect(mocks.spawn).toHaveBeenCalledWith(
+ '/codex',
+ ['app-server'],
+ expect.objectContaining({
+ cwd: '/workspace',
+ shell: false,
+ windowsHide: true,
+ }),
+ );
+ });
+
it('spawn 时登记一次,主动 close 时只清理一次', async () => {
const child = makeChild();
mocks.spawn.mockReturnValue(child);
diff --git a/packages/maker-core/src/agents/codex/app-server/stdioTransport.ts b/packages/maker-core/src/agents/codex/app-server/stdioTransport.ts
index 7eadfef4e7..f0c8d34740 100644
--- a/packages/maker-core/src/agents/codex/app-server/stdioTransport.ts
+++ b/packages/maker-core/src/agents/codex/app-server/stdioTransport.ts
@@ -61,6 +61,8 @@ export function createStdioTransport(opts: StdioTransportOptions): Transport {
// Windows: 不开 shell, 直接走 binary; 走 shell 会带来 env injection 风险
// 且 stdio piping 行为不可控。
shell: false,
+ // Windows 上 app-server 及其控制台句柄不应打断桌面端 UI。
+ windowsHide: true,
// Linux/macOS: 跟父进程同 process group, 父进程退出时一并被收割。
detached: false,
});