fix(codex): preserve plan approval in yolo (#1420)

This commit is contained in:
SSU-WEI HUANG
2026-08-10 10:44:41 +08:00
committed by GitHub
parent b744414241
commit e6e229c068
6 changed files with 53 additions and 27 deletions
+6 -9
View File
@@ -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.'
});
});