fix(v2): botBrowser refuses a negative volume level
level=-10 was read as 10 (the sign was dropped) and unmuted the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -479,8 +479,8 @@ class BotBrowserTool(Tool):
|
||||
elif action == "back":
|
||||
call = lambda s: s.back()
|
||||
elif action == "volume":
|
||||
m = re.search(r"\d+(?:\.\d+)?", str(args.get("level") if args.get("level") is not None else ""))
|
||||
if not m:
|
||||
m = re.search(r"-?\d+(?:\.\d+)?", str(args.get("level") if args.get("level") is not None else ""))
|
||||
if not m or float(m.group()) < 0:
|
||||
return _fail("volume needs a level from 0 to 100")
|
||||
level = min(100, round(float(m.group())))
|
||||
call = lambda s: s.volume(level)
|
||||
|
||||
Reference in New Issue
Block a user