# feat\(mcp\): update environment preferences · PR \#8728 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/8728)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: pingdotgg/t3code

Source branch: agents/mcp-environment/preferences

Target branch: agents/mcp-environment/read

Head commit: aae1adc5097ced03fa716e4222db448e6425310f

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/8728)

[Commits](https://git.cafe/pingdotgg/t3code/pull/8728/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/8728/diffs?format=markdown)

## Description

---

## Problem

Agents could inspect current environment preferences but had no narrow, permission-aware way to update useful nonsecret server-owned defaults.

## Change

Add `t3_environment_preferences_update` for an explicit typed allowlist: default thread environment mode, new-worktree origin behavior, provider update checks, normalized background-activity presets, and bounded source-control writing style.

## Behavior

Omitted fields remain unchanged, explicit empty custom instructions clear them, and the result comes from normalized persisted settings rather than request inputs. Mutation requires a full-access/default caller. A fresh caller shell is checked under the canonical `ThreadCommandExecutor` lock held through settings persistence, so a concurrent V2 downgrade wins safely. Existing settings notifications continue to update web, desktop, and mobile clients. Provider configuration, credentials, paths, browser access, observability, and arbitrary settings remain excluded.

## Focused validation

- real settings persistence, notification, normalization, omission/clear, and Unicode code-point tests
- Deferred-gated real V2 caller-downgrade race coverage
- production HTTP `tools/list`, Claude read-only allowlist, and presentation coverage
- 6 focused files / 18 tests passed across the complete native stack
- server and contracts scoped typechecks, targeted formatting, and `git diff --check`

## Dependency

Upper layer of native stack 8782. Depends on [#8726](https://github.com/pingdotgg/t3code/pull/8726) for the safe current-environment read foundation and preference projection.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

