First of all, do not code a custom reduce function when it is not necessary. If you need some basic mathematical function such as sum, count, statistics use the built-in functions. See the section Reduce Functions
So based on your view (not sure to understand the key to 1, I guess this is a simple test), this is the expected behavior:
when you execute the view without any parameter, the reduce function will be used to so the some of “all the keys” without any group: so no key, sum of values = 123.
Then you can select the group level, in your case you have a single group, so you can do group_level=1
and you will see key:1, value 123
BTW, is there a list of parameter introductions? and is there a good way to add these parameters while debugging, do I have to manually add them to the test URL?