Repository navigation
Description
Summary
In the create-agent flow, any provider that advertises a config_schema has its config fields reset to their schema defaults (or wiped to empty) on every keystroke. Typing into a field like Inference auth snaps the value back almost immediately, making it effectively impossible to enter a non-default value through the UI.
Against a fast local provider binary the reset appears instantaneous, so it looks like the field refuses to accept input.
Impact
- Any backend provider advertising
config_schemafields is unconfigurable from Buzz Desktop. - Fields with a
defaultsnap back to that default; fields without one get wiped to empty. - Concrete case: I hit this while building a backend provider that runs agents on a Databricks sandbox / Lakebox. It advertises
profile,inference_auth(defaultenv), andidle_timeout. Its opt-ininference_auth: "sandbox"path cannot be selected from the UI at all —inference_authalways resets toenv. (Details in feat(zero-token): opt-ininference_auth: "sandbox"— zero-Databricks-token inference via the baked per-user cfg IceRhymers/buzz-lakebox#11.) - There is no provider-side workaround: dropping the
defaultfrom the schema only changes the reset target fromenvto empty.
Root cause
desktop/src/features/agents/ui/WhereToRunSection.tsx
-
The probe
useEffect(line 29) lists the entiredraftin its dependency array:}, [draft, isProviderMode, onDraftChange, selectedBackendProvider]); // line 64
-
Every keystroke in
ProviderConfigFieldscallsonDraftChange({ ...draft, providerConfig })(lines 116–117), producing a newdraftobject — which re-triggers the effect and re-runsprobeBackendProvider(...). -
When the probe resolves, it rebuilds
defaultsfromconfig_schemaand calls (lines 50–54):onDraftChange({ ...draft, probedProvider: result, providerConfig: defaults, // clobbers whatever the user just typed });
So each keystroke fires a fresh probe, and each resolved probe overwrites
providerConfigback to the schema defaults. This is both a correctness bug (typed values lost) and a churn bug (one provider probe per keystroke).
Proposed fix
Don't re-probe once the provider has already been probed:
React.useEffect(() => {
if (!isProviderMode || !selectedBackendProvider) {
setProbeError(null);
return;
}
if (draft.probedProvider) return; // already probed; don't clobber user edits
// ... existing probe logic
}, [draft, isProviderMode, onDraftChange, selectedBackendProvider]);This stays correct on provider switches: the "Run on" <select> resets the draft to emptyWhereToRunDraft (probedProvider: null, lines 78–83), so a fresh probe still fires when the user picks a different provider.
Belt-and-suspenders — seed defaults without overwriting typed values, so a late-resolving probe can never erase user input:
providerConfig: { ...defaults, ...draft.providerConfig },The early-return guard alone fixes both the reset and the probe-per-keystroke churn; the merge is defense-in-depth.
Repro
- Have any backend provider installed that advertises a
config_schemawith at least one property that has adefault. - Open the create-agent form, set Run on to that provider.
- Try to type a value into one of the config fields that differs from its default.
- Observed: the field snaps back to its default almost immediately (near-instant against a fast local provider binary).
- Expected: the typed value persists.
Discovered while building a backend provider that launches agents on a Databricks sandbox / Lakebox. Its inference_auth field (default env) could not be switched to sandbox from the UI. Details in IceRhymers/buzz-lakebox#11.
Screen.Recording.2026-07-27.at.2.53.09.PM.mov
Environment
- Verified in
block/buzzatmain(component unchanged from8bb43d51through3faea98). - File:
desktop/src/features/agents/ui/WhereToRunSection.tsx
Activity
fix(desktop): stop create-agent form clobbering provider config on ke…