-
Notifications
You must be signed in to change notification settings - Fork 531
various AI updates #2574
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
various AI updates #2574
Conversation
sawka
commented
Nov 19, 2025
- roundtrip image filenames correctly
- fix scrolling issue where the thumbs-up/thumbs-down buttons were cut off
- update ai-sdk / ai-sdk react to current versions
- fix a focus issue when moving to AI panel using ctrl:shift:arrowleft
WalkthroughThis pull request modifies scrolling behavior in the AI panel to trigger bottom-scrolling when streaming status transitions end, adds delayed refocus timing adjustments to keyboard navigation logic, updates AI SDK dependencies, and enhances image content handling in OpenAI message conversion by introducing filename propagation while updating content sanitization logic to properly process input_image blocks with filenames. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/app/store/keymodel.ts (1)
239-241: Consider extracting the 10ms delay constant.The delayed refocus pattern correctly addresses the focus issue when navigating to the AI panel. However, the 10ms delay appears multiple times in this file (lines 225, 241, 257, 262). Consider extracting it to a named constant for better maintainability.
Apply this diff to extract the constant:
+const REFOCUS_DELAY_MS = 10; + function getFocusedBlockInStaticTab() { const layoutModel = getLayoutModelForStaticTab();Then update the setTimeout calls to use
REFOCUS_DELAY_MSinstead of hardcoded10.Also applies to: 255-257
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
frontend/app/aipanel/aipanelmessages.tsx(2 hunks)frontend/app/store/keymodel.ts(2 hunks)package.json(2 hunks)pkg/aiusechat/openai/openai-backend.go(1 hunks)pkg/aiusechat/openai/openai-convertmessage.go(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/app/store/keymodel.ts (1)
frontend/app/store/focusManager.ts (1)
FocusManager(11-93)
frontend/app/aipanel/aipanelmessages.tsx (1)
frontend/app/aipanel/waveai-model.tsx (1)
scrollToBottom(280-282)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build for TestDriver.ai
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
frontend/app/aipanel/aipanelmessages.tsx (1)
21-21: LGTM! Scroll-to-bottom on streaming completion is well-implemented.The use of
requestAnimationFrameensures the scroll happens after DOM updates, which should fix the issue where thumbs-up/thumbs-down buttons were cut off. TheprevStatusRefpattern correctly tracks the previous status value.Minor note: The initialization of
prevStatusRefwith the currentstatusmeans on first render, there's no truly "previous" value. This is fine since the first render won't have a transition from streaming, but it's worth being aware of this behavior.Also applies to: 45-56
pkg/aiusechat/openai/openai-backend.go (1)
96-106: LGTM! Filename sanitization logic is correct.The updated
clean()method properly handles the newFilenamefield for image content. The logic ensures that bothPreviewUrlandFilename(forinput_imagetypes) are stripped before sending to the OpenAI API, while preserving them internally for roundtrip handling.The condition correctly identifies when cleaning is needed:
- When
PreviewUrlis present- When
Typeisinput_imageandFilenameis presentBoth internal fields are properly cleared before API transmission.
pkg/aiusechat/openai/openai-convertmessage.go (1)
48-48: LGTM! Filename propagation completes the roundtrip flow.The changes ensure image filenames are correctly preserved through the conversion pipeline:
- Line 321: Converts from AI format to OpenAI format, preserving
FileName→Filename- Line 48: Converts from stored OpenAI format back to UI format, preserving
Filename→FileNameThis works correctly with the backend sanitization that strips
Filenamebefore API transmission while keeping it in stored messages.Also applies to: 321-321
package.json (1)
92-92: Versions verified—these are safe, non-breaking updates.Both @ai-sdk/react@2.0.92 and ai@5.0.92 exist and contain only patch-level changes adding
finishReasonto the useChatonFinishcallback. No breaking changes detected.