fix(settings): report rejected shared-settings writes on every environment - #9356
fix(settings): report rejected shared-settings writes on every environment#9356juliusmarminge wants to merge 2 commits into
Conversation
…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>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved at 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>
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 reachedconsole.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
Alerton mobile, error toast on web. Accepted writes already come back through the config subscription, so no optimistic state is added.supportsSharedSettings(connected +threadAutoSettlementcapability) intopackages/client-runtime/state/shared-settingsso web and mobile agree on which environments are write targets. Tests added.Proof
Two dev servers on this box, both connected from one web client. Environment B (
nucbox-1in the remote list) has itsuserdatadirectory made read-only so itssettings.jsonwrite fails with a realServerSettingsError; 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:After — the write is reported with the environment name and the server's reason:
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:
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/describeRejectedSettingsWritespath with anAlertinstead of a toast; no simulator on this machine to record it.Surfaces
docs/user/thread-sidebar.mdupdated.Written by Claude Fable 5 in Claude Code.
🤖 Generated with Claude Code