Skip to content

fix(app): limit file tree concurrent requests to prevent ERR_INSUFFICIENT_RESOURCES#21856

Open
Dredok wants to merge 2 commits intoanomalyco:devfrom
Dredok:fix/file-tree-concurrency
Open

fix(app): limit file tree concurrent requests to prevent ERR_INSUFFICIENT_RESOURCES#21856
Dredok wants to merge 2 commits intoanomalyco:devfrom
Dredok:fix/file-tree-concurrency

Conversation

@Dredok
Copy link
Copy Markdown

@Dredok Dredok commented Apr 10, 2026

Issue for this PR

Closes #21853

Type of change

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

What does this PR do?

Adds a concurrency limiter (semaphore, max 6) to the file tree's directory listing requests. Without it, expanding a project with many directories fires one HTTP request per directory simultaneously, exhausting the browser's per-host connection pool and causing ERR_INSUFFICIENT_RESOURCES.

The semaphore is module-scoped so it's shared across project switches — prevents the pool from being drained when switching between large projects.

How did you verify your code works?

  • Opened a project with 80+ directories — tree loads without errors, Network tab shows max 6 concurrent requests at a time.
  • Switched between projects rapidly — no connection pool exhaustion.
  • bun typecheck passes from packages/opencode.

Screenshots / recordings

No UI changes.

Checklist

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

@Dredok Dredok requested a review from adamdotdevin as a code owner April 10, 2026 09:28
@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 Apr 10, 2026
@github-actions
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.

File tree exhausts browser connection pool when many directories expand at once

1 participant