mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
fix(codex): bridge MCP elicitation through user input (#1008)
* fix(codex): bridge MCP elicitation through user input * fix(codex): allow MCP elicitation in yolo mode * fix(codex): preserve MCP form semantics * fix(codex): accept implicit MCP form mode * fix(codex): harden MCP elicitation prompts * fix(codex): require valid MCP choice answers * fix(codex): round-trip MCP array elicitation * fix(web): require explicit MCP URL confirmation * fix(codex): preserve MCP array item types * fix(codex): support multi-select MCP elicitation * fix(codex): allow MCP elicitation in read-only mode * fix(codex): route MCP tool approvals through permissions
This commit is contained in:
@@ -87,7 +87,15 @@ describe('appServerConfig', () => {
|
||||
});
|
||||
|
||||
expect(params.sandbox).toBe('danger-full-access');
|
||||
expect(params.approvalPolicy).toBe('never');
|
||||
expect(params.approvalPolicy).toEqual({
|
||||
granular: {
|
||||
sandbox_approval: false,
|
||||
rules: false,
|
||||
skill_approval: false,
|
||||
request_permissions: false,
|
||||
mcp_elicitations: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps on-failure approvals for safe-yolo threads', () => {
|
||||
@@ -101,6 +109,25 @@ describe('appServerConfig', () => {
|
||||
expect(params.approvalPolicy).toBe('on-failure');
|
||||
});
|
||||
|
||||
it('allows MCP elicitation without enabling sandbox prompts for read-only threads', () => {
|
||||
const params = buildThreadStartParams({
|
||||
cwd: '/workspace/project',
|
||||
mode: { permissionMode: 'read-only', collaborationMode: 'default' },
|
||||
mcpServers
|
||||
});
|
||||
|
||||
expect(params.sandbox).toBe('read-only');
|
||||
expect(params.approvalPolicy).toEqual({
|
||||
granular: {
|
||||
sandbox_approval: false,
|
||||
rules: false,
|
||||
skill_approval: false,
|
||||
request_permissions: false,
|
||||
mcp_elicitations: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('concatenates custom developer instructions after base instructions', () => {
|
||||
const params = buildThreadStartParams({
|
||||
cwd: '/workspace/project',
|
||||
@@ -229,7 +256,15 @@ describe('appServerConfig', () => {
|
||||
expect(params.threadId).toBe('thread-1');
|
||||
expect(params.cwd).toBe('/workspace/project');
|
||||
expect(params.input).toEqual([{ type: 'text', text: 'hello' }]);
|
||||
expect(params.approvalPolicy).toBe('never');
|
||||
expect(params.approvalPolicy).toEqual({
|
||||
granular: {
|
||||
sandbox_approval: false,
|
||||
rules: false,
|
||||
skill_approval: false,
|
||||
request_permissions: false,
|
||||
mcp_elicitations: true
|
||||
}
|
||||
});
|
||||
expect(params.sandboxPolicy).toEqual({ type: 'readOnly' });
|
||||
expect(params.effort).toBe('high');
|
||||
expect(params.summary).toBeUndefined();
|
||||
|
||||
Reference in New Issue
Block a user