Skip to content

Conversation

@rostikmanko
Copy link
Contributor

@rostikmanko rostikmanko commented Jan 24, 2026

Summary by CodeRabbit

  • Improvements
    • Branched chat messages now retain complete metadata including model information, generation timing, and usage statistics.
    • Enhanced message filtering to more accurately identify and preserve meaningful content while removing empty messages.

✏️ Tip: You can customize this high-level summary in your review settings.

rostikmanko and others added 2 commits January 23, 2026 20:05
…ibility

The previous filter only checked if parts array existed and had length > 0,
but didn't verify parts contained actual content. This caused Gemini API
errors ("must include at least one parts field") when messages had empty
text parts like { type: "text", text: "" }.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added new fields to the message mutation for improved tracking and analysis, including model, generation time, finish reason, and usage statistics. This enhancement allows for better integration with the messaging system and provides more context for each message processed.
@vercel
Copy link

vercel bot commented Jan 24, 2026

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

Project Deployment Review Updated (UTC)
hackerai Error Error Jan 24, 2026 1:13am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

The PR extends message metadata preservation in chat branching and refines message content filtering. Specifically, generation-related fields (model, generation_time_ms, finish_reason, usage) are now carried over when cloning messages, and message filtering logic validates that content parts contain meaningful data.

Changes

Cohort / File(s) Summary
Message Branching
convex/messages.ts
Added four metadata fields (model, generation_time_ms, finish_reason, usage) to the message cloning operation in branchChat, extending the existing subset of copied fields.
Message Processing
lib/chat/chat-processor.ts
Refined message filtering logic to validate content meaningfulness: preserves text parts with non-empty trimmed content, files with URL/fileId, and other part types; filters out messages with no parts or empty parts.

Possibly Related PRs

  • Daily branch 2025 10 17 #57 — Modifies branchChat message field copying logic in convex/messages.ts; directly related to the message metadata preservation changes.
  • Daily branch 2025 12 26 #148 — Adjusts message-part filtering in lib/chat/chat-processor.ts; directly related to the filtering refinement changes.

Poem

🐰 A rabbit hops through branching chats,
Preserving metadata—where it's at!
Generation echoes, usage complete,
While filters trim the hollow wheat.


🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Daily branch 2026 01 24' is vague and does not convey meaningful information about the actual changes made to the codebase. Use a descriptive title that summarizes the main changes, such as 'Preserve message metadata when branching chats and refine content filtering' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@rostikmanko rostikmanko merged commit 99127a9 into main Jan 24, 2026
3 of 4 checks passed
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