Repository navigation
fix(console): protect agent creation inputs while submitting - #1378
Merged
swjnxyf merged 3 commits intoNov 7, 2026
Merged
Conversation
The create-Agent form kept its inputs enabled while the create request was in flight, and success unconditionally cleared every field. Text typed after submitting was therefore wiped by the success handler even though it was never part of the submitted Agent. Reproduced with a controllable create response: submitting 'first-agent' and typing 'unsaved-second-agent' during the request lost the second input on success. Disable the four create inputs (and the submit button, which already covered the busy flag) for the duration of the request and restore editing when it ends. Success clears exactly what was submitted; failure and uncertain outcomes keep the operator's input for correction. The hook's existing idempotency snapshot and key-reuse behavior are unchanged.
# Conflicts: # frontend/test-v2/agents-workbench.test.tsx
swjnxyf
approved these changes
Nov 7, 2026
swjnxyf
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed create-Agent form field locking, success/reset and failure/draft preservation. Integrated current main including #1376's uncertain-operation notice tests (resolved overlapping test insertion without dropping either regression). Added a synchronous in-flight ref guard to block repeated same-batch submissions before React state commits. Regenerated checked-in frontend/dist/app.js in follow-up 9bf3869. On wkp, frontend typecheck and all 19 agent-workbench tests passed; git diff check clean. No remaining blocker; approving squash merge without waiting for intermediate CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The create-Agent form kept its inputs enabled while the create request was in flight, and success unconditionally cleared every field. Text typed after submitting was therefore wiped by the success handler even though it was never part of the submitted Agent.
Reproduced with a controllable create response: submitting
first-agentand typingunsaved-second-agentinto the Handle field during the request lost the second input when the create succeeded — the user's unsaved draft was destroyed by the very completion they were waiting for.Change
Disable the four create inputs for the duration of the create request and restore editing when it ends (the submit button already disabled on the hook-wide busy flag; it now also covers this request specifically). With inputs locked, success clears exactly what was submitted; failure and uncertain outcomes keep the operator's input for correction. The hook's existing idempotency snapshot and key-reuse behavior are unchanged, and no other part of the page is disabled.
Validation
frontend/test-v2/agents-workbench.test.tsx: inputs lock while the create promise is pending, success clears the submitted fields and unlocks, and a failed creation keeps the typed handle and display name for correction (the lock path fails on the previous code).npx vitest run(frontend): 43 files, 403 passed, 0 failed;npm run typecheck: clean.Compatibility
None: one local component state, disabled attributes on four inputs, and one guard against double submission.