Skip to content

Bug: Agent retries overwrite manually-set 'done' status#3191

Merged
mabry1985 merged 1 commit intodevfrom
feature/bug-agent-retries-overwrite-manually
Mar 30, 2026
Merged

Bug: Agent retries overwrite manually-set 'done' status#3191
mabry1985 merged 1 commit intodevfrom
feature/bug-agent-retries-overwrite-manually

Conversation

@mabry1985
Copy link
Copy Markdown
Contributor

@mabry1985 mabry1985 commented Mar 30, 2026

Summary

When a feature is manually set to 'done' via update_feature while an agent is still running for it, the agent's failure/retry logic overwrites the status back to 'in_progress' with statusChangeReason 'Max agent retries exceeded (3)'. The done status should be authoritative — a running agent should check current status before overwriting and bail if the feature is already done/verified. Observed on feature-1774719460192-zwdq8xqoh in mythxengine project.


Recovered automatically by Automaker post-agent hook

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Processors now recognize when a feature has been manually marked as complete and skip further processing, preventing unintended re-operations on finalized work.
  • Tests

    • Added test coverage for feature completion detection and processing guards.

@mabry1985 mabry1985 enabled auto-merge (squash) March 30, 2026 02:30
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds pre-transition guards to both the EscalateProcessor and ExecuteProcessor services that prevent further processing when a feature's current persisted status is already in a terminal state (done or verified). The guards log informational messages and return early with a suppressed state transition. Comprehensive test coverage validates this guard behavior.

Changes

Cohort / File(s) Summary
Processing Guards
apps/server/src/services/lead-engineer-escalation.ts, apps/server/src/services/lead-engineer-execute-processor.ts
Added identical pre-transition guards at the start of process() methods that reload the feature's persisted status; if terminal (done or verified), processing is skipped with a suppressed state transition and informational log.
Test Coverage
apps/server/tests/unit/services/lead-engineer-escalation.test.ts
Added new test suite validating that EscalateProcessor correctly detects terminal feature states and skips processing without updating the persisted status, while allowing normal flow for non-terminal states.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A guard stands watch at the gate so tall,
Checking the status before the call,
If done or verified, no need to roam—
The feature's already found its home! 🏠

🚥 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 accurately describes the main bug being fixed: preventing agent retries from overwriting a manually-set 'done' status, which is the core issue addressed across both lead-engineer service modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bug-agent-retries-overwrite-manually

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

@mabry1985 mabry1985 merged commit 78158a8 into dev Mar 30, 2026
3 of 4 checks passed
@mabry1985 mabry1985 deleted the feature/bug-agent-retries-overwrite-manually branch March 30, 2026 02:32
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