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
- Verify Wave Terminal is running and reachable, then retry the badge command.
- Re-check the block/tab oref is still valid (block not closed).
- Inspect the wrapped cause for connection vs. routing failures.
- 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
- Verify Wave Terminal connectivity before publishing events.
- Confirm the scoped oref still exists.
- Retry on transient event-bus failures.
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
- source cannot be blank
- nil wshrpc passed to wshclient
- creating new chat: %w
- adding file %s: %w
- adding context: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/24c5b1ffa1d2380d.
Report an issue: GitHub.