fix(browser): make startup reattach opt-in - #2203
Merged
Merged
Conversation
Reattaching on every start turned out to be too eager. The browser only keeps its approval grant while it stays running, so whenever the browser had restarted since the last connection, BitFun's startup reattach put an approval dialog in front of the user before they had asked for the browser at all. Gate it behind ai.browser_control_auto_connect_on_startup, off by default, alongside the default CDP row it applies to. The setting's description says what turning it on does, including the dialog after a browser restart, and what stays true when it is off: BitFun attaches the first time an agent needs the browser.
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.
Follow-up to #2196, reported from use.
The problem
#2196 reattaches to a running browser on every BitFun start. That is free while the browser stays up, but the browser only keeps its approval grant for its own process lifetime. Whenever the browser had restarted since the last connection, the startup reattach raised an "Allow remote debugging?" dialog before the user had asked for the browser at all — which is what happened in practice.
Change
Gate it behind
ai.browser_control_auto_connect_on_startup, off by default, as a switch under the Default CDP row it applies to.The description states what the user is opting into rather than just naming the option:
Off is not a regression from before #2196: the on-demand path still attaches the first time an agent needs the browser, and the "Ready, connects on use" status from #2196 already says so.
en-US/zh-CN/zh-TWall carry the full text.Verified
cargo check -p bitfun-core -p bitfun-desktop,tsc --noEmit(0 errors), locale JSON validated, default confirmedfalsein both the struct andDefault.