Skip to content

fix(tui): move app.agents from blocking to non-blocking bootstrap - #27448

Closed
litown wants to merge 1 commit into
anomalyco:devfrom
litown:fix/tui-blank-page-agents-blocking
Closed

litown wants to merge 1 commit into
anomalyco:devfrom
litown:fix/tui-blank-page-agents-blocking

Conversation

@litown

@litown litown commented May 14, 2026

Copy link
Copy Markdown

Summary

  • Move agentsPromise from blockingRequests to non-blocking Promise.all in SyncProvider.bootstrap()
  • Adjust response array indices (agents removed from blocking section)

Problem

The TUI shows a blank page indefinitely when the app.agents HTTP request hangs. This happens because:

  1. SyncProvider.bootstrap() puts ALL initial HTTP requests into a blockingRequests array
  2. The ready getter returns store.status !== "loading", which blocks the entire component tree from rendering until all blocking requests complete
  3. app.agents triggers Agent.Service initialization via lazy InstanceState/ScopedCache
  4. If Agent.Service init encounters filesystem errors (e.g. ENAMETOOLONG on deeply nested node_modules/.pnpm paths in the project directory), the error is not properly propagated, causing the request to hang forever
  5. Result: TUI never renders — user sees a blank screen

Fix

Move agentsPromise from blockingRequests to the non-blocking section (alongside command.list, lsp.status, mcp.status, etc.). The TUI now renders as soon as essential data (providers, config, project) is available, while agents load asynchronously in the background with .catch(() => {}).

The agents data is still populated into the store when the request eventually resolves — the UI just doesn't block on it.

Testing

  • Verified TUI renders successfully in ~1.5s with the fix applied
  • Agent list populates correctly after initial render
  • No regression in normal startup flow

🤖 Generated with Claude Code

The app.agents HTTP request can hang indefinitely when Agent.Service
initialization encounters filesystem errors (e.g. ENAMETOOLONG on deeply
nested node_modules paths). Since it was included in the blocking requests
array, the entire TUI rendering was blocked waiting for it.

Moving agentsPromise to the non-blocking section allows the TUI to render
as soon as essential data (providers, config, project) is available, while
agents load asynchronously in the background.

Fixes: TUI blank page when agent initialization is slow or hangs.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 14, 2026
@github-actions github-actions Bot closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant