{"record":{"id":"27569930b8b6ebc7","repo":"wavetermdev/waveterm","slug":"playing-system-bell-v","errorCode":null,"errorMessage":"playing system bell: %v","messagePattern":"playing system bell: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/wsh/cmd/wshcmd-badge.go","lineNumber":102,"sourceCode":"\t\t\tPidLinked: badgePid > 0,\n\t\t}\n\t}\n\n\tevent := wps.WaveEvent{\n\t\tEvent:  wps.Event_Badge,\n\t\tScopes: []string{oref.String()},\n\t\tData:   eventData,\n\t}\n\n\terr = wshclient.EventPublishCommand(RpcClient, event, &wshrpc.RpcOpts{NoResponse: true})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"publishing badge event: %v\", err)\n\t}\n\n\tif badgeBeep {\n\t\terr = wshclient.ElectronSystemBellCommand(RpcClient, &wshrpc.RpcOpts{Route: \"electron\"})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"playing system bell: %v\", err)\n\t\t}\n\t}\n\n\tif badgePid > 0 && eventData.Badge != nil {\n\t\tconn := RpcContext.Conn\n\t\tif conn == \"\" {\n\t\t\tconn = wshrpc.LocalConnName\n\t\t}\n\t\tconnRoute := wshutil.MakeConnectionRouteId(conn)\n\t\twatchData := wshrpc.CommandBadgeWatchPidData{\n\t\t\tPid:     badgePid,\n\t\t\tORef:    *oref,\n\t\t\tBadgeId: eventData.Badge.BadgeId,\n\t\t}\n\t\terr = wshclient.BadgeWatchPidCommand(RpcClient, watchData, &wshrpc.RpcOpts{Route: connRoute})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"watching pid: %v\", err)\n\t\t}","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-badge.go#L84-L120","documentation":"If --beep is passed, badgeRun additionally invokes ElectronSystemBellCommand routed to \"electron\" to play the terminal bell. Failure of that RPC is wrapped as \"playing system bell: %v\". The badge itself was already published at this point.","triggerScenarios":"`wsh badge --beep ...` where ElectronSystemBellCommand fails: the electron route is unavailable (headless/remote connection without the Wave GUI) or the RPC errors.","commonSituations":"Running wsh badge from a remote machine connected to a server-side Wave session with no local Electron GUI; Wave app's electron layer busy or disconnected.","solutions":["Drop the --beep flag if no Electron GUI is attached (badge already published successfully).","Ensure the Wave desktop app (electron layer) is running and connected.","Retry the command once the electron route is available.","Check the wrapped cause to confirm it's a route/connection issue rather than an OS audio problem."],"exampleFix":"// before (headless/remote, electron route missing)\nwsh badge --beep block:abc \"alert\"  # playing system bell: ...\n\n// after\nwsh badge block:abc \"alert\"  # badge still set, beep omitted","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := wshclient.ElectronSystemBellCommand(RpcClient, &wshrpc.RpcOpts{Route: \"electron\"})\nif err != nil {\n    // non-fatal: badge already published; log and continue without beep\n}","preventionTips":["Only use --beep when the Wave desktop (electron) layer is attached.","Treat bell failure as non-fatal; the badge was already set.","Skip --beep in headless/remote setups."],"tags":["rpc","electron","cli"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}