fix: skip route-resolution for server-side auth commands; pass key_spec not loaded key
Testing / test (push) Failing after 14m2s

browser-cli.auth.keys and browser-cli.auth.trust are handled by serve.py
directly and never need a _route profile, so they no longer trigger
_auto_route_remote (which would open a second connection just to discover
available browser profiles).

Also fixes _auto_route_remote receiving an already-loaded AgentKey object
instead of the key spec string — the nested send_command call couldn't
re-load it for signing, causing auth failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-02 20:03:50 +02:00
parent b87f536ecd
commit fcd2e8b87b
+3 -2
View File
@@ -315,8 +315,9 @@ def send_command(command: str, args: dict | None = None, profile: str | None = N
if private_key is None and resolved_token: if private_key is None and resolved_token:
msg["token"] = resolved_token msg["token"] = resolved_token
route_profile = requested_profile route_profile = requested_profile
if not route_profile and command != "browser-cli.targets": _no_route_commands = {"browser-cli.targets", "browser-cli.auth.keys", "browser-cli.auth.trust"}
route_profile = _auto_route_remote(remote_endpoint, resolved_token, key=private_key) if not route_profile and command not in _no_route_commands:
route_profile = _auto_route_remote(remote_endpoint, resolved_token, key=key_spec)
if route_profile: if route_profile:
msg["_route"] = route_profile msg["_route"] = route_profile
else: else: