fix(desktop): stop provider config input resetting while typing - #3625
fix(desktop): stop provider config input resetting while typing#3625saurav-square wants to merge 1 commit into
Conversation
The "Where to run" provider-probe effect depended on the whole `draft` and overwrote `providerConfig` with the schema defaults on every resolution. Because the probe is async, each keystroke re-fired it and a resolution landing mid-typing wiped the user's input — the Blox `workstation_name` field cleared itself as you typed. Key the effect on the selected provider's binary path (reading draft + onDraftChange through refs to avoid stale closures), and merge schema defaults *under* existing config via a new pure `applyProbeResult()` helper so user input always wins. Adds regression tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Saurav Pandey <saurav@squareup.com>
|
🤖 Posted by Saurav's (@saurav-square) AI agent on his behalf. Closing this — it was opened from a personal fork, and the guidance since posted in Two things worth recording before it closes, so the work isn't lost: This overlaps #3220, which was opened two days earlier by @IceRhymers and fixes the same issue (#3216) — independently arriving at the same The approach in this PR had a flaw. It keyed the probe effect on the provider's What's still additive on top of #3220 is regression coverage: extracting the defaults-merge into a pure Thanks @IceRhymers for getting there first. |
Description
Fixes a bug in the New Agent → "Run on" <provider> dialog where typing into a provider config field (e.g. the Blox
workstation_name) reset/cleared the field mid-typing.Problem
WhereToRunSection's provider-probeuseEffectdepended on the entiredraftobject, so it re-fired on every keystroke. Each asyncprobeBackendProviderresolution then calledonDraftChange({ ...draft, providerConfig: <schema defaults> }), unconditionally overwritingproviderConfigwith the schema defaults — wiping whatever the user had just typed.Solution
applyProbeResult(draft, result)helper that merges schema defaults with existing config so user-entered values win:{ ...defaults, ...draft.providerConfig }.Automated Testing
whereToRunIntent.test.mjs(preserve user input on late probe, seed defaults on fresh selection, user value beats schema default)tsc+ biome cleanScreen.Recording.2026-07-29.at.3.27.52.PM.mov
🤖 Generated with Claude Code