Repository navigation
fix(daemon): serve the browser extension on loopback when the binding needs client certs - #1779
Merged
Merged
Conversation
… needs client certs In a Kubernetes workspace pod the operator serves the AG-UI binding with mutual TLS, so a browser extension in the same pod, which dials plain ws://127.0.0.1 with a token and cannot present a client certificate, was locked out of the daemon. When the extension backend is on and the binding requires client certificates, the daemon now also listens on plain 127.0.0.1:<browser_use.extension.port> with the extension token, the same handshake, origin check and handler, and none of the binding's HTTP routes, so the terminal, screen, artifacts and peer endpoint stay behind mTLS. Boot fails clearly when that port is the binding's or the extension token is empty. Every other setup keeps its single listener.
This was referenced Nov 9, 2026
Merged
edenreich
marked this pull request as ready for review
November 9, 2026 17:12
Contributor
|
🎉 This PR is included in version 0.251.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
A computer-use workspace pod now runs Firefox with the opentask extension, so its agent can use the cheaper
browser_*tools. The extension dials the daemon at plainws://127.0.0.1:<port>/wsand authenticates with a token in itsbrowser_hello. In a Kubernetes pod, though, the operator serves the daemon's AG-UI binding as0.0.0.0:52789with mutual TLS. That binding was the only listener, so the extension could never connect.When the extension backend is on and the binding requires client certificates, the daemon now also listens on plain
127.0.0.1:<browser_use.extension.port>for the extension. That listener uses the extension token, the same handshake, origin check and handler, and none of the binding's HTTP routes, so the terminal, screen, artifacts and peer A2A endpoint stay behind mTLS. Every other configuration keeps its single listener.Changes
config/daemon.go:(*Config).ExtensionLoopback()is a pure config rule. It answers whether the loopback listener is needed and what it serves, and it fails boot clearly in two cases:daemon.binding.portthat falls back to itservesMutualTLS()is TLS on with client certificates required.config/browser_use.go: anextensionBackend()helper.cmd/daemon/daemon.go:startExtensionLoopbackstarts the listener after the main binding, closes the main binding if the loopback fails, and closes the loopback on stop.startThreadsbuilds the handler once.config/daemon_test.go: a table test covering when the listener is needed, the port fallback, and both errors.tests/e2e/daemon_test.go: with a binding that requires client certs:chrome-extension://WebSocket on the loopback port getsbrowser_hello_ack/terminal/on the loopback port answers 404This test fails against the daemon without this change.
docs/daemon.md: one paragraph in "The binding".Verified:
task lintreports 0 issues, and theconfig,cmd,aguiandbrowsertests pass.task test:e2epasses.browser extension attached).Related:
user_data: feat(workspaces): pass cloud-init user_data to kubernetes workspaces #1777