fix(desktop): only default CEF debugging port when endpoint is live#385
Open
seasidespace wants to merge 2 commits into
Open
fix(desktop): only default CEF debugging port when endpoint is live#385seasidespace wants to merge 2 commits into
seasidespace wants to merge 2 commits into
Conversation
The daemon launcher unconditionally injected
PUFFER_CEF_REMOTE_DEBUGGING_PORT=9333 for the local daemon, even on
builds where the native CEF runtime was never compiled in or had not
opened its DevTools endpoint. The daemon then honored that port,
attempted to attach to a CEF browser that was not there, and either hard
-errored ("native CEF DevTools on loopback port 9333 was not reachable")
or split-brained against a flaky managed-Chrome fallback whose
/json/new tab creation intermittently timed out.
Probe the loopback DevTools endpoint before defaulting the port, so the
launcher only advertises 9333 when CEF is actually serving a browser
WebSocket URL. Otherwise the daemon cleanly uses the managed-Chrome
screencast fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@seasidespace is attempting to deploy a commit to the fuzzland Team on Vercel. A member of the Team first needs to authorize it. |
The daemon only attempted native CEF when PUFFER_CEF_REMOTE_DEBUGGING_PORT
was present in its environment. The desktop launcher injects that port,
but only if CEF is already serving on 9333 at daemon-spawn time. CEF
warms up asynchronously at app start, so a daemon that spawned during the
warmup window never received the port and was pinned to the managed-Chrome
screencast fallback for its entire lifetime -- which Google blocks during
Gmail sign-in ("This browser or app may not be secure").
Discover CEF at session-spawn time instead: when the port is not
explicitly configured, probe the default loopback port (9333) briefly and
use CEF if it is actually serving, otherwise fall back gracefully to the
managed-Chrome backend. When the port IS explicitly configured we keep the
previous patient 30s startup wait and hard-error on an unreachable
endpoint. This eliminates the race without adding latency to non-CEF
builds (1s probe) and without changing explicit-opt-in behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Two related fixes so the desktop app reliably uses the native CEF browser (a full, non-headless Chromium) for connector logins like Gmail, instead of dropping to the managed-Chrome screencast fallback that Google blocks with "This browser or app may not be secure."
1. Launcher: only default the CEF port when the endpoint is actually live (
daemon_launcher.rs)PUFFER_CEF_REMOTE_DEBUGGING_PORT=9333for the local daemon, even on builds without a native CEF runtime. The daemon then tried to attach to a CEF browser that wasn't there and hard-errored or split-brained against the fallback.9333when CEF is serving a browser WebSocket URL.2. Daemon: discover native CEF lazily to remove the startup race (
daemon_browser/session.rs)Test plan
cargo check --libfor thecorbinadesktop crate passes.cargo test -p puffer-cli— newdaemon_browser::session::tests(explicit port waits patiently; missing port probes the default briefly and falls back) pass; launcher env tests pass.PUFFER_CEF_REMOTE_DEBUGGING_PORTand stayed on the headless fallback; with lazy discovery it attaches to CEF on 9333.npm run tauri devand immediately open the Gmail connector — badge should read native CEF (not "Screencast fallback") and Google should allow sign-in.🤖 Generated with Claude Code