fix: prevent resolver hang and add boss-supervised merge resolver#59
Merged
tensor-ninja merged 3 commits intonightshiftco:mainfrom Feb 15, 2026
Merged
Conversation
tensor-ninja
requested changes
Feb 14, 2026
Contributor
Author
|
@tensor-ninja I’m now capturing the ResolverResult and breaking out of the conflict loop immediately when rr.done is true, so we don’t run an extra abortMerge() and mergeMainIntoWorktree() cycle. I applied the same change in both ralph daemon and the CLI run handler. |
…” inside the if (rr.done) block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
In daemon or server runs, the merge resolver can emit a
questionrequest. Since there is no interactive UI to answer questions in these modes, the session blocks until it times out. The resolver also ran as a single pass without a boss style validation loop, which could allow incomplete merge states to slip through.What changed
Auto reject
question.askedevents in agent sessionsWhen the session stream emits
question.askedfor the active session, we immediately callclient.question.reject(...)and continue streaming. This removes the deadlock that caused daemon timeouts in Issue Resolver agent needs boss validation and question suppression #50.Add visibility for rejected questions
Introduces a
session.questionbus event and prints it in CLI output so it is clear when a question was emitted and rejected.Boss supervised merge resolver loop with deterministic completion checks
The merge resolver now runs in a bounded loop. After each resolver pass, it checks:
<<<<<<<,=======,>>>>>>>)git status --porcelainempty)git diff --name-only --diff-filter=U)If these checks fail, a boss prompt produces concrete instructions for the next iteration. The loop is bounded by
maxIterationsto avoid unbounded retries.Wire boss client and eval model through resolver call sites
Resolver is invoked with both the worker client and boss client, and uses
evalModelfor boss evaluation.Why this fixes Issue #50
questiontool calls because they are rejected immediately.Test plan
Manual reproduction using a forced merge conflict:
Create a merge conflict between two branches.
Trigger the ralph resolver flow in non interactive mode.
Confirm it does not hang even if a question is emitted (CLI prints auto rejected question when it happens).
Verify post resolution state:
git rev-parse -q --verify MERGE_HEADfailsgit status --porcelainis emptygit grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- .returns no matchesgit diff --name-only --diff-filter=Ureturns no filesNotes
This change is intentionally conservative. Questions are only auto rejected for the active session and do not affect interactive flows where a UI might exist.