wavetermdev/waveterm · error

invalid simple id format: %s

Error message

invalid simple id format: %s

What it means

parseSimpleId validates a user-provided simple id (like 'this', 'block', or a full/short UUID) before dispatching to per-type resolvers. This error is thrown when the string matches none of the known formats: it is neither a keyword nor a valid UUID/short-UUID. It is a client-input validation failure, not a lookup failure.

Source

Thrown at pkg/wshrpc/wshserver/resolvers.go:78

	// check for [view]:N format
	if viewBlockRe.MatchString(simpleId) {
		return "view", simpleId, nil
	}

	// Check for plain number (block reference)
	if _, err := strconv.Atoi(simpleId); err == nil {
		return "blocknum", simpleId, nil
	}

	// Check for UUIDs
	if _, err := uuid.Parse(simpleId); err == nil {
		return "uuid", simpleId, nil
	}
	if shortUUIDRe.MatchString(strings.ToLower(simpleId)) {
		return "uuid8", simpleId, nil
	}

	return "", "", fmt.Errorf("invalid simple id format: %s", simpleId)
}

// Individual resolvers
func resolveThis(ctx context.Context, data wshrpc.CommandResolveIdsData, value string) (*waveobj.ORef, error) {
	if data.BlockId == "" {
		return nil, fmt.Errorf("no blockid in request")
	}

	if value == SimpleId_This || value == SimpleId_Block {
		return &waveobj.ORef{OType: waveobj.OType_Block, OID: data.BlockId}, nil
	}
	if value == SimpleId_Tab {
		tabId, err := wstore.DBFindTabForBlockId(ctx, data.BlockId)
		if err != nil {
			return nil, fmt.Errorf("error finding tab: %v", err)
		}
		return &waveobj.ORef{OType: waveobj.OType_Tab, OID: tabId}, nil
	}

View on GitHub (pinned to a4447c1563)

Solutions

  1. Pass one of the supported keywords (this/block/tab/ws/workspace) or a valid full/short UUID.
  2. Validate the id with the shortUUIDRe/uuid pattern before sending.
  3. Use tab completion or the UI's object picker to copy a correct id.
  4. Check for whitespace or casing issues; short UUIDs are matched case-insensitively but other formats are not accepted.

Example fix

// before
resolveIds(ctx, "blk-42")
// after
resolveIds(ctx, "a1b2c3d4") // valid short UUID, or "this"/"block" keyword
Defensive patterns

Strategy: validation

Validate before calling

var uuidRe = regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`)
var shortUUIDRe = regexp.MustCompile(`^[0-9a-fA-F]{8}$`)
var keywords = map[string]bool{"this":true,"block":true,"tab":true,"ws":true,"workspace":true,"wsh":true}
func isValidSimpleId(s string) bool {
    return keywords[s] || uuidRe.MatchString(s) || shortUUIDRe.MatchString(strings.ToLower(s))
}

Type guard

func validSimpleId(s string) (string, bool) {
    if keywords[s] || uuidRe.MatchString(s) || shortUUIDRe.MatchString(strings.ToLower(s)) {
        return s, true
    }
    return "", false
}

Try / catch

oref, err := wshclient.ResolveIdsCommand(ctx, wshrpc.CommandResolveIdsData{SimpleId: id, BlockId: blockId}, nil)
if err != nil && strings.Contains(err.Error(), "invalid simple id format") {
    return fmt.Errorf("%q is not a keyword or valid UUID: %w", id, err)
}

Prevention

When it happens

Trigger: Calling the ResolveIds command with a simpleId string that is not a recognized keyword ('this','block','tab','ws','workspace','wsh') and is not a valid full or 8-char short UUID — e.g. typos, URLs, object names, or truncated ids shorter than 8 chars.

Common situations: Users typing shortcuts in the command palette that aren't valid ids; scripts passing block names instead of UUIDs; copying an id and dropping characters; using a 6-char prefix where the regex requires 8.

Related errors


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