Skip to content

fix(config): accept GUI writes that restore an omitted default - #3858

Merged
bobleer merged 2 commits into
openBitFun:mainfrom
bobleer:bob/fix-send-during-turn-default-save
Nov 10, 2026
Merged

bobleer merged 2 commits into
openBitFun:mainfrom
bobleer:bob/fix-send-during-turn-default-save

Conversation

@bobleer

@bobleer bobleer commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Switching Settings → Message sending → Send during a running turn back to Send immediately (default) failed with "Failed to save message sending preference", and the selector stayed on Queue.

AppFlowChatConfig::send_during_turn uses skip_serializing_if = is_immediate so legacy config files stay unchanged. Writing "immediate" through the legacy GUI config path therefore succeeds, but the follow-up read-back of effective_value in apply_legacy_config_mutation_with_model_snapshot gets NotFound: Config path 'app.flow_chat.send_during_turn' not found. The command returns an error, so the frontend cache never updates.

This change reports the missing leaf as null, matching an optional read of that path, only when the write changed the config. Serde silently drops unknown fields without changing anything, so writes to a misspelled path, or to a field this host does not know yet (for example from a newer peer controller), keep failing loudly as before. The persisted config shape is unchanged.

Type and Areas

Type: bug fix

Areas: Rust core (openbitfun-core product-control config), desktop settings, CLI peer host (shares the same legacy write path)

Motivation / Impact

  • Users can switch the message-sending preference back to the default again.
  • The same rule fixes other legacy path writes whose result is omitted when serialized: the other default-omitted leaves (task model selections, default-omitted flags), and clearing an Option leaf with null, which hit the same NotFound.
  • app.language, the only path whose backend effect reads effective_value, always serializes its value and is unaffected.

Verification

cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib agentic::tools::openbitfun_control_config: 11 passed, including:

  • legacy_mutation_accepts_writes_of_an_omitted_default: queue → immediate round trip, and clearing an optional leaf (app.flow_chat.last_mode_id) with null.
  • legacy_mutation_still_rejects_paths_the_config_drops: a write to an unknown field still returns the not found error.

Root cause confirmed from the desktop app.log error above. Not yet re-checked by hand in the running desktop app. Exercised locally only; the desktop and CLI peer hosts both reach this through the shared apply_legacy_config_mutation, but remote workspace and Peer Device Mode were not tested separately.

AI-assisted (Claude Code); lightly tested.

Reviewer Notes

  • A no-op write of an omitted default (already immediate, write immediate) still returns the old not found error, because it cannot be told apart from an unknown field without schema knowledge. The settings UI skips writes that equal the current value, so this is not reachable from the selector.
  • Not changed here: failed_legacy_transaction cannot roll back a path whose previous value was an omitted default (previous_value is None). That only matters if a backend or presentation effect fails, and this path has none.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Settings such as app.flow_chat.send_during_turn omit their default value
when serialized so legacy config files stay unchanged. Writing that
default through the legacy GUI config path succeeded, but the follow-up
read-back of the effective value failed with "Config path not found",
so the GUI reported a save failure and kept showing the old value.

Report the omitted default as null, matching an optional read of the
path, and keep failing on any other read error.
Serde ignores unknown fields, so a legacy write to a misspelled path, or
to a field this host does not know yet, leaves the config unchanged and
used to fail on its read-back. Only report a missing leaf as null when
the write actually changed the config, which is the case when restoring
an omitted default or clearing an optional value.
@bobleer
bobleer merged commit 14fe0cb into openBitFun:main Nov 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant