Skip to content

fix: add 5min timeout to npm reify to prevent silent deadlocks#31468

Open
7emotions wants to merge 1 commit into
anomalyco:devfrom
7emotions:fix/npm-reify-timeout
Open

fix: add 5min timeout to npm reify to prevent silent deadlocks#31468
7emotions wants to merge 1 commit into
anomalyco:devfrom
7emotions:fix/npm-reify-timeout

Conversation

@7emotions

@7emotions 7emotions commented Jun 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31463

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Npm.add() in packages/core/src/npm.ts calls Arborist reify() when the npm cache is cold. reify() can deadlock silently with no error. This PR wraps it with Effect.timeout("5 minutes") so a hang surfaces as a visible error through the existing plugin error pipeline, instead of blocking the process indefinitely.

How did you verify your code works?

Effect.timeout("5 minutes") is the same pattern already used elsewhere in the codebase ("30 seconds", "10 seconds"). The timeout path cannot be triggered under normal conditions — it is a safety net for the rare deadlock case.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Arborist reify() called by Npm.add() can deadlock silently when the npm
cache is cold (resolving @latest specifiers). Adding Effect.timeout
surfaces the error instead of hanging indefinitely.

Related: anomalyco#23143 (@latest triggers full reify with no TTL cache)
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Plugin import hangs silently when resolving npm specifiers (e.g. oh-my-openagent@latest)

1 participant