Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(ui): move the New Agent effort during render so Create never sends one the menu dropped (#3133)
Call White7e487e527581
diff --git a/ui/eslint-baseline.json b/ui/eslint-baseline.jsonindex 42a5e8ef6..8888a2d69 100644--- a/ui/eslint-baseline.json+++ b/ui/eslint-baseline.json@@ -458,7 +458,7 @@"avibe/localized-user-text": 4},"src/components/workbench/NewAgentDialog.tsx": {- "react-hooks/set-state-in-effect": 3+ "react-hooks/set-state-in-effect": 2},"src/components/workbench/NewProjectDialog.tsx": {"avibe/localized-user-text": 2diff --git a/ui/src/components/workbench/NewAgentDialog.test.tsx b/ui/src/components/workbench/NewAgentDialog.test.tsxindex a91013350..eaffb59ba 100644--- a/ui/src/components/workbench/NewAgentDialog.test.tsx+++ b/ui/src/components/workbench/NewAgentDialog.test.tsx@@ -288,8 +288,10 @@ describe('NewAgentDialog', () => {await waitFor(() => expect(screen.getByText('agents.create.effortRefused:{"effort":"high"}')).toBeTruthy());expect(createVibeAgent).not.toHaveBeenCalled();- // The menu now follows that answer, so the effort moved to one it offers.+ // The menu now follows that answer, and the effort moved with it to one it+ // offers, so the Create that takes clicks again sends that one.expect(screen.queryByRole('button', { name: 'high', exact: true })).toBeNull();+ expect(screen.getByRole('button', { name: 'medium', exact: true }).className).toContain('bg-mint-soft');// The refused Create has settled when its button takes clicks again.const create = screen.getByRole('button', { name: /agents\.create\.submit/ }) as HTMLButtonElement;await waitFor(() => expect(create.disabled).toBe(false));diff --git a/ui/src/components/workbench/NewAgentDialog.tsx b/ui/src/components/workbench/NewAgentDialog.tsxindex 4246935eb..7ede88cdc 100644--- a/ui/src/components/workbench/NewAgentDialog.tsx+++ b/ui/src/components/workbench/NewAgentDialog.tsx@@ -130,16 +130,15 @@ export const NewAgentDialog: React.FC<NewAgentDialogProps> = ({ open, onClose, o// Keep the chosen effort valid as backend/model (and thus the option list)// change, so handleSubmit never sends an effort the backend would reject- // (e.g. picking Codex `xhigh` then switching to Claude).- useEffect(() => {- if (effortOptions.length === 0) {- setEffort(null);- return;- }- if (effort === null || !effortOptions.includes(effort)) {- setEffort(effortOptions.includes('medium') ? 'medium' : effortOptions[0]);- }- }, [effortOptions, effort]);+ // (e.g. picking Codex `xhigh` then switching to Claude). It moves during+ // render, not in an effect: an effect runs after the new menu is committed,+ // and Create, enabled in that commit, would send the effort the menu dropped.+ const offeredEffort = effortOptions.length === 0+ ? null+ : effort !== null && effortOptions.includes(effort)+ ? effort+ : effortOptions.includes('medium') ? 'medium' : effortOptions[0];+ if (offeredEffort !== effort) setEffort(offeredEffort);const canSubmit = name.trim().length > 0 && !submitting && catalogAnswered;