Skip to content

Conversation

@Kitenite
Copy link
Contributor

@Kitenite Kitenite commented Sep 13, 2025

Reverts #2836


Important

Reverts dependency versions and restores previous implementations for chat message rendering and tool call handling.

  • Dependencies:
    • Revert @ai-sdk/react from 2.0.44 to 2.0.25 and ai from 5.0.44 to 5.0.26 in package.json and bun.lock.
  • Chat Messages:
    • Revert ChatMessages component logic in index.tsx to previous implementation.
    • Restore MessageList component in message-list.tsx.
    • Adjust StreamMessage logic in stream-message.tsx.
  • Tool Call Handling:
    • Revert handleToolCall function logic in tools.ts to previous implementation.

This description was created by Ellipsis for 2491d5f. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Bug Fixes
    • Prevents duplicate streaming assistant messages and improves tool result timing for more accurate chat updates.
  • Refactor
    • Simplified chat message rendering with per-role components and better handling of streaming/empty states.
    • Streamlined tool execution flow for more reliable outputs and errors.
  • Style
    • Consistent styling for the reasoning block and clearer loading states (“Thinking …” vs “Introspecting…”).
  • Chores
    • Updated AI-related dependencies to aligned versions across packages.

@vercel
Copy link

vercel bot commented Sep 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Sep 13, 2025 4:59pm
web Building Building Preview Comment Sep 13, 2025 4:59pm

@supabase
Copy link

supabase bot commented Sep 13, 2025

This pull request has been ignored for the connected project wowaemfasoptxrdjhilu because there are no changes detected in apps/backend/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai
Copy link

coderabbitai bot commented Sep 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates downgrade AI SDK dependencies, refactor chat message rendering to use UI context with per-role components, remove the old MessageList, adjust message content styling/props, introduce introspection-aware streaming states, and change tool-call flow to await results and return values directly via a revised async handleToolCall. Hook integration is updated accordingly.

Changes

Cohort / File(s) Summary
Dependency version updates
apps/web/client/package.json, packages/ai/package.json, packages/models/package.json
Downgrade versions: @ai-sdk/react 2.0.44→2.0.25; ai 5.0.44→5.0.26 (app and packages, including devDependency).
Chat rendering refactor
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx, .../chat-messages/message-list.tsx
Replace MessageList with inline per-role rendering using useChatContext; memoized filtering of streaming assistant message; updated contentKey; removed MessageList component (file deleted).
Message content styling/props
.../chat-messages/message-content/index.tsx
Remove cn usage; make reasoning block styling unconditional; pass additional props to MarkdownRenderer (applied, isStream, className); always constrain height/scroll.
Streaming state and introspection
.../chat-messages/stream-message.tsx
Memoize assistant-stream role; detect reasoning parts; split waiting UI: “Thinking ...” vs “Introspecting...”; render MessageContent only for assistant stream with parts.
Tool call flow changes
apps/web/client/src/app/project/[id]/_hooks/use-chat.tsx, apps/web/client/src/components/tools/tools.ts
handleToolCall rewritten to async returning result; signature changed (remove callback). Hook now awaits result and calls chat.addToolResult with structured payload (tool, toolCallId, output). Simplified error handling and tool resolution.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Chat UI
  participant Hook as use-chat
  participant Tools as handleToolCall(...)
  participant Engine as EditorEngine
  participant Chat as Chat Context

  UI->>Hook: onToolCall(toolCall)
  Hook->>Tools: await handleToolCall(toolCall, editorEngine)
  Tools->>Engine: resolve mode/tools, fetch handler
  alt tool available
    Tools-->>Hook: result (output)
    Hook->>Chat: addToolResult{ tool, toolCallId, output }
  else tool missing/error
    Tools-->>Hook: error string
    Hook->>Chat: addToolResult with error output
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A rabbit taps the keys with glee,
Streaming thoughts like gentle sea.
“Introspecting,” whispers bright—
Then “Thinking...” hops into the light.
Tools now answer, clean and fast,
Messages line up at last.
Carrots compiled—ship it past! 🥕🚀

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-2836-bugs/gpt-5-rendering

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 740ec31 and 2491d5f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • apps/web/client/package.json (2 hunks)
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx (3 hunks)
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content/index.tsx (1 hunks)
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-list.tsx (0 hunks)
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsx (2 hunks)
  • apps/web/client/src/app/project/[id]/_hooks/use-chat.tsx (1 hunks)
  • apps/web/client/src/components/tools/tools.ts (1 hunks)
  • packages/ai/package.json (1 hunks)
  • packages/models/package.json (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite merged commit 55b10ad into main Sep 13, 2025
3 of 6 checks passed
@Kitenite Kitenite deleted the revert-2836-bugs/gpt-5-rendering branch September 13, 2025 16:55
@vercel vercel bot temporarily deployed to Preview – web September 13, 2025 16:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants