fix(cli): harden ACP/Codex event handling (#211)

Co-authored-by: Lihengwannafly <Lihengwannafly@users.noreply.github.com>
This commit is contained in:
Lihengwannafly
2026-02-25 16:57:28 +08:00
committed by GitHub
co-authored by Lihengwannafly
parent 77cfa715f9
commit 10f7e1404e
17 changed files with 1529 additions and 67 deletions
+21 -1
View File
@@ -15,11 +15,13 @@ describe('appServerConfig', () => {
expect(params.sandbox).toBe('danger-full-access');
expect(params.approvalPolicy).toBe('never');
expect(params.baseInstructions).toBe(codexSystemPrompt);
expect(params.developerInstructions).toBe(codexSystemPrompt);
expect(params.config).toEqual({
'mcp_servers.hapi': {
command: 'node',
args: ['mcp']
}
},
developer_instructions: codexSystemPrompt
});
});
@@ -34,6 +36,24 @@ describe('appServerConfig', () => {
expect(params.approvalPolicy).toBe('on-failure');
});
it('concatenates custom developer instructions after base instructions', () => {
const params = buildThreadStartParams({
mode: { permissionMode: 'default' },
mcpServers,
developerInstructions: 'Only respond in Chinese.'
});
expect(params.baseInstructions).toBe(codexSystemPrompt);
expect(params.developerInstructions).toBe(`${codexSystemPrompt}\n\nOnly respond in Chinese.`);
expect(params.config).toEqual({
'mcp_servers.hapi': {
command: 'node',
args: ['mcp']
},
developer_instructions: `${codexSystemPrompt}\n\nOnly respond in Chinese.`
});
});
it('builds turn params with mode defaults', () => {
const params = buildTurnStartParams({
threadId: 'thread-1',