Skip to content

Conversation

@Kitenite
Copy link
Contributor

@Kitenite Kitenite commented Sep 12, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Important

Simplifies error handling in use-chat.tsx by removing redundant chat stopping logic in onError.

  • Behavior:
    • Removes redundant chat stopping logic in onError function in use-chat.tsx.
    • Simplifies error handling by filtering out 'assistant' messages and updating conversation with last message.
  • Misc:
    • Removes unnecessary timeout logic for stopping chat in use-chat.tsx.

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

Summary by CodeRabbit

  • New Features

    • Added support for the Claude 3.5 Haiku model with a 200k-token context, enabling longer prompts and responses.
  • Bug Fixes

    • Improved chat error handling to avoid premature session termination, ensuring conversations aren’t cut off and state remains consistent.

@vercel
Copy link

vercel bot commented Sep 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Building Building Preview Comment Sep 12, 2025 1:05am
web Building Building Preview Comment Sep 12, 2025 1:05am

@supabase
Copy link

supabase bot commented Sep 12, 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 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes immediate and delayed chat.stop() calls in error handling within the chat hook. Adds a new CLAUDE_3_5_HAIKU token limit entry (200000) to the LLM model token map. No exported/public signatures changed.

Changes

Cohort / File(s) Summary
Chat error handling
apps/web/client/src/app/project/[id]/_hooks/use-chat.tsx
Removed chat.stop() invocations in onError (both immediate and 100ms delayed). Retains handleChatError, assistant message filtering, and state updates.
LLM token limits
packages/models/src/llm/index.ts
Added MODEL_MAX_TOKENS entry: [OPENROUTER_MODELS.CLAUDE_3_5_HAIKU]: 200000. No other changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Chat Hook (use-chat)
  participant Svc as Chat Service

  User->>UI: Send message
  UI->>Svc: chat.send(input)
  Svc-->>UI: Stream / Response

  alt Success
    UI->>UI: Update conversation state
  else Error
    UI->>UI: handleChatError(err)
    Note right of UI: Assistant messages filtered<br/>No chat.stop() called
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A hiccup in chat, no sudden “stop!”
I twitch my ears, let errors pop.
New Haiku’s tokens, tall as hay—
Two hundred thousand hops today!
I thump, I test, I merge with cheer,
Bugs hop out, the path is clear.


📜 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 0908f7e and 6043a1c.

📒 Files selected for processing (2)
  • apps/web/client/src/app/project/[id]/_hooks/use-chat.tsx (0 hunks)
  • packages/models/src/llm/index.ts (1 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ai-1

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.

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.

1 participant