{"record":{"id":"e50031c3123b733c","repo":"wavetermdev/waveterm","slug":"window-s-not-found","errorCode":null,"errorMessage":"window %s not found","messagePattern":"window (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-blocks.go","lineNumber":137,"sourceCode":"\n\t// Determine which workspaces to query\n\tif blocksWorkspaceId != \"\" && blocksWindowId != \"\" {\n\t\treturn fmt.Errorf(\"--workspace and --window are mutually exclusive; specify only one\")\n\t}\n\tif blocksWorkspaceId != \"\" {\n\t\tworkspaceIdsToQuery = []string{blocksWorkspaceId}\n\t} else if blocksWindowId != \"\" {\n\t\t// Find workspace ID for this window\n\t\twindowFound := false\n\t\tfor _, ws := range workspaces {\n\t\t\tif ws.WindowId == blocksWindowId {\n\t\t\t\tworkspaceIdsToQuery = []string{ws.WorkspaceData.OID}\n\t\t\t\twindowFound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !windowFound {\n\t\t\treturn fmt.Errorf(\"window %s not found\", blocksWindowId)\n\t\t}\n\t} else {\n\t\t// Default to all workspaces\n\t\tfor _, ws := range workspaces {\n\t\t\tworkspaceIdsToQuery = append(workspaceIdsToQuery, ws.WorkspaceData.OID)\n\t\t}\n\t}\n\n\t// Query each selected workspace\n\thadSuccess := false\n\tfor _, wsId := range workspaceIdsToQuery {\n\t\treq := wshrpc.BlocksListRequest{WorkspaceId: wsId}\n\t\tif blocksWindowId != \"\" {\n\t\t\treq.WindowId = blocksWindowId\n\t\t}\n\n\t\tblocks, err := wshclient.BlocksListCommand(RpcClient, req, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})\n\t\tif err != nil {","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-blocks.go#L119-L155","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-list windows to get current ids (`wsh blocks list` without --window or the Wave UI)","Verify the window is still open in the connected Wave instance","Double-check the id was copied in full — OIDs are long","Use --workspace or no filter instead if you don't need the window scope"],"exampleFix":"// before\nwsh blocks list --window 8f2a1c\n// after\nwsh blocks list --window 8f2a1c9e-4b3d-4e2f-9a01-55c0ffee1234","handlingStrategy":"validation","validationCode":"// resolve the window id freshly from live data before scoping\nfound := false\nfor _, ws := range workspaces {\n    if ws.WorkspaceData.WindowId == windowId { found = true; break }\n}\nif !found { return fmt.Errorf(\"window %s not found; list current windows first\", windowId) }","typeGuard":null,"tryCatchPattern":"if err := runBlocksList(); err != nil && strings.Contains(err.Error(), \"window\") && strings.Contains(err.Error(), \"not found\") {\n    // re-fetch ids and retry without --window\n}","preventionTips":["Always copy full OIDs, never truncated ids","Re-resolve window ids each run — they change when windows close","Fall back to workspace-level or unfiltered listing when the window id may be stale"],"tags":["cli","wsh","lookup-failed","identifiers"],"backgroundTag":"resource-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}