Conversation
Review Summary by Qodo(Agentic_describe updated until commit f0ee123)Add browser notifications for thread events
WalkthroughsDescription• Add opt-in browser notifications for completed background turns • Notify when Codex needs approval or user response • Add settings UI toggle with permission management • Suppress notifications for currently visible selected thread Diagramflowchart LR
A["Thread Events<br/>Turn Completed<br/>Pending Request"] -->|"notifyTurnCompleted<br/>notifyPendingServerRequest"| B["showBrowserNotification"]
B -->|"Check Permission<br/>& Enabled State"| C["Browser Notification"]
D["Settings UI<br/>Toggle Button"] -->|"setBrowserNotificationsEnabled"| E["Permission Request<br/>& Storage"]
F["Notification Click"] -->|"THREAD_NOTIFICATION_CLICK_EVENT"| G["Select Thread<br/>& Navigate"]
File Changes1. src/composables/useDesktopState.ts
|
Code Review by Qodo
1. Success notify on failure
|
|
Persistent review updated to latest commit f0ee123 |
| if (!shouldRetryWithFallback) { | ||
| clearPendingTurnRequest(completedTurn.threadId) | ||
| scheduleQueueStateRefresh(completedTurn.threadId) | ||
| notifyTurnCompleted(completedTurn) | ||
| } |
There was a problem hiding this comment.
1. Success notify on failure 🐞 Bug ≡ Correctness
useDesktopState.applyRealtimeUpdates() calls notifyTurnCompleted() even when the same turn/completed event indicates a failure (turn.status === 'failed'), so users can receive a misleading “Codex task complete” notification for failed turns. This can mask errors and erode trust in the notification signal.
Agent Prompt
### Issue description
A "Codex task complete" browser notification can be shown for failed turns because `notifyTurnCompleted()` is called without checking whether the turn completed with an error.
### Issue Context
`readTurnErrorMessage()` explicitly extracts an error when a `turn/completed` payload has `turn.status === 'failed'`, but the completion notification is currently sent whenever `!shouldRetryWithFallback`.
### Fix Focus Areas
- src/composables/useDesktopState.ts[3783-3836]
- src/composables/useDesktopState.ts[2905-2912]
### What to change
- Only call `notifyTurnCompleted(completedTurn)` when there is no `turnErrorMessage` (and/or when the completed turn status is successful).
- Optionally add a separate failure notification path (e.g., `notifyTurnFailed`) with an accurate title/body, or suppress notifications for failures entirely.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Verification