Skip to content

fix(console): refresh agent list and reselect after rename - #375

Merged
codeaholicguy merged 1 commit into
mainfrom
fix/console-rename-refresh
Oct 14, 2026
Merged

codeaholicguy merged 1 commit into
mainfrom
fix/console-rename-refresh

Conversation

@codeaholicguy

Copy link
Copy Markdown
Owner

Summary

Root cause: useRenameAgentPane handled a successful rename by closing the pane and showing a transient message, but never called the console's refresh() and never updated selection. Once the daemon event stream subscription succeeds, useAgentList relaxes its 3s poll to a 60s fallback — and a registry-only rename emits no daemon event — so the list showed the old name for up to a minute and selection fell back when the refresh finally arrived.

Fix: the hook now accepts refresh and a selectAgent callback (wired in ConsoleApp to useConsoleAgentContext().refresh and setSelectedName). On success it closes the pane, shows the transient message, awaits refresh(), then selects values.newName — mirroring useStartAgentPane's ordering. Failed renames keep the existing inline-error behavior with no refresh or selection change.

Validation

  • New hook tests assert refresh() then selectAgent(newName) run only after a successful rename, and that a failed rename triggers neither.
  • New integration tests render ConsoleProvider with a mocked manager and verify the visible list shows the new name and selection follows — both with no daemon and with an active daemon subscription (relaxed 60s poll).
  • npx vitest run src/__tests__/tui/console — 26 files, 218 tests passed.
  • npm run lint — clean (pre-existing warnings only).
  • npm test — all 8 nx projects passed.
  • npm run test:e2e — 42 tests passed.

Test plan

  • Successful rename refreshes list and selects the new name
  • Failed rename keeps inline error, no refresh/selection change
  • Works with and without daemon subscription

Closes #374

Generated with Devin

@codeaholicguy
codeaholicguy force-pushed the fix/console-rename-refresh branch from 17f8885 to 9258b69 Compare October 14, 2026 14:05
@codeaholicguy
codeaholicguy merged commit 9eae9bf into main Oct 14, 2026
8 checks passed
@codeaholicguy
codeaholicguy deleted the fix/console-rename-refresh branch October 14, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): refresh agent console list after rename

1 participant