Skip to content

Zoo Code view stays blank when it is open at VS Code startup #2710

Description

@DiamondGo

Problem (one or two sentences)

The Zoo Code view can stay blank after VS Code starts. The provider misses the webviewDidLaunch message, so it never sends state to the webview.

Context (who is affected and when)

This affects users who keep the Zoo Code view open when they close VS Code. At the next start, the view is visible, and VS Code resolves it during extension activation (onView:zoo-code.SidebarProvider). The same problem occurs after "Developer: Reload Window" while the view is open. If the user opens the view after startup is complete, the view loads correctly.

Reproduction steps

  1. Open the Zoo Code view. The sidebar and the secondary sidebar both show the problem.
  2. Keep the view open and close VS Code. As an alternative, run "Developer: Reload Window".
  3. Start VS Code.
  4. Look at the Zoo Code view.

Expected result

The view shows the welcome screen or the current task.

Actual result

The view stays blank. The output channel shows no error, and the watchdog does not start a recovery.

Variations tried (optional)

  • "Zoo Code: Retry Interface Recovery" restores the view. The problem occurs again at the next start.
  • If a different view in the same container is active when VS Code closes, the problem does not occur.
  • Version 3.98.1 has the same code path.

App Version

3.98.2. Current main (ca43e69) has the same code. VS Code 1.148.0, Linux x64.

Relevant logs or errors (optional)

initializeWebviewView() assigns webview.html. Then it waits for getState(). Only after that does it call setWebviewMessageListener(). The webview posts webviewDidLaunch and the first webviewHeartbeat when App mounts. VS Code does not keep webview messages for a listener that is added later. On a cold start, getState() took about 2 seconds, and the webview mounted before the listener existed.

I attached a debugger to the extension host and read diagnosticsRecorder.snapshot():

Time (UTC) Event
17:51:18.094 view-resolved
about 17:51:19.07 The webview mounts. This time is one heartbeat interval (30 seconds) before the first heartbeat that the provider received.
about 17:51:20.49 initializeWebviewView() installs the message listener, after getState() completes.
17:51:49.075 The first webview-in event. It is a webviewHeartbeat. No webviewDidLaunch event arrives.

After this, isViewLaunched stays false, so the provider never posts state. Heartbeats arrive every 30 seconds, so the watchdog sees a healthy webview and does not recover it.

I will open a PR that installs the message listener before the provider assigns the HTML.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    35ee4bf
  2. DiamondGo commented on Nov 25, 2026

    @DiamondGo
    ContributorAuthor

    Claiming

  3. added a commit that references this issue on Nov 26, 2026
    f36e6bf
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