#2015·serena

Open Dashboard Only After Client Handshake

Author: cybernaglCreated Sep 11, 2026Updated Sep 17, 2026
Labelsblocked

Feature request: with web_dashboard_open_on_launch: true, open the dashboard browser tab only after the first successful MCP initialize handshake, not at process startup.

Context

Follow-up to #1886, which was closed with the (correct) diagnosis that Claude Code starts two instances of the MCP server and that each instance has its own dashboard. Our logs show what the first instance actually is: a short-lived tool-discovery probe that never serves a session. Opening a browser tab for it is pure noise.

Per Claude Code launch (2.1.236, stdio, --context=claude-code --project-from-cwd), two Serena processes start about 2 seconds apart:

  1. Process 1 starts, opens a dashboard tab, then receives a server/discover request (a Claude Code discovery extension unknown to the pinned mcp==1.28.1 SDK), logs a validation warning, and is killed by the client roughly 2 seconds after spawn. It never completes an initialize handshake.
  2. Process 2 starts, opens a second tab, completes a normal initialize handshake, and serves the session.

Log evidence (two files per launch in ~/.serena/logs/<date>/; the first process's log ends with this warning, the second's log contains no such warning and the process survives):

WARNING ... root:_receive_loop:383 - Failed to validate request: 31 validation errors for ClientRequest
PingRequest.method
  Input should be 'ping' [type=literal_error, input_value='server/discover', input_type=str]
InitializeRequest.method
  Input should be 'initialize' [type=literal_error, input_value='server/discover', input_type=str]
...

Problem

Every Claude Code session launch opens two browser tabs, one of them for a process that lives about two seconds. With several parallel sessions per day this produces a stack of dead tabs. The gui_log_window comment in serena_config.yml already acknowledges that clients start multiple server instances in "mysterious ways"; the dashboard auto-open suffers from the same client behavior.

Proposal

Defer the browser-open until the server has completed its first successful initialize exchange with a client:

  • Discovery/probe processes never open a tab (they are killed before, or never handshake).
  • A normal session still gets exactly one tab, just a moment later.
  • No behavior change for web_dashboard_open_on_launch: false.

Workaround

web_dashboard_open_on_launch: false works fine; the dashboard stays reachable on its port. But the default experience for users following the recommended Claude Code setup is two tabs per session launch.

Environment

  • Serena 1.7.0 (uv tool install serena-agent, Python 3.13, mcp==1.28.1)
  • Claude Code 2.1.236
  • macOS 15.7 (arm64)