feat: add private Agent Browser takeover - #189
QueryPlanner wants to merge 35 commits into
Conversation
- Restore browser takeover lifecycle and route coverage - Clean up failed and expired browser streams - Reject malformed takeover redemption tokens
QueryPlanner
left a comment
There was a problem hiding this comment.
I found one blocking correctness issue in the takeover lifecycle. CI is green, but the current tests explicitly encode the problematic behavior: a WebSocket disconnect or upstream connection failure is treated the same as the user clicking Done. That can resume the agent with a false success signal before authentication is complete. I’d fix that before merging.
| except Exception: | ||
| await websocket.close(code=1011) | ||
| finally: | ||
| await service.complete(token) |
There was a problem hiding this comment.
Blocking: this runs for every WebSocket termination, including the user closing the tab, losing network, or connect(...) failing. complete() sets the event that start_browser_takeover() interprets as successful human completion, so the model can resume with status=success even though the user never clicked Done or finished login. The new route tests currently assert this behavior for disconnect/upstream-error paths. Only /complete should mark the lease complete; WebSocket teardown should close the proxy and leave the lease waiting until explicit Done or expiry. Please add a regression test for disconnect/failure not completing the lease.
- Cover client and server protocol rejection branches - Cover origin normalization and stream filtering - Keep CI coverage at 100 percent
What
Add a private, one-time Agent Browser takeover flow for sensitive human login steps in Telegram.
Why
Let the authenticated Telegram user enter passwords, OTPs, or CAPTCHA responses directly in the existing session browser without exposing those values to the model or ADK history.
How
start_browser_takeoveronly for the private Telegram root agent.Tests
uv run ruff format --checkuv run ruff check --output-format=githubuv run mypy .uv run pytest --cov=src --cov-report=xml --cov-report=term-missing(2,144 passed, 1 skipped, 100% coverage)uv run python -m compileall -q srcgit diff --checkRelated Issues