Skip to content

Improve conflict resolution prompt template handling of empty entities - #49

Merged
illeatmyhat merged 2 commits into
mainfrom
conflict-resolution-test
Feb 3, 2026
Merged

Improve conflict resolution prompt template handling of empty entities#49
illeatmyhat merged 2 commits into
mainfrom
conflict-resolution-test

Conversation

@illeatmyhat

@illeatmyhat illeatmyhat commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

This pull request improves the conflict resolution prompt template by adding a more robust check for empty entity lists and ensuring proper file formatting.
It also implements a set of unit tests.

Summary by CodeRabbit

  • New Features

    • Added conflict resolution workflow functions for entity comparison and update generation.
  • Tests

    • Added comprehensive test suite for conflict resolution covering event handling, error resilience, retry mechanisms, and edge cases.

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request introduces a test suite for conflict resolution functionality in the LLM workflow, alongside a template adjustment to properly handle empty entity lists. Tests cover entity conversion, prompt generation, conflict resolution workflows with various event types, LLM response parsing, retry logic, and edge cases.

Changes

Cohort / File(s) Summary
Jinja2 Template
kaizen/llm/conflict_resolution/prompts/conflict_resolution.jinja2
Updated conditional logic to render old_entities block only when the list is non-empty, checking for both existence and non-empty string representation.
Test Suite
tests/llm/test_conflict_resolution.py
Comprehensive test coverage for conflict resolution functionality, including entity conversion from RecordedEntity to SimpleEntity, prompt generation with custom templates, conflict resolution workflows (ADD/UPDATE/DELETE/NONE events), LLM response parsing with markdown and JSON edge cases, and retry logic with configurable max attempts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Our prompts now check for entities true,
No empty lists shall slip on through,
With tests that cover every case—
From JSON tears to retry grace,
Conflict resolved with logic new! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: improving the conflict resolution prompt template's handling of empty entities, which is the primary modification in the prompt file.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch conflict-resolution-test

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

@illeatmyhat
illeatmyhat merged commit c13f4a7 into main Feb 3, 2026
11 checks passed
@illeatmyhat
illeatmyhat deleted the conflict-resolution-test branch February 3, 2026 20:04
@coderabbitai coderabbitai Bot mentioned this pull request Feb 6, 2026
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