mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-15 20:29:55 +00:00
fix(cli): harden ACP/Codex event handling (#211)
Co-authored-by: Lihengwannafly <Lihengwannafly@users.noreply.github.com>
This commit is contained in:
co-authored by
Lihengwannafly
parent
77cfa715f9
commit
10f7e1404e
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user