wavetermdev/waveterm · error
resolving block: %v
Error message
resolving block: %v
What it means
badgeRun resolves its positional/flag arguments into a Wave object reference (oref) via resolveBlockArg. If resolution fails — the argument doesn't match a known block, tab, or the default context is missing — the error is wrapped as "resolving block: %v".
Source
Thrown at cmd/wsh/cmd/wshcmd-badge.go:59
badgeCmd.Flags().BoolVar(&badgeBeep, "beep", false, "play system bell sound")
badgeCmd.Flags().IntVar(&badgePid, "pid", 0, "watch a pid and automatically clear the badge when it exits (default priority 5)")
}
func badgeRun(cmd *cobra.Command, args []string) (rtnErr error) {
defer func() {
sendActivity("badge", rtnErr == nil)
}()
if badgePid > 0 && runtime.GOOS == "windows" {
return fmt.Errorf("--pid flag is not supported on Windows")
}
if badgePid > 0 && !cmd.Flags().Changed("priority") {
badgePriority = 5
}
oref, err := resolveBlockArg()
if err != nil {
return fmt.Errorf("resolving block: %v", err)
}
if oref.OType != waveobj.OType_Block && oref.OType != waveobj.OType_Tab {
return fmt.Errorf("badge oref must be a block or tab (got %q)", oref.OType)
}
var eventData baseds.BadgeEvent
eventData.ORef = oref.String()
if badgeClear {
eventData.Clear = true
} else {
icon := "circle-small"
if len(args) > 0 {
icon = args[0]
}
badgeId, err := uuid.NewV7()
if err != nil {
return fmt.Errorf("generating badge id: %v", err)View on GitHub (pinned to a4447c1563)
Solutions
- Run the command inside a Wave terminal block so the default block can be resolved, or pass an explicit valid block/tab reference.
- List current blocks/tabs in Wave and copy the correct oref.
- Verify the referenced block wasn't closed; reopen and use the new id.
- Check the wrapped cause (%v) for whether the argument was empty vs. not found.
Example fix
// before (no block context) $ wsh badge "alert" # resolving block: no block found // after (explicit target) $ wsh badge --block tab:xyz123 "alert"
Defensive patterns
Strategy: validation
Validate before calling
if blockRef == "" {
// pass an explicit block/tab reference or run inside a Wave block
} Try / catch
if err != nil {
return fmt.Errorf("resolving block: %w", err) // surface wrapped cause to user
} Prevention
- Run wsh badge inside a Wave terminal block so default resolution works.
- Copy orefs fresh from Wave; stale ids fail resolution.
- Validate the reference format before invoking.
When it happens
Trigger: `wsh badge` run without a valid block specifier: no resolvable default block in scope, or an explicitly passed block id/ref that doesn't exist or is malformed.
Common situations: Running `wsh badge` from a shell not attached to any Wave block; referencing a block id from a previous Wave session (stale id); typo in the block reference.
Related errors
- no files or message provided
- too many files (maximum %d files allowed)
- stdin (-) can only be used once
- WAVETERM_TABID environment variable not set
- watching pid: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/5ac2a00412f522bb.
Report an issue: GitHub.