Skip to content

fix(settings): report rejected shared-settings writes on every environment - #9356

Open
juliusmarminge wants to merge 2 commits into
mainfrom
fix/mobile-shared-settings
Open

fix(settings): report rejected shared-settings writes on every environment#9356
juliusmarminge wants to merge 2 commits into
mainfrom
fix/mobile-shared-settings

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 3, 2026

Copy link
Copy Markdown
Member

Problem

#9147 made auto-settle, thread env mode and source control writing style fan out to every connected environment, with a "Settings differ / Apply to all" row when one holds a different value. A rejected write (dropped session, server that refuses orchestration:operate, a settings file that cannot be written) only reached console.warn. On mobile that meant "Apply to all" and the auto-settle switches looked saved while nothing changed and the mismatch row never cleared. Web had the same gap.

Mobile also decided "connected" with a looser check than web, so it listed environments as mismatched that it could never write to.

Fix

  • Await each fan-out write and name every environment that rejected it, each with its own reason: Alert on mobile, error toast on web. Accepted writes already come back through the config subscription, so no optimistic state is added.
  • Move supportsSharedSettings (connected + threadAutoSettlement capability) into packages/client-runtime/state/shared-settings so web and mobile agree on which environments are write targets. Tests added.
  • Mobile: drop the duplicated day count from the inactive-threads row (the field below already shows it), per Wout's note.

Proof

Two dev servers on this box, both connected from one web client. Environment B (nucbox-1 in the remote list) has its userdata directory made read-only so its settings.json write fails with a real ServerSettingsError; environment A accepts the same write.

Before — same rejected write on main. The mismatch banner appears because B still holds the old value, but nothing tells the user the write failed or why:

before

After — the write is reported with the environment name and the server's reason:

after

Apply to all on the mismatch banner fails the same way and says so; once B can write again the same button succeeds and the banner clears:

apply rejected
apply cleared

Full run (toggle with both healthy → B goes read-only → toggle → Apply to all rejected → B restored → Apply to all clears):

https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/178486f7368218cf/after-demo.webm

Mobile shares the same writeTo/describeRejectedSettingsWrites path with an Alert instead of a toast; no simulator on this machine to record it.

Surfaces

  • Web (Settings → General, Source Control), mobile (Settings → General). Desktop wraps web.
  • docs/user/thread-sidebar.md updated.

Written by Claude Fable 5 in Claude Code.

🤖 Generated with Claude Code

…nment

Shared settings (auto-settle, thread env mode, source control writing
style) fan out to every connected environment, but a rejected write only
reached the console. On mobile the "Apply to all" row and the auto-settle
switches looked saved while nothing changed, and the mismatch warning never
cleared. Web had the same gap behind the toggle.

Await each fan-out write and name the environments that rejected it, with
the server's reason: an Alert on mobile, an error toast on web. Move the
"can this environment hold every shared key" check into client-runtime so
web and mobile agree on which environments count as targets; mobile was
also listing environments as mismatched that it could never write to.

Drop the duplicated day count from the inactive-threads row on mobile. The
switch describes the rule and the field below holds the number.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.8 KiB 13.8 KiB 0 B (0.0%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −1 B (−0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +1 B (+0.0%) 7.8 KiB
Codex Live turn WebSocket decoded 58.5 KiB 58.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB −14 B (−0.1%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB −1 B (−0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.6 KiB −13 B (−0.2%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.9 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 854541a · PR result: 357af8f · 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: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

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

Comment thread apps/mobile/src/features/settings/SettingsRouteScreen.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 357af8f

Macroscope's review found this PR approvable — This is a contained settings bug fix that reports rejected fan-out writes per environment while preserving successful writes and subscription-driven updates. The remaining changes are shared predicate/test coverage, mobile copy cleanup, and documentation, with no schema, deployment, security, billing, or default-setting impact.

You can add or adjust custom eligibility rules. Learn more.

Two environments can reject a fan-out write for different reasons; the
report used the first error for every label.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). 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.

1 participant