Skip to content

fix(claude-desktop): persist deploymentMode=3p and enable Cowork web search#128

Merged
stuffbucket merged 1 commit into
mainfrom
fix/claude-desktop-deployment-mode-and-websearch
Jun 16, 2026
Merged

fix(claude-desktop): persist deploymentMode=3p and enable Cowork web search#128
stuffbucket merged 1 commit into
mainfrom
fix/claude-desktop-deployment-mode-and-websearch

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Problem

The Claude Desktop toggle configured gateway routing + telemetry/extension flags but left two gaps that only didn't bite on machines configured interactively. The visible symptom: other machines are sent to the Claude.ai sign-in screen even though the gateway is fully wired.

Root cause (verified against the app's own logic)

Two separate gates in Claude Desktop:

  1. disableDeploymentModeChooser: true + inferenceProvider set → puts the app in 3P and hides the chooser. The toggle already did this.
  2. isFirstRunBeforeSignIn() = readPersistedDeploymentMode() === undefined → a separate first-run gate. With no persisted deploymentMode ever written, the app treats launch as pre-sign-in first-run and shows the Claude.ai sign-in screen regardless of (1). The toggle never wrote it.

Both reader and writer resolve to the same file the toggle owns (claude_desktop_config.json, top-level key deploymentMode, value "3p" — exactly what the app persists when a user picks third-party).

Changes

  • deploymentMode: "3p" added to the proxy-keys allowlist + defaults — skips the Claude.ai sign-in on a fresh machine.
  • coworkWebSearchEnabled — lives nested under preferences, which the flat allowlist couldn't reach. Added surgical nested merge/strip that owns only that sub-key and preserves every other preference the app stores there. Revert drops the preferences object only if it was the last thing left.
  • Docs (admin/claude-desktop-mdm.md) updated to match the profile and explain the first-run gate.

Migration note

Pre-fix users who already toggled on have a config missing these keys. applyProxyConfig now detects the mismatch (alreadyConfigured returns false), so a re-apply (toggle off→on) heals them instead of silently skipping as "already configured."

Verification

  • lint clean, tsc clean
  • full suite 921 pass / 0 fail
  • new tests cover the nested preference and the "top-level matches but deploymentMode/preference missing → rewrites" case

…search

The Claude Desktop toggle wrote gateway routing + telemetry/extension
flags but left two gaps that only didn't bite on machines that had been
configured interactively:

- No persisted deploymentMode. Setting inferenceProvider +
  disableDeploymentModeChooser puts the app in third-party mode and
  hides the chooser, but the app's first-run gate is
  `readPersistedDeploymentMode() === undefined`. With no deploymentMode
  ever written, a freshly-toggled machine is treated as
  pre-sign-in first-run and shows the Claude.ai sign-in screen despite
  the gateway being fully wired. Write deploymentMode: "3p" (the value
  the app itself persists when a user picks third-party).

- coworkWebSearchEnabled was never set. It lives nested under the
  `preferences` object, so the flat allowlist couldn't represent it.
  Add surgical nested merge/strip that owns only that sub-key and
  preserves every other preference the app stores there.

Docs (admin/claude-desktop-mdm.md) updated to match the profile and
explain the deploymentMode first-run gate.
@stuffbucket
stuffbucket merged commit e0599a7 into main Jun 16, 2026
3 checks passed
@stuffbucket
stuffbucket deleted the fix/claude-desktop-deployment-mode-and-websearch branch July 13, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant