Skip to content

Commit bf34af6

Browse files
Merge pull request #2073 from mezotv/emdash/funky-loops-itch-ev7f8
fix: stop Codex loader when turn completes
2 parents 6bcdb09 + 319f425 commit bf34af6

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/main/core/agent-hooks/notification.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function getNotificationBody(event: AgentEvent): string | null {
1515
if (event.type === 'notification') {
1616
const { notificationType } = event.payload;
1717
if (!notificationType) return null;
18+
if (event.providerId === 'codex' && notificationType === 'idle_prompt') {
19+
return 'Your agent has finished working';
20+
}
1821
if (isAttentionNotification(notificationType)) {
1922
return 'Your agent is waiting for input';
2023
}

src/main/core/conversations/impl/local-conversation.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,15 @@ export class LocalConversationProvider implements ConversationProvider {
149149
});
150150

151151
const hookActive = port > 0;
152-
const useHooksOnly = hookActive && providerDef?.supportsHooks && hooksAvailable;
152+
/*
153+
* Codex hooks can be skipped by the CLI in some live-session edge cases; keep
154+
* the output classifier active as a fallback so the UI can leave "working".
155+
*/
156+
const useHooksOnly =
157+
hookActive &&
158+
providerDef?.supportsHooks &&
159+
hooksAvailable &&
160+
conversation.providerId !== 'codex';
153161

154162
if (!useHooksOnly) {
155163
wireAgentClassifier({

src/renderer/features/tasks/conversations/conversation-manager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ export class ConversationManagerStore implements IDisposable {
113113
if (event.type === 'notification') {
114114
const nt = event.payload.notificationType;
115115
if (!isAttentionNotification(nt)) return;
116+
if (event.providerId === 'codex' && nt === 'idle_prompt') {
117+
if (conversationStore.status === 'working') {
118+
conversationStore.setStatus('completed');
119+
soundPlayer.play('task_complete', appFocused);
120+
}
121+
return;
122+
}
116123
conversationStore.setAwaitingInput(nt);
117124
soundPlayer.play('needs_attention', appFocused);
118125
return;

0 commit comments

Comments
 (0)