From 5b0ec394bb46b83f23decf1ff8dfb7caa050310c Mon Sep 17 00:00:00 2001 From: tvskart <10254487+tvskart@users.noreply.github.com> Date: Wed, 17 Jun 2026 18:57:05 -0700 Subject: [PATCH] fix: extra args field mangles comma-separated values during typing (#2125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Thinking Path - Paperclip manages AI agent configuration via `AgentConfigForm` - Agents can be given extra CLI args via a comma-separated input field - `DraftInput` with `immediate` mode commits on every keystroke - The `parseCommaArgs` → `formatArgList` round-trip resets the draft via `useEffect`, corrupting mid-edit input - Removing `immediate` defers parsing to blur, fixing the corruption - This matches how all other transformed fields in the form already behave ### What changed Removed the `immediate` prop from the Extra args `DraftInput` so the value is only parsed on blur instead of every keystroke. ### Note Upon further investigation, the bug only affects **typing** into the field character by character — the round-trip reformats on each keystroke and corrupts the value. **Copy-pasting** works fine on master since it's a single input event. Still worth fixing since users who type args manually (or edit an existing value) will hit the corruption. ### Test plan - [ ] Go to any agent's Configuration tab - [ ] **Type** comma-separated args character by character in the "Extra args" field (e.g. `--verbose, --foo=bar`) - [ ] Click elsewhere to blur, then Save - [ ] Verify via API that `adapterConfig.extraArgs` is a properly split array (not a mangled single string) 🤖 Generated with [Claude Code](https://claude.com/claude-code) ### Before trying to type in a comma -> will not appear copy paste into element -> i guess this works out ![dunder-extra-args-before](https://github.com/user-attachments/assets/1a1b37d3-ce25-4998-972e-c98d3d382a33) ### After typing works and copy paste works as well ![dunder-extra-args-after](https://github.com/user-attachments/assets/1aad368d-e5d8-4c37-9ab3-8f72470bdfbc) Co-authored-by: tvskart Co-authored-by: Claude Opus 4.6 (1M context) --- ui/src/components/AgentConfigForm.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index 342a7583..3533e423 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -1169,7 +1169,6 @@ export function AgentConfigForm(props: AgentConfigFormProps) { ? set!({ extraArgs: v }) : mark("adapterConfig", "extraArgs", v?.trim() ? parseCommaArgs(v) : null) } - immediate className={inputClass} placeholder="e.g. --verbose, --foo=bar" />