Repository navigation
Agent follow-ups: bridge login, unlock prompt, quick window, recent chats - #131
Merged
Merged
Conversation
The app bridge's tool list (browser-bridge.ts) gains `login`. It calls a new
async CDP command, Browser.redrobLogin, whose handler finds the tab and hands
it to TaskStore::LoginFromBridge in the browser process. That runs the same
CredentialTools gate (policy, per-site list, unlock window), the same
password-manager fill and the same audit log as the in-browser agent's tool,
recorded under task id "app-bridge". The answer is CredentialTools'
model-facing text, so no password can reach the bridge. A locked store
answers at once ("ask the user to unlock") since the bridge has no task to
park.
Hand patches edited: Browser.pdl, inspector_protocol_config.json,
browser_handler.{h,cc}, devtools/BUILD.gn (dep on //chrome/browser/redrob:sidecar).
A task parked on a locked store (While unlocked policy, credential wait with needs_unlock) now raises the same "Task needs you" OS notification a guarded click does, with the waiting-unlock text and one Unlock button. The button reveals the task's tab and calls TaskStore::UnlockCredentials anchored to it: the same DeviceAuthenticator re-auth Settings uses, and on success OnCredentialsUnlocked resumes every waiting task and retries the fill. No unlock is attempted without an anchor tab, because CredentialTools::Unlock treats a null anchor as "no authenticator" and would skip the OS prompt on macOS/Windows. New string: taskNotifyUnlock.
With no browser window open, the quick window was the only thing on screen and nothing held the process, so it could exit under it. QuickWindowService now holds a ScopedKeepAlive and a ScopedProfileKeepAlive (the same BACKGROUND_MODE_MANAGER / kBackgroundMode origins TaskStore::UpdateKeepAlive uses for surviving tasks) from Show() until Close(). Close releases them with DeleteSoon after the widget's own deletes, so shutdown cannot start while the window's WebContents is still alive; Shutdown() drops them synchronously.
With tabs across the top the sidebar column, and its recent-chats section, is hidden. AttachToolbarAccess now adds a chats button (chat_spark icon, "Chats" name/tooltip) between the avatar and Settings; it opens a menu of the same rows the sidebar shows. RecentChats() is factored out of RebuildChats so both surfaces read one list (TaskStore::ListTasks, newest first, kMaxChatRows), and a menu item goes through the same OpenChat. Empty state is the sidebar's own note as a disabled item. Menu commands use their own id range in the shared ExecuteCommand. History (Ctrl+H) untouched.
Any CDP client on the debugging port could ask the agent to sign in. The browser now makes a per-run secret (app_bridge_token.h), gives it only to the agent server it launches, in that child's environment (POSIX LaunchOptions, Windows CreateProcessW environment block), and Browser.redrobLogin refuses a call without it (constant-time compare). The bridge's login tool reads REDROB_APP_BRIDGE_TOKEN and sends it as bridgeToken.
…_token.h redrob.py export over the applied checkout: index hashes and hunk headers of the hand-edited patches now match the tree they were built from. Adds the new app_bridge_token.h to sources/manifest so apply copies it.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's done
loginon the app bridge: the phone/daemon can ask the browser to sign in. Same VaultPolicy, fill path and audit log as the in-browser tool; the model never sees the password.Browser.redrobLogin: per-run secret, handed only to the agent server the browser launches (child environment, not argv), constant-time check.redrob.py exportnormalisation of the hand-edited patches.What's not done
OpenChat); it does not jump into the chat.What to review
sources/chrome/browser/redrob/app_bridge_token.hand the twoserver_process_launcher*.ccpatches (Windows environment block viaAlterEnvironment+CREATE_UNICODE_ENVIRONMENT).browser_handler.ccRedrobLogin: the token check runs before any tab lookup.Intentions
Close the gaps v0.3.0 shipped with. Built once locally (linux release, 0 failures); the binary started, the agent server got the bridge secret in its environment and the browser process itself did not.