Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 23, 2025

Description

Refs: Slack thread about heap OOM issue with 4GB limit for sites with many APIs and dynamic snippets enabled.

Link to Devin run: https://app.devin.ai/sessions/abfbace3e8f64052bee3081a040ec10e
Requested by: Catherine Deskur (catherine@buildwithfern.com)

Adds a new --api-concurrency flag to fern generate --docs that limits the number of APIs processed concurrently during docs generation. This helps prevent heap OOM issues for sites with many APIs and dynamic snippets enabled.

Changes Made

  • Add --api-concurrency CLI option to the docs generation command
  • Implement semaphore-based concurrency limiting in DocsDefinitionResolver.toApiSectionNode()
  • Thread the apiConcurrency parameter through: CLI → generateDocsWorkspace → runRemoteGenerationForDocsWorkspace → publishDocs → DocsDefinitionResolver
  • Add changelog entry (v3.32.0)

Testing

  • Lint checks pass (pnpm run check)
  • CI checks pass
  • Unit tests added/updated (no new tests added)
  • Manual testing with large multi-API site (not tested locally)

Human Review Checklist

  • Verify the hand-rolled semaphore implementation in createSemaphore() correctly handles acquire/release
  • Verify the try-finally block in toApiSectionNode() properly releases the semaphore in all code paths (including exceptions)
  • Confirm default behavior (no flag = no concurrency limit) is preserved

…ing during docs generation

- Add --api-concurrency flag to fern generate --docs command
- Implement semaphore-based concurrency limiting in DocsDefinitionResolver
- Thread apiConcurrency parameter through the call chain

This helps prevent heap OOM issues for sites with many APIs and dynamic snippets enabled.

Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants