wavetermdev/waveterm · error

window %s not found

Error message

window %s not found

What it means

Error from `wsh blocks list --window <id>` when no workspace in the fetched list contains a window with the given id. The command scans all workspaces for a matching window OID; if none matches, windowFound stays false and this error is returned with the id echoed back.

Source

Thrown at cmd/wsh/cmd/wshcmd-blocks.go:137

	// Determine which workspaces to query
	if blocksWorkspaceId != "" && blocksWindowId != "" {
		return fmt.Errorf("--workspace and --window are mutually exclusive; specify only one")
	}
	if blocksWorkspaceId != "" {
		workspaceIdsToQuery = []string{blocksWorkspaceId}
	} else if blocksWindowId != "" {
		// Find workspace ID for this window
		windowFound := false
		for _, ws := range workspaces {
			if ws.WindowId == blocksWindowId {
				workspaceIdsToQuery = []string{ws.WorkspaceData.OID}
				windowFound = true
				break
			}
		}
		if !windowFound {
			return fmt.Errorf("window %s not found", blocksWindowId)
		}
	} else {
		// Default to all workspaces
		for _, ws := range workspaces {
			workspaceIdsToQuery = append(workspaceIdsToQuery, ws.WorkspaceData.OID)
		}
	}

	// Query each selected workspace
	hadSuccess := false
	for _, wsId := range workspaceIdsToQuery {
		req := wshrpc.BlocksListRequest{WorkspaceId: wsId}
		if blocksWindowId != "" {
			req.WindowId = blocksWindowId
		}

		blocks, err := wshclient.BlocksListCommand(RpcClient, req, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})
		if err != nil {

View on GitHub (pinned to a4447c1563)

Solutions

  1. Re-list windows to get current ids (`wsh blocks list` without --window or the Wave UI)
  2. Verify the window is still open in the connected Wave instance
  3. Double-check the id was copied in full — OIDs are long
  4. Use --workspace or no filter instead if you don't need the window scope

Example fix

// before
wsh blocks list --window 8f2a1c
// after
wsh blocks list --window 8f2a1c9e-4b3d-4e2f-9a01-55c0ffee1234
Defensive patterns

Strategy: validation

Validate before calling

// resolve the window id freshly from live data before scoping
found := false
for _, ws := range workspaces {
    if ws.WorkspaceData.WindowId == windowId { found = true; break }
}
if !found { return fmt.Errorf("window %s not found; list current windows first", windowId) }

Try / catch

if err := runBlocksList(); err != nil && strings.Contains(err.Error(), "window") && strings.Contains(err.Error(), "not found") {
    // re-fetch ids and retry without --window
}

Prevention

When it happens

Trigger: Passing --window with a value that does not match any open window: a closed window's id, a truncated or mistyped OID, an id from a different Wave instance, or an id copied from stale JSON output.

Common situations: Reusing ids saved from earlier sessions after windows were closed; copying only part of the OID; querying a different Wave instance than the one that produced the id.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/e50031c3123b733c. Report an issue: GitHub.