-
-
Notifications
You must be signed in to change notification settings - Fork 165
feat: allow system notifications for background agent completions #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fb45398f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Store the message text for use in turn completion notification | ||
| if (event.text) { | ||
| lastMessageByThread.current.set(threadKey, event.text); | ||
| } | ||
| const durationMs = consumeDuration(event.workspaceId, event.threadId, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent duplicate system notifications per turn
In handleAgentMessageCompleted, consumeDuration is called with an empty turnId, which clears only turnStartByThread but leaves the turnStartById entry that was created in handleTurnStarted (lines 140–148). When the subsequent turn/completed event arrives with a real turnId, consumeDuration will compute a fresh duration from turnStartById and can send a second notification if it’s >1.5s after the first. This yields duplicate system notifications for a single long turn whenever item/completed (agentMessage) and turn/completed are separated by more than 1.5s. Consider clearing turnStartById for the thread when notifying on agent message completion, or only notifying on one of the two events.
Useful? React with 👍 / 👎.
9fb4539 to
f5863ca
Compare
f5863ca to
e4d6315
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Testing