wavetermdev/waveterm · error

publishing badge event: %v

Error message

publishing badge event: %v

What it means

After composing the BadgeEvent, badgeRun publishes it with EventPublishCommand (NoResponse). If the publish RPC fails, the error is wrapped as "publishing badge event: %v". This is the step that actually delivers the badge to the Wave UI.

Source

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

		}
		eventData.Badge = &baseds.Badge{
			BadgeId:   badgeId.String(),
			Icon:      icon,
			Color:     badgeColor,
			Priority:  badgePriority,
			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,

View on GitHub (pinned to a4447c1563)

Solutions

  1. Verify Wave Terminal is running and reachable, then retry the badge command.
  2. Re-check the block/tab oref is still valid (block not closed).
  3. Inspect the wrapped cause for connection vs. routing failures.
  4. Reconnect the wsh session (rerun from a live Wave block).
Defensive patterns

Strategy: retry

Try / catch

err := wshclient.EventPublishCommand(RpcClient, event, &wshrpc.RpcOpts{NoResponse: true})
if err != nil {
    // check Wave is running; retry publish
}

Prevention

When it happens

Trigger: EventPublishCommand returns an error: no connection to the Wave app, the event bus rejects the publish, or the scoped route (oref) is unreachable.

Common situations: Wave Terminal not running or just restarted; connection between wsh CLI and the Wave server dropped; publishing to an oref whose block/tab no longer exists.

Related errors


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