From 04c4c426e64897c71d188e9250e3784ba4088c52 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 8 Aug 2026 17:30:30 -0400 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20Phase=201=20round-4=20=E2=80=94?= =?UTF-8?q?=20close=20all=20Paul=20round-3=20gate=20defects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire onDeleteDefinition/onRemoveFromMyAgents/onShare/isIdentityArchived/ linkedInstanceCount through AgentEditDialog to all three callers (UserProfilePanel, AgentsView, AgentManagementDialogs). Add onShare to AgentEditMergedDialogProps and render Share action in the definition admin section. Fix mislabeled comment above Delete button. Add R6 respondTo regression tests covering definition-only context seed and emit through coordinator. Export FIELD_OWNERS constant as load-bearing source-of-truth map annotating every AgentFormModel field with its FieldOwner. Delete AgentInstanceEditDialog.tsx and agentInstanceEditPinning.test.mjs (zero production consumers). Remove definitionReadOnly prop from AgentDefinitionDialog.tsx. Update agentDialogRouting.test.mjs: remove AgentInstanceEditDialog import; replace is-NOT-reachable test with positive assertion that AgentEditMergedDialog appears in all R1-R7 contexts. Add two e2e tests: team-linked instance D-fields disabled + team-notice names the team; linked agent one-Save persists both D and I layers. 4560/4560 desktop tests pass. TypeScript clean. Biome clean. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- .../agents/ui/AgentDefinitionDialog.tsx | 28 +- .../features/agents/ui/AgentEditDialog.tsx | 19 + .../agents/ui/AgentEditMergedDialog.tsx | 24 +- .../agents/ui/AgentInstanceEditDialog.tsx | 1227 ----------------- desktop/src/features/agents/ui/AgentsView.tsx | 40 +- .../agents/ui/agentDialogRouting.test.mjs | 22 +- .../agents/ui/agentFormModel.test.mjs | 76 + .../src/features/agents/ui/agentFormModel.ts | 35 + .../ui/agentInstanceEditPinning.test.mjs | 284 ---- .../features/profile/ui/UserProfilePanel.tsx | 28 +- desktop/tests/e2e/edit-agent.spec.ts | 131 ++ mobile/pubspec.lock | 16 +- 12 files changed, 366 insertions(+), 1564 deletions(-) delete mode 100644 desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx delete mode 100644 desktop/src/features/agents/ui/agentInstanceEditPinning.test.mjs diff --git a/desktop/src/features/agents/ui/AgentDefinitionDialog.tsx b/desktop/src/features/agents/ui/AgentDefinitionDialog.tsx index 509bb5b425..4a4566f5b7 100644 --- a/desktop/src/features/agents/ui/AgentDefinitionDialog.tsx +++ b/desktop/src/features/agents/ui/AgentDefinitionDialog.tsx @@ -102,8 +102,6 @@ type AgentDefinitionDialogProps = { isPending: boolean; runtimes: AcpRuntimeCatalogEntry[]; runtimeCatalogStatus?: "loading" | "ready" | "error"; - /** When true, D-fields render disabled + "Managed by team" notice; submit blocked. */ - definitionReadOnly?: boolean; onDirtyChange?: (dirty: boolean) => void; onOpenChange: (open: boolean) => void; onSubmit: ( @@ -132,7 +130,6 @@ export function AgentDefinitionDialog({ isPending, runtimes, runtimeCatalogStatus = "ready" as const, - definitionReadOnly = false, onDirtyChange, onOpenChange, onSubmit, @@ -494,7 +491,6 @@ export function AgentDefinitionDialog({ // Gate model/provider validity through missingNormalizedFields — single // source of truth with the readiness gate so display and Save can't drift. const canSubmit = - !definitionReadOnly && canSubmitPersonaDialog({ displayName, isPending }) && (!isCreateMode || runtime.trim().length > 0) && (!isCreateMode || selectedRuntimeIsAvailable) && @@ -746,7 +742,7 @@ export function AgentDefinitionDialog({ > { setHasUserChanges(true); @@ -760,12 +756,6 @@ export function AgentDefinitionDialog({ />
- {definitionReadOnly ? ( -

- This agent is managed by a team. Its configuration cannot be edited - here. -

- ) : null}