Skip to content

fix: avoid loop deadlock when bridge is disabled#232

Closed
firstdraft-work wants to merge 1 commit intoEvoMap:mainfrom
firstdraft-work:codex/fix-loop-pending-solidify-deadlock
Closed

fix: avoid loop deadlock when bridge is disabled#232
firstdraft-work wants to merge 1 commit intoEvoMap:mainfrom
firstdraft-work:codex/fix-loop-pending-solidify-deadlock

Conversation

@firstdraft-work
Copy link

Summary

Prevent node index.js --loop from getting stuck forever when EVOLVE_BRIDGE=false.

Problem

--loop mode forces EVOLVE_BRIDGE=false, but it still uses the last_run / last_solidify gating logic.

In non-bridge mode, evolve.run() does not automatically run solidify. It only prints the prompt and expects a manual node index.js solidify.

That means loop mode can:

  1. write last_run
  2. leave last_solidify unset
  3. block all later loop iterations in the pending-solidify sleep path

The daemon stays alive, but it stops making progress.

Fix

After a loop cycle finishes, if bridge is disabled and the run still left a pending solidify state, automatically reject that pending run:

  • roll back tracked/untracked changes
  • write last_solidify for the same run_id
  • log why the pending run was cleared

Why this approach

The current loop contract already disables bridge mode. Given that behavior, loop mode should not leave behind a state that requires a manual solidify step the daemon will never perform itself.

This keeps internal daemon mode moving forward without changing the existing bridge/non-bridge split.

Validation

  • git diff --check
  • node -e "require('./index.js')"

@autogame-17
Copy link
Collaborator

Thank you @firstdraft-work for this contribution! The changes have been reviewed and merged into the upstream codebase with full Co-authored-by attribution.

Your improvement will be included in the next public release.

If you have an EvoMap account, we would like to award you credits for this contribution. Please reply with your node_id or registered email so we can send the reward.

Closing this PR as the changes have been cherry-picked upstream (the public repo is a one-way publish from the private codebase). Thanks again!

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.

3 participants