Skip to content

fix(desktop): preview browser presents as Chrome so sites accept sign-in - #45049

Merged
maria-rcks merged 1 commit into
mainfrom
t3/preview-browser-sign-in-identity
Nov 28, 2026
Merged

maria-rcks merged 1 commit into
mainfrom
t3/preview-browser-sign-in-identity

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Desktop preview, before and after: the User-Agent each part of a page sees, then WhatsApp Web.

before: every surface of the desktop preview sends T3CodeBeta/0.0 and Electron/44.10.1 in its User-Agent

after: page, fetch, dedicated, shared and service workers all send Chrome/152.0.0.0 with no app or Electron token

before: WhatsApp Web in the desktop preview shows "WhatsApp works with Google Chrome 100+"

after: WhatsApp Web in the desktop preview shows its "Scan to log in" QR page

Sites block sign-in in the desktop preview browser because its User-Agent carries the app token and Electron/ (report: https://x.com/PepperonPete/status/2126707108041359771). WhatsApp serves its unsupported-browser page, Entra leaves out passkeys, Google serves its lite sign-in flow, and the GoHighLevel sign-in in #37739 stalls until Electron/ is gone. Main only patched Teams by host. #7110 removed the last global rewrite because session.setUserAgent broke Cloudflare Turnstile with error 600010. The cause turned out to be workers: shared and service workers read Electron's app-wide fallback, not the session, so pages saw two identities.

Preview sessions now set app.userAgentFallback to Chrome's reduced User-Agent (Electron's own string without the app and Electron/ tokens, Chrome/<major>.0.0.0). Every surface, workers included, reports the same value Chromium 152 sends. The app window's default session is pinned to its native User-Agent first, so the T3 window and Settings > Authorized clients still say Electron. The Teams host rewrite is no longer needed and is gone. This also covers the Entra hosts from #30018.

Measured on Linux with a real desktop build (Electron 44.10.1), clean profiles, no credentials typed:

site main this PR
WhatsApp Web "works with Google Chrome 100+" QR sign-in
Entra authorize page fIsFidoSupported absent true
Google sign-in flowName=WebLiteSignIn GlifWebSignIn
Teams Microsoft sign-in Microsoft sign-in
dash.cloudflare.com/login, 40 s no Turnstile errors no Turnstile errors
GitHub login loads loads

To show the Turnstile check means something: in the same Electron, session.setUserAgent with this exact string logged [Cloudflare Turnstile] Error: 600010 17 times in 35 s. The fallback logged none. The server-side preview (web and mobile stream it) already presents as Chrome and is unchanged. Mobile has no browser of its own.

Checks: vp test run src/preview/BrowserSession.test.ts (25 pass, existing file extended), desktop typecheck, vp run check:changed.

Not verified: macOS and Windows desktop builds (only Linux was run; the UA rewrite is covered for all three formats in the test). No completed sign-in anywhere, since no accounts were used: GoHighLevel (#37739), More Rewards (#41732), an Entra passkey, and a submitted Turnstile login. The X report names no site, so its exact case is unknown.

Council review

Rounds: 1

Delegate Round 1
GPT Sol 9/10
GPT Sol (second seat; Gemini Neon out of quota) 9/10

Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

Sites reject the preview's native Electron User-Agent: WhatsApp shows its
unsupported-browser page, Entra hides passkeys, GoHighLevel sign-in stalls.
Preview sessions now use Chrome's reduced User-Agent through the app-wide
fallback, which workers also read, so Turnstile still passes. The app
window keeps its native identity.
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

BrowserSession now sets a reduced Chrome User-Agent as Electron’s app-wide fallback while preserving the native User-Agent on the default session when needed. It also removes Teams-specific request rewriting and adds client hints only to eligible requests that lack sec-ch-ua.

Changes: Preview User-Agent handling

Layer / File(s) Summary
Set preview User-Agent and handle request headers
apps/desktop/src/preview/BrowserSession.ts, apps/desktop/src/preview/BrowserSession.test.ts
chromeUserAgent derives a reduced Chrome User-Agent. Session creation updates the app fallback and, when the values differ, sets the default session to the native User-Agent. The request callback adds client hints only to eligible main-frame or subframe requests without sec-ch-ua; the Teams-specific rewrite is removed. Tests cover the fallback, preview sessions, workers, and reduced User-Agent formatting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BrowserSession
  participant ElectronApp
  participant DefaultSession
  participant PreviewRequest
  BrowserSession->>ElectronApp: Read userAgentFallback
  BrowserSession->>DefaultSession: Set native User-Agent when values differ
  BrowserSession->>ElectronApp: Set reduced Chrome User-Agent fallback
  PreviewRequest->>BrowserSession: Provide URL and request headers
  BrowserSession-->>PreviewRequest: Add client hints when eligible and sec-ch-ua is absent
Loading

Possibly related issues

  • Issue 30014: The issue reports that Entra hides passkeys when the outgoing User-Agent contains Electron/. This change removes that token from the preview User-Agent, but the Windows passkey case is not verified.
  • Issue 37739: The issue reports GoHighLevel sign-in failure and suggests the User-Agent may be involved. This change uses a reduced Chrome identity, but GoHighLevel is listed as unverified.

Suggested reviewers: juliusmarminge, nasimawabdy

Merge Risk: Minimal · up to 8ad44

Preview browser sessions now present a reduced Chrome User-Agent so sites offer their normal sign-in flows, and the app window keeps its native identity. The reviewed change shows no concrete risk to merging. macOS and Windows behavior was not verified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the desktop preview browser now presents a Chrome User-Agent so sites accept sign-in. The raw summary confirms this: preview sessions set app.userAgentFallback to a r…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template's main sections: Problem, Change, Scope, and Verification. It explains the problem with a concrete report of sites blocking sign-in because the preview User-Agent …
Full details: Title check

Explanation

The title states the main change: the desktop preview browser now presents a Chrome User-Agent so sites accept sign-in. The raw summary confirms this: preview sessions set app.userAgentFallback to a reduced Chrome User-Agent, and the Teams-specific rewrite is removed. The title follows the conventional commit form and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Change, Scope, and Verification. It explains the problem with a concrete report of sites blocking sign-in because the preview User-Agent contains the app token and Electron/. It describes the change: preview sessions set app.userAgentFallback to Chrome's reduced User-Agent while the app window keeps its native identity, and the Teams host rewrite is removed. Scope cites prior issues (#7110, #30018, #37739, #41732) and the X report, but it gives no explicit statement that this is a bug fix rather than a feature. Verification is detailed: it lists the test command and results (25 pass), typecheck, a measured Linux before/after table, and a Turnstile comparison. It also lists unverified items (macOS, Windows, completed sign-ins). Screenshots are embedded for the UI change. The template's required agent attribution line is present (the PR notes Claude Code and the model). The description is thorough and mostly complete, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4acea8c and 8ad4466.

Files selected for processing: 2

  • apps/desktop/src/preview/BrowserSession.test.ts
  • apps/desktop/src/preview/BrowserSession.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@maria-rcks
maria-rcks merged commit 79355c0 into main Nov 28, 2026
39 checks passed
@maria-rcks
maria-rcks deleted the t3/preview-browser-sign-in-identity branch November 28, 2026 20:05
imetn added a commit to imetn/t4code that referenced this pull request Nov 29, 2026
…, web/desktop, sidebar perf)

Ports 38 selected upstream PRs from v0.1.14-nightly.20261128.5399 while preserving all T4 Code locked customizations, zero-telemetry stance, and self-hosted infrastructure:
- Mobile (5): pingdotgg#45003, pingdotgg#45131, pingdotgg#45106, pingdotgg#44947, pingdotgg#45108
- Server & Agents (11): pingdotgg#45102, pingdotgg#31357, pingdotgg#41766, pingdotgg#45078, pingdotgg#45152, pingdotgg#44922, pingdotgg#45137, pingdotgg#30062, pingdotgg#45058, pingdotgg#34051, pingdotgg#31293
- Web & Desktop (21): pingdotgg#45049, pingdotgg#45023, pingdotgg#45032, pingdotgg#45051, pingdotgg#45035, pingdotgg#45080, pingdotgg#45034, pingdotgg#45076, pingdotgg#45132, pingdotgg#45044, pingdotgg#45167, pingdotgg#45168, pingdotgg#30170, pingdotgg#45081, pingdotgg#45046, pingdotgg#45084, pingdotgg#45085, pingdotgg#45104, pingdotgg#45013, pingdotgg#45043, pingdotgg#45074
- Optional sidebar perf graft (1, user-approved): pingdotgg#45026 (useSidebarMobile)

Also addresses independent pre-merge review catches (inline code protection in markdown links, Object.hasOwn guard for custom run stop reasons, and revisioned asset URL refresh for workspace images).
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 29, 2026
## What's Changed
* fix(server): scheduled tasks keep their original creation source when updated by @only21mil in pingdotgg/t3code#45031
* fix(web,mobile): queued-message edits save /usage-limits as text by @viktorce in pingdotgg/t3code#45013
* fix(web): refreshing workspace files reloads open large file previews by @only21mil in pingdotgg/t3code#45035
* fix(web): Files panel Retry clears errors from collapsed folders by @only21mil in pingdotgg/t3code#45046
* fix(server): overloaded-machine warnings never list a busy process as 0 cores by @iamshadmantaqi in pingdotgg/t3code#45045
* fix(web): copied chat text keeps plain closing brackets so math rendering does not pick them up by @iamshadmantaqi in pingdotgg/t3code#45043
* fix(web): Cmd/Ctrl+A in table and large text previews selects only the file by @iamshadmantaqi in pingdotgg/t3code#45044
* fix(devices): Test connection says when Node or npm is missing on an SSH host by @watashiwaaniket in pingdotgg/t3code#33198
* fix(web): image preview no longer closes when a press is dragged across its edge by @iamshadmantaqi in pingdotgg/t3code#45051
* fix(cli): select the linked project for files that do not exist yet by @only21mil in pingdotgg/t3code#45054
* fix(server): old-log cleanup removes deleted threads' provider event logs by @juliusmarminge in pingdotgg/t3code#45058
* fix(web): Copy as CSV keeps values under their headers when cells are merged by @iamshadmantaqi in pingdotgg/t3code#45056
* fix(server): refuse worktrees from ancestor repositories by @voltcrash in pingdotgg/t3code#31293
* fix(web): share hover delays between adjacent subagent previews by @brandon-julio-t in pingdotgg/t3code#34145
* fix(server): search snippets do not start with a detached mark or skin tone by @iamshadmantaqi in pingdotgg/t3code#45061
* fix(server): threads launched without a branch record the checkout's by @radomirml in pingdotgg/t3code#34051
* fix(server): avoid completion alerts before delegated work resumes by @AkiVonAkira in pingdotgg/t3code#31357
* fix(server): sessions imported from a reftable worktree keep their real branch by @iamshadmantaqi in pingdotgg/t3code#45062
* fix(web): hide Copy contents when a large text attachment fails to authorize by @only21mil in pingdotgg/t3code#45066
* fix(web): image preview size follows the app language by @iamshadmantaqi in pingdotgg/t3code#45067
* fix(client): a delivered queued message hidden by an old cache shows again by @EtanHey in pingdotgg/t3code#41766
* fix(client-runtime): highlight attached short inline scripts for python, perl, and ruby by @only21mil in pingdotgg/t3code#45063
* fix(server): preserve trailing history when Windows ConPTY starts a terminal by @birdringxD in pingdotgg/t3code#45048
* fix(client-runtime): an approved step no longer reads "and used 1 tool" by @AymanKhan9 in pingdotgg/t3code#45074
* fix(web): refreshing workspace files reloads images in large Markdown previews by @iamshadmantaqi in pingdotgg/t3code#45076
* fix(web): restore highlighted stashed prompt on Enter from stash badge by @only21mil in pingdotgg/t3code#45081
* fix(server): t3 update no longer says a service with an unreadable home serves another one by @iamshadmantaqi in pingdotgg/t3code#45082
* fix(web): refreshing workspace files reloads open PDF previews by @only21mil in pingdotgg/t3code#45080
* fix(server): re-importing a deleted Claude Code or Codex session brings its thread back by @juliusmarminge in pingdotgg/t3code#45078
* fix(scripts): dev runner skips a port the OS reserves instead of stopping by @NickoGNS in pingdotgg/t3code#45075
* fix(web): a lone file read shows its path relative to the workspace by @AymanKhan9 in pingdotgg/t3code#45085
* fix(client-runtime): PR diff order follows the source beside a test, not a same-named one elsewhere by @iamshadmantaqi in pingdotgg/t3code#45077
* fix(shared): avoid splitting combining marks when truncating by @only21mil in pingdotgg/t3code#45086
* fix(client-runtime): refreshing the issue list keeps pages loaded with Load more by @juliusmarminge in pingdotgg/t3code#45084
* fix(server): Cursor recovers on its own after a network outage by @maria-rcks in pingdotgg/t3code#44922
* fix(mobile): settings and keyboard palette list projects in desktop order by @maria-rcks in pingdotgg/t3code#44947
* fix(web): clear stale pull request resolution error when editing input by @only21mil in pingdotgg/t3code#45095
* fix(web): sidebar toggle no longer re-renders every thread row by @maria-rcks in pingdotgg/t3code#45026
* fix(desktop): preview browser presents as Chrome so sites accept sign-in by @maria-rcks in pingdotgg/t3code#45049
* fix(web): model picker provider tooltips open at once when moving between icons by @iamshadmantaqi in pingdotgg/t3code#45097
* fix(web): Enter saves the drawing after using the annotation toolbar by @only21mil in pingdotgg/t3code#45098
* fix(cli): reject blank --track folder values in t3 project add by @only21mil in pingdotgg/t3code#45100
* fix(client-runtime): psql -Atc and mysql -Ne scripts are highlighted as SQL in the work log by @iamshadmantaqi in pingdotgg/t3code#45099
* fix(server): Antigravity turns end when a subagent goes idle without send_message by @juliusmarminge in pingdotgg/t3code#45102
* fix(web): large text row, column and line counts follow the app language by @iamshadmantaqi in pingdotgg/t3code#45103
* fix(web): thread details Servers rows share the tooltip hover delay by @iamshadmantaqi in pingdotgg/t3code#45113
* fix(web): archive and SQLite preview counts and dates follow the app language by @only21mil in pingdotgg/t3code#45116
* fix(web): drop duplicate imports from merged attachment preview tests by @juliusmarminge in pingdotgg/t3code#45146
* fix(mobile): removing a queued edit attachment also removes its chip from the text by @iamshadmantaqi in pingdotgg/t3code#45106
* fix(mobile): side chats can be deleted from the phone by @juliusmarminge in pingdotgg/t3code#45131
* fix(server): a linked peer that answers again no longer lists a stale error by @juliusmarminge in pingdotgg/t3code#45137
* fix(web,mobile): "Stopped by user" follows the app language by @AymanKhan9 in pingdotgg/t3code#45108
* fix(web): remote subagent tooltips resolve child provider and thread by @only21mil in pingdotgg/t3code#45104
* fix(web): stashed prompt previews no longer cut a combining mark off its letter by @iamshadmantaqi in pingdotgg/t3code#45140
* fix(web): keys pressed on a focused audio player stay with the player by @only21mil in pingdotgg/t3code#45145
* fix(server): t3 project add refuses a blank path instead of adding the current folder by @iamshadmantaqi in pingdotgg/t3code#45151
* fix(web): refreshing workspace files reloads open image, video and audio previews by @iamshadmantaqi in pingdotgg/t3code#45132
* fix(client-runtime): highlight fish -lc and other bundled flags in the work log by @iamshadmantaqi in pingdotgg/t3code#45159
* fix(client-runtime): shell heredocs run with -s and arguments are highlighted in the work log by @only21mil in pingdotgg/t3code#45157
* fix(server): t3 thread start title no longer cuts a combining mark off its letter by @iamshadmantaqi in pingdotgg/t3code#45165
* fix(server): a failing Codex MCP server is reported once per thread by @maria-rcks in pingdotgg/t3code#45152
* fix(web): queued Edit tooltip opens at once from adjacent actions by @only21mil in pingdotgg/t3code#45161
* fix(test): device evaluations keep POSIX paths on Windows by @rebelscumm in pingdotgg/t3code#45163
* fix(web): Cmd/Ctrl+A in archive and SQLite previews selects only the table by @only21mil in pingdotgg/t3code#45167
* fix(web): Cmd/Ctrl+A in Word document previews selects only the document by @only21mil in pingdotgg/t3code#45168
* fix(shared): files ending _tests count as tests in the diff panel by @iamshadmantaqi in pingdotgg/t3code#45169
* fix(server): t3 uninstall names a service whose home it cannot read by @iamshadmantaqi in pingdotgg/t3code#45170
* fix(shared): match SCP remotes with repeated slashes by @StiensWout in pingdotgg/t3code#45172
* fix(web): preserve ODS column addresses after wide hidden spans by @StiensWout in pingdotgg/t3code#45171

## New Contributors
* @watashiwaaniket made their first contribution in pingdotgg/t3code#33198
* @radomirml made their first contribution in pingdotgg/t3code#34051
* @birdringxD made their first contribution in pingdotgg/t3code#45048
* @NickoGNS made their first contribution in pingdotgg/t3code#45075
* @rebelscumm made their first contribution in pingdotgg/t3code#45163

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261128.5399...v0.1.14-nightly.20261128.5413

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.14-nightly.20261128.5413
vedprakash2302 added a commit to vedprakash2302/Cody that referenced this pull request Nov 29, 2026
- Usage access (pingdotgg#43948): Cody's OpenCode Go key and Copilot token reads go through upstream's withUsageAccess, so Copilot limits wait for the Usage access answer like other sign-in reads. driver.test.ts covers both answers.
- Preview browser Chrome identity (pingdotgg#45049): upstream dropped its Teams User-Agent rewrite, so Cody's previewRequestHeaders (run inside the Windows sign-in listener) now only adds navigation client hints.
- Preview spellcheck (pingdotgg#45215): kept beside Cody's Windows sign-in install; Cody's sign-in test mock and upstream's new spellcheck test get the spellchecker methods and DesktopClientSettings.
- agentContextBudget.json: Cody's Claude and Codex sizes, upstream's new MCP tool list size.
- ConnectionsSettings.logic.test.ts: kept Cody's WSL tailnet endpoint tests beside upstream's VPN default key test (pingdotgg#41655).
- Sync notes: the Teams rewrite is gone and Cody's OpenCode reads follow usage access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant