Fix session drawer review comments - #85
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d41210cb88
ℹ️ 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".
| if (!session) return null; | ||
|
|
||
| // Prefer live status if available | ||
| const currentStatus = data?.session?.status || session.status; |
There was a problem hiding this comment.
Poll resumed sessions after sending follow-ups
When the drawer is opened from a needs_review row, the SWR refreshInterval remains fixed at zero because it is derived from the unchanged session.status. After a follow-up, the single mutate() may observe either the old review state or the new running state, but subsequent progress and completion will never reach currentStatus; this can leave the review form incorrectly available or leave the drawer stuck on running until it is closed and reopened. Base polling on the latest detail status or explicitly start revalidation after a successful follow-up.
Useful? React with 👍 / 👎.
| } catch { | ||
| // roll back optimistic UI | ||
| setSent((prev) => prev.filter(m => m.content !== txt)); | ||
| setMessage(txt); // put message back in the box |
There was a problem hiding this comment.
Preserve newer drafts when rolling back a failed send
If the user submits one message and types a new draft while that request is pending, a failure unconditionally replaces the new draft with the failed message. This silently discards user input; restore the failed text only when the textarea is still empty, or merge it without overwriting text entered after the request began.
Useful? React with 👍 / 👎.
| </div> | ||
| ) : ( | ||
| <> | ||
| {data?.firstMessage && ( |
There was a problem hiding this comment.
Avoid rendering the first response twice
Render firstMessage only when it is absent from the live message list. For example, an instantly completed Gemini interaction stores output_text as firstMessage, while getOutput() returns the same output_text as its first agent message, so this unconditional block followed by messages.map() displays the identical response twice.
Useful? React with 👍 / 👎.
Addressed all outstanding PR comments on the SessionDrawer component including:
onFollowupSentcallbackres.okfirstMessagewhen present without live agent outputPR created automatically by Jules for task 3824241061700079146 started by @parvezk