feat(desktop): thread baked build env into global agent config UI#1722
Merged
Conversation
Remove the standalone 'Baked build defaults' section from the settings card and unify baked values into the global defaults UI where they belong. Baked env was already the precedence floor under global in the backend (resolve_effective_agent_env layers baked → global → persona → per-agent). The two-section display was a presentation artifact — this aligns the UI with the backend's actual precedence chain. Changes: - GlobalAgentConfigSettingsCard: derive bakedProvider/bakedModel/bakedEffort/ bakedGenericRows from get_baked_build_env IPC; thread each into its respective structured control (provider dropdown zero-value label shows 'Databricks v2 (AI Gateway) (inherited from build)'; model dropdown shows 'Inherit global default (<model>)'; effort dropdown shows inherited effort in its Inherit option); pass remaining generic keys to EnvVarsEditor as inheritedRows; delete the old standalone baked section entirely. - EnvVarsEditor: add opt-in inheritedRows prop (readonly InheritedEnvRow[]). Renders read-only rows between file-satisfied and user-managed rows, tagged 'Inherited from <label>'. A local user row with the same key suppresses the inherited row and shows an 'Overrides build default' hint instead. The inherited rows invariant: they are never in rows state, never in buildRecord output, and never serialized to global-agent-config.json. - bakedEnvHelpers.ts: pure getBakedProviderInheritLabel helper, extracted to a side-effect-free module so unit tests can import it without pulling in React, TanStack Query, or the Tauri IPC layer. - EnvVarsEditor.test.mjs: 8 new tests covering inheritedRows visibility, local-wins suppression, no-serialize invariant, masked-secret override hint, structured-key exclusion, and getBakedProviderInheritLabel label resolution. OSS builds return [] from get_baked_build_env — all new code short-circuits on empty inputs, pixel-identical to today. No Rust changes required. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
bf02df0 to
4dd3863
Compare
…alAgentConfigSettingsCard Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…eal allowlist BUZZ_AGENT_THINKING_EFFORT is a non-secret enum (low/medium/high) and was missing from is_safe_to_reveal, causing baked effort values to be masked as `••••••` instead of rendered in the Inherit label of EffortSelectField. Add it to the allowlist alongside BUZZ_AGENT_PROVIDER/MODEL, update the allowlist doc comment, and add a regression test that a baked effort value returns unmasked. Also bump the agent_config.rs file-size exception in check-file-sizes.mjs to account for the 17 added lines. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…seven effort values Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the standalone "Baked build defaults" settings section and unifies baked build env values into the global agent defaults card where they semantically belong.
The backend already treats baked env as the floor under global (
resolve_effective_agent_env: baked → global → persona → per-agent). The two-section display was a presentation artifact — this aligns the UI with that precedence chain.What changed
Display-only unification — storage, precedence, spawn behavior, and auto-respawn are all unchanged.
GlobalAgentConfigSettingsCard.tsxbakedProvider,bakedModel,bakedEffort, andbakedGenericRowsfrom the existingget_baked_build_envIPC call.Databricks v2 (AI Gateway) (inherited from build)instead of the generic prompt; selecting any explicit provider overrides it, clearing back restores the inherited label.bakedModelasglobalModeltoAgentModelField→ zero-value option readsInherit global default (goose-claude-opus-4-8)when the baked model is present.bakedEffortasinheritedEfforttoEffortSelectField→ the inherit option readsInherit (medium)when a baked effort is present.DATABRICKS_HOST,DATABRICKS_MODEL, etc.) flow toEnvVarsEditorasinheritedRows.SettingsOptionGroupblock entirely.EnvVarsEditor.tsxinheritedRows?: readonly InheritedEnvRow[]andinheritedRowsLabel?props (default:build).Inherited from buildtag.Overrides build default <masked-value>hint.rowsstate, never reachbuildRecord/onChange, and are never written toglobal-agent-config.json.bakedEnvHelpers.ts(new)getBakedProviderInheritLabelhelper extracted into a side-effect-free module so unit tests can import it without React, TanStack Query, or Tauri IPC.agent_config.rsBUZZ_AGENT_THINKING_EFFORTto theis_safe_to_revealallowlist. This key is a non-secret enum (none/minimal/low/medium/high/xhigh/max) — without this change, a build with a baked effort value would cross IPC asmasked: trueand render asInherit (••••••)inEffortSelectFieldinstead of the actual value.baked_env_thinking_effort_is_unmaskedassertsvalue: "medium", masked: false.EnvVarsEditor.test.mjsBUZZ_AGENT_PROVIDER/MODEL/THINKING_EFFORTrouted to dropdowns and not generic rows), andgetBakedProviderInheritLabellabel resolution.Acceptance criteria
Internal build with baked env set as:
Note:
BUZZ_BUILD_AGENT_ENVis newline-delimited (agent_env.rsandbuild.rsboth parse with.lines()). A single space-separated line produces one glued key, not two.Expected: no "Baked build defaults" section; provider dropdown shows "Databricks v2 (AI Gateway) (inherited from build)";
DATABRICKS_HOSTandDATABRICKS_MODELappear as read-only rows tagged "Inherited from build".Picking an explicit provider overrides; clearing restores the inherited label. Zero change to spawn/readiness/auto-respawn behavior.
OSS build: pixel-identical to today (empty baked map short-circuits all new code).
Gates: typecheck ✅ · build ✅ · unit suite 2470/2470 ✅ · biome ✅ · cargo test (agent_config) 15/15 ✅