mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
fix(codex): preserve plan approval in yolo (#1420)
This commit is contained in:
@@ -1486,7 +1486,7 @@ describe('codexRemoteLauncher', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('retries plan turns without collaborationMode when the runtime rejects the field', async () => {
|
||||
it('does not retry plan turns as normal turns when the runtime rejects the field', async () => {
|
||||
harness.startTurnErrors.push(new Error('unknown field collaborationMode'));
|
||||
const { session, sessionEvents } = createSessionStub(['plan this'], {
|
||||
permissionMode: 'default',
|
||||
@@ -1497,19 +1497,17 @@ describe('codexRemoteLauncher', () => {
|
||||
const exitReason = await codexRemoteLauncher(session as never);
|
||||
|
||||
expect(exitReason).toBe('exit');
|
||||
expect(harness.startTurnParams).toHaveLength(2);
|
||||
expect(harness.startTurnParams).toHaveLength(1);
|
||||
expect(harness.startTurnParams[0]?.collaborationMode).toMatchObject({
|
||||
mode: 'plan'
|
||||
});
|
||||
expect(harness.startTurnParams[1]?.collaborationMode).toBeUndefined();
|
||||
expect(harness.startTurnParams[1]?.model).toBe('gpt-5.4');
|
||||
expect(sessionEvents).toContainEqual({
|
||||
type: 'message',
|
||||
message: 'Plan mode is not supported by this Codex runtime. Sent as a normal turn instead.'
|
||||
message: 'Task failed: Plan mode is not supported by this Codex runtime.'
|
||||
});
|
||||
});
|
||||
|
||||
it('retries plan turns when unsupported errors use spaced collaboration mode wording', async () => {
|
||||
it('does not retry plan turns when unsupported errors use spaced collaboration mode wording', async () => {
|
||||
harness.startTurnErrors.push(new Error('unsupported collaboration mode'));
|
||||
const { session, sessionEvents } = createSessionStub(['plan this'], {
|
||||
permissionMode: 'default',
|
||||
@@ -1520,14 +1518,13 @@ describe('codexRemoteLauncher', () => {
|
||||
const exitReason = await codexRemoteLauncher(session as never);
|
||||
|
||||
expect(exitReason).toBe('exit');
|
||||
expect(harness.startTurnParams).toHaveLength(2);
|
||||
expect(harness.startTurnParams).toHaveLength(1);
|
||||
expect(harness.startTurnParams[0]?.collaborationMode).toMatchObject({
|
||||
mode: 'plan'
|
||||
});
|
||||
expect(harness.startTurnParams[1]?.collaborationMode).toBeUndefined();
|
||||
expect(sessionEvents).toContainEqual({
|
||||
type: 'message',
|
||||
message: 'Plan mode is not supported by this Codex runtime. Sent as a normal turn instead.'
|
||||
message: 'Task failed: Plan mode is not supported by this Codex runtime.'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user