wavetermdev/waveterm · warning

playing system bell: %v

Error message

playing system bell: %v

What it means

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.

Source

Thrown at cmd/wsh/cmd/wshcmd-badge.go:102

			PidLinked: badgePid > 0,
		}
	}

	event := wps.WaveEvent{
		Event:  wps.Event_Badge,
		Scopes: []string{oref.String()},
		Data:   eventData,
	}

	err = wshclient.EventPublishCommand(RpcClient, event, &wshrpc.RpcOpts{NoResponse: true})
	if err != nil {
		return fmt.Errorf("publishing badge event: %v", err)
	}

	if badgeBeep {
		err = wshclient.ElectronSystemBellCommand(RpcClient, &wshrpc.RpcOpts{Route: "electron"})
		if err != nil {
			return fmt.Errorf("playing system bell: %v", err)
		}
	}

	if badgePid > 0 && eventData.Badge != nil {
		conn := RpcContext.Conn
		if conn == "" {
			conn = wshrpc.LocalConnName
		}
		connRoute := wshutil.MakeConnectionRouteId(conn)
		watchData := wshrpc.CommandBadgeWatchPidData{
			Pid:     badgePid,
			ORef:    *oref,
			BadgeId: eventData.Badge.BadgeId,
		}
		err = wshclient.BadgeWatchPidCommand(RpcClient, watchData, &wshrpc.RpcOpts{Route: connRoute})
		if err != nil {
			return fmt.Errorf("watching pid: %v", err)
		}

View on GitHub (pinned to a4447c1563)

Solutions

  1. Drop the --beep flag if no Electron GUI is attached (badge already published successfully).
  2. Ensure the Wave desktop app (electron layer) is running and connected.
  3. Retry the command once the electron route is available.
  4. Check the wrapped cause to confirm it's a route/connection issue rather than an OS audio problem.

Example fix

// before (headless/remote, electron route missing)
wsh badge --beep block:abc "alert"  # playing system bell: ...

// after
wsh badge block:abc "alert"  # badge still set, beep omitted
Defensive patterns

Strategy: fallback

Try / catch

err := wshclient.ElectronSystemBellCommand(RpcClient, &wshrpc.RpcOpts{Route: "electron"})
if err != nil {
    // non-fatal: badge already published; log and continue without beep
}

Prevention

When it happens

Trigger: `wsh badge --beep ...` where ElectronSystemBellCommand fails: the electron route is unavailable (headless/remote connection without the Wave GUI) or the RPC errors.

Common situations: 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.

Related errors


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