Skip to content

fix(issue): Crash recovery leaves unit_dispatches row at 'running', causing silent infinite already_active skip loop#6183

Open
jeremymcs wants to merge 3 commits into
mainfrom
issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832
Open

fix(issue): Crash recovery leaves unit_dispatches row at 'running', causing silent infinite already_active skip loop#6183
jeremymcs wants to merge 3 commits into
mainfrom
issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832

Conversation

@jeremymcs
Copy link
Copy Markdown
Collaborator

Summary

  • Added a consecutive already-active skip guard in auto loop and verified crash-recovery dispatch cleanup plus loop behavior with focused tests.

Bugs Addressed

  • Crash recovery leaves stale running unit_dispatches row (skipped: already fixed in current branch; crash recovery already cancels latest active dispatch for stale worker.)
  • Auto loop silently spins on already_active dispatch skips

Verification

  • Completed in the repository worktree before push.

Related Issue

Repo

  • gsd-build/gsd-2

Branch

  • issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832

repeated `already-active` dispatch skips now pause with an explicit user-visible error after a small consecutive threshold.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@jeremymcs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 55 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fa273f2e-4808-4365-82b6-8e59ce50ae50

📥 Commits

Reviewing files that changed from the base of the PR and between db89d64 and c371ff8.

📒 Files selected for processing (6)
  • docs/user-docs/auto-mode.md
  • docs/user-docs/troubleshooting.md
  • mintlify-docs/guides/auto-mode.mdx
  • mintlify-docs/guides/troubleshooting.mdx
  • src/resources/extensions/gsd/auto/loop.ts
  • src/resources/extensions/gsd/tests/auto-loop.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

🔴 PR Risk Report — CRITICAL

Files changed 6
Systems affected 1
Overall risk 🔴 CRITICAL

Affected Systems

Risk System
🔴 critical Auto Engine
File Breakdown
Risk File Systems
🔴 src/resources/extensions/gsd/auto/loop.ts Auto Engine
docs/user-docs/auto-mode.md (unclassified)
docs/user-docs/troubleshooting.md (unclassified)
mintlify-docs/guides/auto-mode.mdx (unclassified)
mintlify-docs/guides/troubleshooting.mdx (unclassified)
src/resources/extensions/gsd/tests/auto-loop.test.ts (unclassified)

⚠️ 🔴 Critical risk — the following systems require verification before merge:

  • 🔴 Auto Engine: validate auto-mode trigger conditions and loop termination

⛔ This PR should not be merged without executing this follow-up prompt.

Ask your coding agent to verify before submitting:

Review this PR for risks in: Auto Engine. Verify:

1. validate auto-mode trigger conditions and loop termination

Before modifying any code, assess the scope of this fix:

- Identify the root cause, not just the reported symptom.
- Search the codebase for other call sites, similar patterns, or duplicated logic that may share the same bug.
- List affected tests, documentation, and any downstream consumers that depend on the current behavior.
- Flag any changes that extend beyond the immediate file or function.

Report findings first. Then propose a fix scoped to the actual root cause, and wait for confirmation before applying changes outside the originally reported location.

💡 Have a Codex subscription? Get an independent second opinion: codex review --adversarial

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

🤖 Dispatched codex with the following prompt:

Agent prompt (click to expand)
You are acting as an autonomous PR babysitter for gsd-build/gsd-2 PR #6183.
PR URL: https://github.com/gsd-build/gsd-2/pull/6183
Base repository: gsd-build/gsd-2
Head repository: gsd-build/gsd-2
Head branch: issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832
Head remote: origin
You are running inside an isolated app-owned worktree under ~/.patchdeck.
Make only targeted changes that resolve the approved tasks.
Do not wait for user input, confirmation, or approval at any point.
Do not rewrite unrelated files.
Use the available git tooling for inspection and verification only.
If dependencies are missing, install them using the repository's lockfile/package manager as needed inside this isolated worktree.
Leave file edits uncommitted; the babysitter app will handle Git finalization after your run.
GitHub follow-up replies and review-thread resolution will be handled by the babysitter after your run.
If a task is invalid after inspection, explain it in your final response and include the exact audit token.

Approved review-comment tasks:
None

Approved status-check tasks:
None

Approved documentation tasks:
Documentation updates are required for this PR.
Assessment summary: Auto-mode behavior changed: after 3 consecutive "already-active" dispatch skips, it now pauses and requires manual recovery. Operator/runtime docs (and any troubleshooting docs) should note this new safeguard and pause condition.
Update the appropriate repository documentation for these changes.
Choose the right docs files for this repository (for example README, docs pages, API/config/operator docs).
If, after inspection, the repository documentation is already accurate or there is no appropriate docs target, leave docs unchanged and report that using the docs summary block with `no_change`.

When done:
1) Run the relevant verification for your changes.
2) Leave any changed files in the worktree for the babysitter app to finalize.
3) For each feedback item you addressed or were blocked on, emit a summary block in the following format:
   FEEDBACK_SUMMARY_START <auditToken>
   <A concise 1-2 sentence summary of what you did or why you were blocked>
   FEEDBACK_SUMMARY_END
   Include one block per audit token. These summaries will be posted as follow-up comments on the PR.
4) If documentation tasks were assigned, emit exactly one docs summary block in the following format:
   DOCS_SUMMARY_START <changed|no_change>
   <A concise 1-2 sentence summary of the docs you updated, or why no docs changes were necessary after inspection>
   DOCS_SUMMARY_END

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

⚠️ CI Alert

The babysitter pushed changes (commit 162f89c), but CI/CD checks are still failing:

  • lint: Check run failure (details)

Manual investigation may be required.

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

jeremymcs commented May 16, 2026

Accepted — this comment requires code changes. Queuing fix...
🧰 Agent runningcodex is working on the fix...
Agent completed — verifying changes...
🎉 Resolved — addressed in commit c371ff8.

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

🤖 Dispatched codex with the following prompt:

Agent prompt (click to expand)
You are acting as an autonomous PR babysitter for gsd-build/gsd-2 PR #6183.
PR URL: https://github.com/gsd-build/gsd-2/pull/6183
Base repository: gsd-build/gsd-2
Head repository: gsd-build/gsd-2
Head branch: issue/5730-crash-recovery-leaves-unit-dispatches-ro-1778892832
Head remote: origin
You are running inside an isolated app-owned worktree under ~/.patchdeck.
Make only targeted changes that resolve the approved tasks.
Do not wait for user input, confirmation, or approval at any point.
Do not rewrite unrelated files.
Use the available git tooling for inspection and verification only.
If dependencies are missing, install them using the repository's lockfile/package manager as needed inside this isolated worktree.
Leave file edits uncommitted; the babysitter app will handle Git finalization after your run.
GitHub follow-up replies and review-thread resolution will be handled by the babysitter after your run.
If a task is invalid after inspection, explain it in your final response and include the exact audit token.

Approved review-comment tasks:
1. [general_comment] jeremymcs
   file=n/a line=n/a
   sourceId=4464907336 sourceUrl=https://github.com/gsd-build/gsd-2/pull/6183#issuecomment-4464907336
   replyKind=general_comment threadId=n/a threadResolved=n/a
   auditToken=codefactory-feedback:gh-issue-comment-4464907336
   ## ⚠️ CI Alert

The babysitter pushed changes (commit `162f89c`), but CI/CD checks are still failing:

- **lint**: Check run failure ([details](https://github.com/gsd-build/gsd-2/actions/runs/25948621210/job/76281898653))

Manual investigation may be required.

Approved status-check tasks:
None

Approved documentation tasks:
None

When done:
1) Run the relevant verification for your changes.
2) Leave any changed files in the worktree for the babysitter app to finalize.
3) For each feedback item you addressed or were blocked on, emit a summary block in the following format:
   FEEDBACK_SUMMARY_START <auditToken>
   <A concise 1-2 sentence summary of what you did or why you were blocked>
   FEEDBACK_SUMMARY_END
   Include one block per audit token. These summaries will be posted as follow-up comments on the PR.
4) If documentation tasks were assigned, emit exactly one docs summary block in the following format:
   DOCS_SUMMARY_START <changed|no_change>
   <A concise 1-2 sentence summary of the docs you updated, or why no docs changes were necessary after inspection>
   DOCS_SUMMARY_END

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

Addressed in commit c371ff8 by the latest babysitter run.

Responding to comment by @jeremymcs:

⚠️ CI Alert

I investigated the failing lint alert by running the same CI lint pipeline checks locally against this PR branch, and all checks now pass on the current head commit. No further targeted code changes were necessary after verification.

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.

Crash recovery leaves unit_dispatches row at 'running', causing silent infinite already_active skip loop

1 participant