Fix probe failure

This commit is contained in:
weishu
2026-05-19 17:07:15 +08:00
parent ce2e76a42e
commit c070cdef28
2 changed files with 8 additions and 5 deletions
+7 -3
View File
@@ -1103,18 +1103,22 @@ describe('codexRemoteLauncher', () => {
]));
});
it('shows unsupported message when goals feature cannot be enabled', async () => {
it('still attempts goal RPC when dynamic goals feature enablement is unsupported', async () => {
harness.failSetFeatureEnablement = true;
const { session, sessionEvents } = createSessionStub(['/goal improve benchmark coverage']);
const exitReason = await codexRemoteLauncher(session as never);
expect(exitReason).toBe('exit');
expect(harness.goalSetCalls).toHaveLength(0);
expect(harness.goalSetCalls).toEqual([{
threadId: 'thread-1',
objective: 'improve benchmark coverage',
status: 'active'
}]);
expect(harness.startTurnParams).toHaveLength(0);
expect(sessionEvents).toContainEqual({
type: 'message',
message: 'Codex goals are not supported by this Codex runtime. Upgrade Codex or enable features.goals.'
message: 'Goal active'
});
});
+1 -2
View File
@@ -2308,8 +2308,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
await appServerClient.setExperimentalFeatureEnablement({ enablement: { goals: true } });
logger.debug('[Codex] goals feature enabled');
} catch (error) {
supportsGoals = false;
logger.debug(`[Codex] failed to enable goals feature: ${errorMessage(error)}`);
logger.debug(`[Codex] failed to enable goals feature: ${errorMessage(error)}; will rely on configured feature state`);
}
try {
const response = await appServerClient.listCollaborationModes();