Files
buzz/desktop
DuncanandWill Pfleger f1e18d924e feat(desktop): merge agent edit surface — Phase 1 route collapse (R1–R7)
Per the Phase 0 spec (Thufir CLEAR 9/9/9), collapse all seven edit routes
onto a single AgentEditDialog that owns the merged agent edit surface.
The create path (Phase 2), vocabulary renames (Phase 3), and Instances
section rename (S5) are explicitly out of scope.

New modules:
- agentFormModel.ts: canonical AgentFormModel type, AgentEditContext
  discriminated union, seedAgentFormModel(), emitAgentFormDiff(). Row 1
  (pooled-name materialization drop) and row 8 (env wholesale-replace drop)
  are structural: unemittable by construction.
- agentSaveCoordinator.ts: Artifact 3 coordinator (runAgentSaveCoordinator):
  validate -> definition write -> instance write -> policy setters ->
  settlement from observed re-fetched state, not from command result.
  Partial-failure toast names exactly what persisted and what did not.
- AgentEditDialog.tsx: merged dialog wrapping AgentDefinitionDialog for
  D-fields. Supports all three AgentEditContext kinds: instance-with-definition,
  instance-only, definition-only. Preserves the "saved while stopped" toast.

Route collapses:
- R1: UserProfilePanel.handleEditAgent no longer prefers the definition dialog
  when a linked persona exists; always opens AgentEditDialog.
- R2: requestOpenEditAgent event handler opens AgentEditDialog.
- R3: handleEditPersona opens AgentEditDialog (definition-section focus).
- R4: onEditLinkedPersona back-door deleted; avatar lives on the merged surface.
- R5: usePersonaActions.openEdit sets personaToEdit (AgentPersona) instead of
  personaDialogState(editPersonaDialogState). AgentsView renders AgentEditDialog
  for definition-only context.
- R6: AgentManagementDialogs routes update action to AgentEditDialog.
  assertAgentCanActFromOrigin guard preserved verbatim via onValidate prop.
  Agent-requested field changes pre-filled for user review via initialValueOverrides.
  Unresolvable updates toast the editError and dismiss.
- R7: UserProfilePersonaDialogs host now only fires for R8 (duplicate/create
  seed); no edit routes remain through personaDialogState.
- R8 (duplicate) and R9 (start-on-launch quick toggle) kept unchanged.

Regression tests (agentFormModel.test.mjs):
- test_pooled_name_instance_name_not_materialized_when_name_pool_exists
- test_pooled_name_instance_name_not_materialized_even_when_names_differ
- test_no_name_pool_explicit_instance_name_change_emits_agentInput
- test_env_clobber_dropped_when_user_edits_unrelated_d_field
- test_env_clobber_dropped_even_when_definition_env_differs_from_instance_env

AC1 grep verified: definition-edit and instance-edit appear only in AgentDialog
component definitions and comments; editPersonaDialogState appears only in
AgentEditDialog's own internal seeding; duplicatePersonaDialogState appears only
in R8 (duplicate) paths.

Full desktop test suite: 4540/4540 passing.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-08 11:56:22 -04:00
..
2026-08-03 21:51:17 -04:00
…

Buzz

Desktop chat shell with:

  • Tauri + React + TypeScript + Vite
  • Tailwind CSS
  • shadcn/ui-ready shared components
  • Biome (lint/format/check)
  • Feature-driven frontend structure

Scripts

  • pnpm dev - run the web frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm format - Biome format (write)
  • pnpm check - Biome check

Structure

  • src/shared - reusable app-wide code (ui, lib, styles)
  • src/features - feature modules (vertical slices)
  • src/app - top-level app composition