fix: avoid infinite recursion - #2629
Conversation
|
Here's a visual recap of what changed: Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Code Review Summary
This incremental review covers the latest PR #2629 state, including the @agent-native/core patch changeset alongside the run-store convergence guard and regression tests. The production change reads the current terminal fields before issuing the existing guarded UPDATE, so a row that already matches the event-derived terminal state returns false rather than falsely reporting a repair and recursively re-entering getRunByThread.
The approach remains sound. The stale-run path intentionally allows the first reconciliation to normalize the reaper-written terminal values; subsequent calls reach a fixed point and stop recursion. The regression suite covers repair of a running row, repeated reconciliation of a settled row, and bounded stale-run lookup. Two independent reviewers found no confirmed reportable issues, and the changeset is correctly scoped as a patch release for @agent-native/core.
✅ No new reportable issues found in this incremental review.
✅ SQL remains parameterized and dialect-neutral.
✅ Browser impact is absent.
Risk assessment: Standard.
🧪 Browser testing: Skipped — PR only modifies backend run-store logic, tests, and release metadata, no UI impact

Rows that are errored + stale_run causes
getRunByThreadto continually returntrue, so it recurses infinitely. This PR changes it so there's an escape hatch for this state to avoid the infinite recursion.