can1357/oh-my-pi · error

Unsupported wire type ${wireType} in ListValue

Error message

Unsupported wire type ${wireType} in ListValue

What it means

Same manual protobuf guard as the Struct decoder, but for google.protobuf.ListValue: a field tag carrying a wire type not in the supported set aborts decoding. ListValue is a repeated message, so an unsupported wire type means the stream is not valid protobuf for this schema.

Source

Thrown at packages/catalog/src/discovery/protobuf.ts:1063

					entryReader.skip(entryWire);
				}
			}
			output[entryKey] = entryVal;
		} else {
			reader.skip(wireType);
		}
	}
	return output;
}

function readJsonList(reader: Reader): JsonValue[] {
	const list: JsonValue[] = [];
	while (reader.pos < reader.len) {
		const tag = reader.uint32();
		const fieldNumber = tag >>> 3;
		const wireType = tag & 7;
		if (!isWireType(wireType)) {
			throw new Error(`Unsupported wire type ${wireType} in ListValue`);
		}
		if (fieldNumber === 1) {
			assertWireType(wireType, 2);
			list.push(readJsonValue(new Reader(reader.bytes())));
		} else {
			reader.skip(wireType);
		}
	}
	return list;
}

View on GitHub (pinned to 9690622007)

Solutions

  1. Check the HTTP response for corruption/injected error pages in the binary body
  2. Retry the discovery request; transient truncation is common
  3. Upgrade the catalog package to pick up decoder fixes
  4. Report the failing payload upstream with a hex dump
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const list = decodeListValue(reader);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("Unsupported wire type")) {
    logger.warn("Malformed protobuf ListValue; retrying fetch", { cause: err });
    return retryFetch();
  }
  throw err;
}

Prevention

When it happens

Trigger: Decoding a ListValue whose tag byte encodes a wire type outside the supported range (e.g. malformed varint stream, wire type 6/7).

Common situations: Truncated binary response, middleware corrupting binary bodies, or a provider changing serialization in a way the hand-rolled reader can't handle.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/6fbdd730c49f7b1a. Report an issue: GitHub.