Skip to content

fix(desktop): stop create-agent form clobbering provider config on keystroke - #3220

Open
IceRhymers wants to merge 1 commit into
block:mainfrom
IceRhymers:fix/provider-on-draft-change
Open

fix(desktop): stop create-agent form clobbering provider config on keystroke#3220
IceRhymers wants to merge 1 commit into
block:mainfrom
IceRhymers:fix/provider-on-draft-change

Conversation

@IceRhymers

@IceRhymers IceRhymers commented Jul 27, 2026

Copy link
Copy Markdown

What

Fixes the create-agent form resetting provider config_schema fields to their schema defaults (or wiping them) on every keystroke, which made non-default values impossible to enter from the UI.

Fixes #3216.

Root cause

In desktop/src/features/agents/ui/WhereToRunSection.tsx, the provider-probe useEffect listed the entire draft in its dependency array. Every keystroke in ProviderConfigFields calls onDraftChange({ ...draft, providerConfig }), producing a new draft → the effect re-fires → the probe re-runs → on resolve it overwrites providerConfig with defaults rebuilt from config_schema. Against a fast local provider binary the probe is near-instant, so the field appears to reset on the keystroke itself.

Fields with a default snapped back to it; fields without one were wiped to empty. It's also a churn bug — one provider probe per keystroke.

Fix

  • Early-return guard if (draft.probedProvider) return; so the probe runs once per selection instead of on every draft change. Switching providers still re-probes correctly, because the "Run on" <select> resets the draft to emptyWhereToRunDraft (probedProvider: null).
  • On probe resolve, seed providerConfig: { ...defaults, ...draft.providerConfig } so a late-resolving probe can never erase values the user already typed (defense-in-depth).

Testing

  • just desktop-typecheck — pass
  • just desktop-test — pass
  • just desktop-check (Biome) — no findings on changed source

Testing against custom provider

Evidence of the fix, vs the video in #3216

Screen.Recording.2026-07-27.at.3.39.10.PM.mov

Notes

Discovered while building an out-of-tree backend provider (Databricks sandbox / Lakebox) that advertises a defaulted inference_auth field which couldn't be switched away from its default via the UI. No provider-side workaround exists — the reset is entirely client-side.

@IceRhymers
IceRhymers marked this pull request as ready for review July 27, 2026 22:43
@IceRhymers
IceRhymers requested a review from a team as a code owner July 27, 2026 22:43
…ystroke

The provider-probe effect in WhereToRunSection listed the whole `draft` in
its dependency array, so every keystroke in ProviderConfigFields produced a
new draft, re-ran the probe, and overwrote `providerConfig` with schema
defaults on resolve. Any config_schema field with a `default` snapped back to
it (fields without one were wiped), making non-default values impossible to
enter from the UI.

Guard against re-probing once a provider has been probed (a provider switch
still resets the draft to emptyWhereToRunDraft, so a fresh probe fires then),
and seed defaults without overwriting values the user already typed so a
late-resolving probe can't erase input.

Fixes block#3216

Signed-off-by: Tanner <84605639+IceRhymers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create-agent form resets provider config_schema fields to defaults on every keystroke

3 participants