Skip to content

feat(server): optional read-only shared settings file beneath settings.json - #5

Open
colonelpanic8 wants to merge 1676 commits into
mainfrom
t3code/main/shared-server-settings
Open

colonelpanic8 wants to merge 1676 commits into
mainfrom
t3code/main/shared-server-settings

Conversation

@colonelpanic8

Copy link
Copy Markdown
Owner

A narrow first step toward pingdotgg#19594.

Problem

settings.json is both the configuration and where every UI change is written. If it lives in a dotfiles repo (symlinked, which pingdotgg#15009 preserves), every UI change becomes a dotfiles diff, including values that only make sense on one machine. If it doesn't, the dotfiles copy and the live copy drift apart.

Change

--server-shared-settings-file or T3CODE_SERVER_SHARED_SETTINGS_FILE names a read-only settings file, with the same schema as settings.json, that sits beneath it:

effective = built-in defaults < shared file < settings.json
  • settings.json stays the only file T3 writes. UI changes, migrations, t3 theme, the device service, and project commands all write only there.
  • Writes save the difference from defaults plus the shared file. Values a machine never changed keep following the shared file. A value set back to the built-in default is still saved when the shared file differs.
  • Values the schema needs whole are saved whole: provider instance entries, usage limit sources, price overrides, model selections, worktree cleanup rules. Editing a shared provider instance saves the full edited entry.
  • When the shared file is configured but missing or malformed, saves keep every key already in settings.json, so local overrides aren't lost. A malformed shared file is ignored with a warning, like a malformed settings.json.
  • The shared file is watched like settings.json, symlinks included.
  • With the option unset, behavior is unchanged.

Documented in docs/user/install.md, including the limits:

  • A key saved with exactly the shared value is dropped and follows the shared file again.
  • Entries that come from the shared file can't be removed on one machine.
  • t3 project needs the same flag or env var when no server is running.

Not in this PR: showing where each value comes from in the UI, a "reset to shared" action, imports, and layering for keybindings or client settings.

Verification

  • Behavioral tests run the real ServerSettingsService on temp files. They cover shared values appearing, settings.json overriding them, and a UI patch writing only the patched key while the shared file stays byte-identical. They also cover editing, disabling, clearing a field on, and switching the driver of a shared provider instance, changing a model on shared top-level and per-project selections, missing and malformed shared files, the legacy providers migration, the OTLP fallback, and inherited secrets not leaking into settings.json.
  • vp test run on the settings, config, theme, project, and project-deletion tests passes, 137 tests. tsc-rs --noEmit, vp lint, and vp fmt --check pass for apps/server.
  • Not run against a live server.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L size:XL and removed size:L labels Oct 14, 2026
@colonelpanic8
colonelpanic8 force-pushed the t3code/main/shared-server-settings branch from a8c43f9 to 6891e06 Compare October 16, 2026 17:49
@github-actions github-actions Bot added size:XXL and removed size:XL labels Oct 16, 2026
@colonelpanic8
colonelpanic8 force-pushed the t3code/main/shared-server-settings branch 2 times, most recently from d236e4d to db0ccc7 Compare October 19, 2026 03:14
juliusmarminge and others added 21 commits October 19, 2026 22:18
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…Linux (pingdotgg#20907)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ch instead of failing checkout (pingdotgg#20825)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ded update (pingdotgg#18095)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…led time again (pingdotgg#15948)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
…wer (pingdotgg#19564)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…g#19931)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…g#21314)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#18291)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…#20303)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…#20985)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#18780)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…reads (pingdotgg#18817)

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…access (pingdotgg#19306)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ires (beta) (pingdotgg#21682)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… tabs (pingdotgg#19533)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#18823)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
juliusmarminge and others added 30 commits October 21, 2026 01:32
…le (pingdotgg#22694)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…wn component (pingdotgg#22680)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…imelineFollow (pingdotgg#22701)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…seSystemComposerBanners (pingdotgg#22710)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…banners are built in ThreadActivityBanners (pingdotgg#22725)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ronmentRouting (pingdotgg#22728)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…iew.logic (pingdotgg#22734)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…le (pingdotgg#22666)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… their own file (pingdotgg#22669)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…sSettings.logic (pingdotgg#22683)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… file (pingdotgg#22684)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…n file (pingdotgg#22685)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…tgg#22607)

Co-authored-by: ishaanko <ishaanko.mail@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…22767)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rt (pingdotgg#22784)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…er it (pingdotgg#22783)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… setting (pingdotgg#22841)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.