Files
buzz/desktop/src-tauri
Duncan ceada06a16 fix(agents): address Carl round-5 review findings (P1-1, P1-2, P2)
P1-1 — Preserve publish failure through settlement: introduce `publishFailed`
flag in agentSaveCoordinator. When `publishCatalogUpdates` is true, the command
throws after save_personas completes, and settlement observes the persona as
persisted, set publishFailed = true and preserve firstError. A new
`!observedRemainder && publishFailed` guard fires before the full-success branch
— shows a warning toast ('saved, but publishing failed'), keeps the dialog open
(returns false) so the user can retry. Previously the publish failure was silently
discarded, onDone was called, and the toast claimed full success.

Required regressions (non-negotiable per Carl):
- Rust: retain_failure_after_persist_is_returned_not_swallowed — exercises
  update_persona_with with a failing retain callback; confirms the error
  propagates (command returns Err) even though save_personas already ran.
- Coordinator (TS): test_publish_throws_post_persist_does_not_settle_as_full_success
  and test_publish_throws_post_persist_returns_false_not_partial_failure_toast —
  verify updatePersonaAndPublish throwing post-persist produces warning toast,
  returns false, and does not call onDone.

P1-2 — Instance name validation: add instanceName.trim().length > 0 guard to
canSubmit when showInst is true and the definition has no name pool (pool-named
instances don't submit the visible name). Stop the agentFormModel fallback:
nameChanged and agentInput.name no longer fall back to displayName.trim() when
instanceName is empty; use the raw value so a cleared field is treated as a
no-op, not a silent definition-name copy.

P2 — Label copy and a11y: rename 'Agent name' labels to 'Agent name (shared
definition)' in DSection and 'Agent name (this deployed instance)' in
InstanceSection. Add aria-expanded + aria-controls='d-advanced-fields' to the
DSection Advanced disclosure button and id='d-advanced-fields' to its controlled
region (motion.div), mirroring the InstanceSection pattern.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-29 13:42:00 -04:00
..