refactor(desktop): re-host instance edit as AgentInstanceEditDialog behind AgentDialog (Phase 1B.3b)#1639
Merged
Merged
Conversation
…ehind AgentDialog (Phase 1B.3b) Move EditAgentDialog.tsx to AgentInstanceEditDialog.tsx (git mv, body unchanged) and route it through the unified AgentDialog entry point as a new "instance-edit" mode, so all four agent intents (create definition, create+start, create instance, edit instance) share one dialog surface. - AgentDialog props become a discriminated union; the create paths are untouched and now live in an internal AgentCreateDialogRouter. The exported mode type for create callers is AgentDialogCreateMode. - UserProfilePanel keeps its persistent mount, editAgentOpen state, and the requestOpenEditAgent nudge-event subscription unchanged; only the mounted component name changes. - Pure modules (personaRuntimeModel.ts, useRequiredCredentialState.ts) are zero-diff; the [open, agent.pubkey] reset lifecycle travels inside the moved body untouched. - New agentInstanceEditPinning.test.mjs pins the inherit-toggle -> gate -> submit seam chain through the pure modules as the component wires them, plus the steady-state-inherit authoritative-edits contract. - All testids move with the body; edit-agent.spec.ts passes unmodified (zero e2e spec edits). Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Collaborator
Author
|
Review (Pinky, per agreed posture) — GitHub approve blocked (same authed account as author), so recording the verdict here. Mechanical half — all five pins verified:
Manual half: fresh checkout of 61efb08, Union shape note: TS now enforces Verdict: APPROVE. Narf! |
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
…-size override runtime.rs: wrap the merged_user_env call introduced in the #1639/1640 rebase conflict resolution — line exceeded rustfmt's limit. check-file-sizes.mjs: add override for AgentInstanceEditDialog.tsx (1043 lines). #1639 renamed EditAgentDialog to AgentInstanceEditDialog; #1448 rebase conflict resolution threaded initialFocus?/EditAgentFocusTarget through AgentDialog.tsx into AgentInstanceEditDialog.tsx, adding ~7 lines of feature plumbing. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1B.3b of the unified agent model: the instance-edit dialog re-homes into the unified
AgentDialogfamily.EditAgentDialog.tsxbecomesAgentInstanceEditDialog.tsx(git mv — the 954-line body is unchanged except the function name), andAgentDialoggains aninstance-editmode, making it the single entry point for all four agent intents: create definition, create definition + start, create standalone instance, and now edit instance.What changed
AgentDialog.tsx— props become a discriminated union (AgentDialogCreateProps | AgentDialogInstanceEditProps).instance-editrendersAgentInstanceEditDialogas a pass-through; the create paths are byte-identical, relocated into an internalAgentCreateDialogRouterso hooks stay unconditional. Create callers use the new exportedAgentDialogCreateModetype.UserProfilePanel.tsx— the single mount swaps<EditAgentDialog …>for<AgentDialog mode="instance-edit" …>. The persistent mount,editAgentOpenstate, and therequestOpenEditAgentnudge-event subscription (the only route that opens this dialog) are untouched.AgentsView.tsx— create-state type narrows toAgentDialogCreateMode(type-only ripple).agentInstanceEditPinning.test.mjs(new) — pins the inherit-toggle → credential-gate → submit seam chain through the pure modules exactly as the component wires them: prospective-runtime resolution from the linked persona (not the stale pin), gate validating the same submission snapshot submit persists (both directions: clears with the persona credential, blocks without it), command-clear sentinel +harnessOverridederivation, and the steady-state-inherit authoritative-edits contract.CreateAgentDialog.tsx,personaProviderModelFields.tsx,editAgentProviderDiscovery.test.mjs.Invariants preserved (review pins)
personaRuntimeModel.tsanduseRequiredCredentialState.ts: zero diff.[open, agent.pubkey]reset lifecycle travels inside the moved body untouched — no effect surgery.edit-agent.spec.tspasses unmodified (zero e2e spec edits — the suite added in test(desktop): add edit-agent dialog e2e coverage (Phase 1B.3b-pre) #1628 is the acceptance gate for this move).Testing
tsc --noEmitclean; biome clean.playwright --project=smoke edit-agent.spec.ts: 3/3 pass, spec unmodified.-g "agent|persona": 59/59 pass.Part of the Phase 1B UI unification (#1624 → #1626 → #1627 → this). Next: B3c profile-panel cutover deletes the remaining legacy dialog paths.