Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(settings): sync auto-settle and other shared preferences across environments #9147

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/9147/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Problem

Auto-settle, new-thread workspace mode, and source control writing style live in each server's settings.json because the server acts on them (auto-settlement runs with no client attached). The settings UI wrote them to the primary environment only. Every other connected machine kept its own value, and nothing showed the drift.

Fix

  • packages/client-runtime/src/state/sharedSettings.ts names the shared keys and has helpers to split a patch, pick the shared subset, and find connected environments that differ.
  • Web: useUpdateSettingsTarget writes shared keys to every connected environment. Machine keys (providers, browser access, observability, and so on) stay primary-only.
  • Web: Settings > General and Settings > Source Control show a warning naming the environments that differ, with an "Apply to all" button that writes the primary's values to them.
  • Mobile: one set of auto-settle controls instead of one merge switch per environment. Adds the missing inactivity days input. Writes fan out the same way, and a "Settings differ" row offers "Apply to all".
  • Docs updated in docs/user/thread-sidebar.md and docs/internals/overview.md.

Offline environments are skipped on write and in the warning. They pick up the value the next time you change the setting or press "Apply to all" while they are connected.

No contract or server changes.

Verification

  • vp test run packages/client-runtime/src/state/sharedSettings.test.ts (5 tests)
  • vp test run apps/web/src/hooks/useSettings.test.ts
  • Typecheck for web, mobile, and client-runtime
  • Lint and format on changed files

Written by Claude Fable 5.1 in Claude Code.

🤖 Generated with Claude Code


Note

Medium Risk Settings updates now fan out shared keys to every connected environment on each change; incorrect key classification or targeting could overwrite the wrong servers, though local-only keys remain scoped and guards avoid pushing defaults when the primary is unloaded.

Overview Shared server settings (auto-settle rules, default new-thread workspace mode, worktree origin behavior, and source-control writing style) are now treated as user-wide preferences: clients fan writes to every connected environment that supports them, instead of updating only the primary (or one row per environment on mobile).

Adds packages/client-runtime shared-settings helpers (SHARED_SERVER_SETTING_KEYS, patch splitting, mismatch detection, and “pick shared subset” for apply). Web useUpdateSettingsTarget routes shared keys to all capable connected environments and keeps machine-local keys on the requested environment; useSharedSettingsSync plus SharedSettingsMismatchAlert on General and Source Control warn when drift remains and offer Apply to all using loaded primary config (not default fallbacks). Mobile replaces per-connection merge toggles with a single AutoSettleSettingsRows block (inactive auto-settle, days input, same fan-out and mismatch row). User and internals docs describe multi-environment sync and offline behavior.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 15a365c14457944547d202b2a411ef24b971efa1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Sync shared auto-settle and server preferences across environments

  • Introduces shared server settings (SHARED_SERVER_SETTING_KEYS) covering auto-settlement, thread mode, worktree origin, and source control writing style
  • Adds mismatch detection via findSharedSettingsMismatches in sharedSettings.ts and displays a warning with an "Apply to all" action on web and mobile settings pages
  • Modifies useUpdateSettingsTarget in useSettings.ts to write shared keys to all eligible connected environments, while local server keys remain scoped to the requested environment
  • Risk: useUpdateSettingsTarget in useSettings.ts writes shared keys to every environment with the thread auto-settlement capability; environments holding intentionally divergent values for keys in SHARED_SERVER_SETTING_KEYS will be overwritten
Macroscope summarized 15a365c.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.4 KiB13.4 KiB−19 B (−0.1%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB−20 B (−0.3%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.5 KiB+1 B (+0.0%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages10100 (0.0%)21✅
      ClaudeTotal thread wire13.5 KiB13.5 KiB−3 B (−0.0%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB−2 B (−0.0%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.6 KiB6.6 KiB−1 B (−0.0%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages10100 (0.0%)21✅

      Baseline: ea71a19 · PR result: 15a365c · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR changes existing settings writes from single-environment updates to cross-environment propagation and adds new mobile controls for server-side settlement preferences. Because those preferences affect thread settlement, workspace creation, and source-control behavior across connected servers, the runtime blast radius is broader than a self-contained settings fix.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.