Skip to content

Slow chat startup: npx commands for mcp, @upsta, and @model block chat initiation #820

Closed

Description

@netanelbi

There is a noticeable delay when starting a chat session in opencode. When a user opens opencode and writes in the chat (e.g., "hi"), there is a delay before a response appears. This appears to be due to the application executing npx commands for multiple processes—such as loading the mcp servers, as well as @upsta and @model—right when a chat session is initiated, which may hold up the main thread and block chat responsiveness.

Questions to consider:

  • Does loading the mcp servers need to hold the main thread, or could it be deferred or parallelized?
  • Can the startup of @upsta and @model (also using npx) be optimized so chat is available more quickly?

Steps to reproduce:

  1. Open opencode.
  2. Write "hi" in the chat.
  3. Notice the delay before receiving a response.

Expected behavior:j Chat should respond with minimal delay. Startup times should be improved by optimizing how and when npx is run for mcp, @upsta, and @model, and by exploring whether mcp loading can avoid holding the main thread.

Activity

  1. self-assigned this
    on Jul 10, 2025
  2. pbnj commented on Jul 24, 2025

    @pbnj

    I notice this in particular the more MCP servers are registered and enabled.

    With 5 MCP servers enabled:

    Image

    With the same 5 MCP servers disabled:

    Image

    Interactively with 5 MCP servers enabled (~15s for a response):

    GMT20250724-203238_Clip_Peter.they_them.s.Clip.07_24_2025.mp4

    Interactively with the same 5 MCP servers disabled (~1s for a response):

    GMT20250724-203656_Clip_Peter.they_them.s.Clip.07_24_2025.mp4
  3. arsham commented on Aug 23, 2025

    @arsham

    Have you found any solution to this?

  4. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions