Env var key loses characters when the ACP runtime catalog resolves mid-typing
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
**Describe the bug**
Typing an environment variable name in the agent Advanced section loses characters when the ACP runtime catalog resolves mid-typing. The truncated key is saved with no warning, so the intended variable never reaches the harness.
`EnvVarsEditor` derives `skipKeys` from `requiredKeys ∪ fileSatisfiedKeys ∪ hiddenKeys`. Those sets come from the async runtime-catalog query. When the catalog resolves, membership changes and the resync effect runs `setRows(toRows(value, skipKeys))`, rebuilding rows from the parent's last emitted `value` and discarding every keystroke not yet round-tripped.
`desktop/src/features/agents/ui/EnvVarsEditor.tsx`
**Steps to reproduce**
1. Open an agent's edit dialog, expand Advanced, Environment variables, Add variable.
2. Start typing a long key such as `BUZZ_ACP_PERMISSION_MODE` while the runtime-catalog request is still in flight (for example immediately after switching harness).
3. Watch the field when the catalog resolves.
**Expected behavior**
The field contains the full typed key.
**Actual behavior**
Characters typed before the catalog resolved remain; the rest are dropped. With a 3s catalog delay and 150ms per keystroke, `BUZZ_ACP_PERMISSION_MODE` ends as `BUZZ_AC` — 7 of 24 characters.
**Version and platform**
- Buzz version: 0.5.8
- OS: macOS 26.5.2
**Logs / additional context**
Reproduced with a Playwright spec that varies only `acpRuntimesDelayMs`:
```
env_var_key_survives_catalog_settling_mid_typing FAILED
Expected: "BUZZ_ACP_PERMISSION_MODE"
Received: "BUZZ_AC"
env_var_key_survives_typing_with_settled_catalog PASSED
```
Identical field, identical 24 characters, identical 150ms/keystroke. The settled-catalog control keeps every character, so typing speed alone is not the cause.
Contributor guide
Research direction
Start in desktop/src/features/agents/ui/EnvVarsEditor.tsx and reproduce the issue with the env_var_key_survives_catalog_settling_mid_typing Playwright spec while varying acpRuntimesDelayMs. Trace the catalog-resolution resync and verify that the full key remains in the field and reaches the saved value during settling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- playwright, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100