Skip to content

[WIP] Fix issue with unresolved conflict markers in sync#469

Draft
Claude wants to merge 4 commits intomainfrom
claude/improve-conflict-resolution
Draft

[WIP] Fix issue with unresolved conflict markers in sync#469
Claude wants to merge 4 commits intomainfrom
claude/improve-conflict-resolution

Conversation

@Claude
Copy link
Copy Markdown

@Claude Claude AI commented Apr 9, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Improve conflict resolution</issue_title>
<issue_description>Conflict markers get left in the sync if they can't be merged, these can't be resolved in the PR, only locally.</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI linked an issue Apr 9, 2026 that may be closed by this pull request
- Modified _merge_with_base to return bool indicating conflict status
- Modified sync_merge to propagate conflict status return value
- Modified sync command to raise RuntimeError when conflicts detected
- Updated rhiza_sync workflow to fail instead of committing on conflicts
- Added tests for CLI conflict exit behavior
- Added tests for _merge_with_base conflict return value

This change prevents automated workflows from committing files with conflict
markers or .rej files when template sync encounters merge conflicts. The
workflow will now fail with a clear error message directing users to resolve
conflicts locally.

Agent-Logs-Url: https://github.com/Jebel-Quant/rhiza-cli/sessions/e683d3bf-c566-478d-8e69-13976fa2261f

Co-authored-by: HarryCampion <40582604+HarryCampion@users.noreply.github.com>
@Claude Claude AI requested a review from HarryCampion April 9, 2026 15:19
@HarryCampion
Copy link
Copy Markdown
Collaborator

@claude[agent] review the failures here in the CI and report back with what the changes broke and why.

The test was failing because it didn't mock the git operations that determine
conflict status. After commit 1cb12f5 made sync() raise RuntimeError on
conflicts, this test needed to mock _apply_diff to return True (clean merge).

Added mocks for:
- GitContext.get_diff: returns a sample diff
- GitContext._apply_diff: returns True (no conflicts)

This follows the same pattern as the new tests added in test_sync.py.

Fixes test failure across all platforms and Python versions.

Co-authored-by: HarryCampion <40582604+HarryCampion@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Author

Claude AI commented Apr 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Jebel-Quant/rhiza-cli/actions/runs
    • Triggering command: /usr/bin/gh gh run list --branch claude/improve-conflict-resolution --limit 3 /home/REDACTED/.nvm/nvm-exec /home/REDACTED/.nvm/nvm.sh /home/REDACTED/.nvm/package.json /home/REDACTED/.nvm/rename_test.sh /home/REDACTED/.nvm/test swit�� nv-python3.12 eposxbdc_dt/ ease -o /dev/null /tmp/ccFWaitO.s (http block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

Improve conflict resolution

3 participants