feat(desktop): unified AgentDialog create entry point with create intents (Phase 1B.2)#1626
Merged
Conversation
This was referenced Jul 8, 2026
Merged
…ents (Phase 1B.2) Route both create entry points (New agent, Custom agent / open-create-agent event) through a single AgentDialog that owns the create intent: definition, definition+start (default, today's quick-start), or standalone instance. - agentCreateIntent.ts: pure intent model. resolveCreateIntent defaults un-migrated handleSubmit callers (PersonaDialog's duplicate path until B3) to definition_start so duplicate keeps create-then-start semantics; toggle-on dialog copy is derived from createPersonaDialogState so it cannot drift from the legacy create flow. - usePersonaActions.handleSubmit(input, intent?) -> Promise<boolean>: definition intent runs the existing create branch minus the instance step; all other paths unchanged. prepareCreate split out of openCreate so the unified dialog can prime feedback/runtime loading without setting personaDialogState (keeps the old and new PersonaDialog mounts mutually exclusive); openCreate itself is untouched for one-line rollback. - AgentDialog.tsx: intent router. Definition family renders PersonaDialog in create mode with a "Start agent after create" toggle injected via the new createFooterSlot prop (footer-left is empty in create mode); instance renders CreateAgentDialog unchanged. Physical consolidation of the two forms is Phase 1B.3. - AgentsView: entry point implies intent (no in-dialog mode picker). PersonaDialog stays mounted for edit/duplicate/import; CreateAgentDialog remains reachable as the instance form. Wire shapes (CreatePersonaInput / CreateManagedAgentInput) unchanged. Definition-only is the one genuinely new behavior: today's UI always quick-starts. The create-mode runtime-required guard is kept as-is for definition-only; relaxing it is a product question, not smuggled in here. Verified: tsc, biome (full src), file-size checks, 2061/0 unit tests (5 new intent-model tests incl. the duplicate-default pin), smoke e2e -g "agent|persona" 56/56 locally. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
bea5793 to
8f3426f
Compare
This was referenced Jul 10, 2026
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.
Phase 1B.2 — unified AgentDialog create entry point
Second slice of Phase 1B (UI unification, #centralize-personas-and-agents). Routes both create entry points on the Agents surface through a single
AgentDialogthat owns the create intent:definition_start(default)personaId) — today's quick-startPersonaDialog(create mode) with "Start agent after create" toggle ondefinitioninstanceCreateAgentDialog, unchangedStacked on #1624 (B1 shared sections). Wire shapes (
CreatePersonaInput/CreateManagedAgentInput) untouched — frontend recomposition only; independent of #1623 (A2).Composition: pass-through router, not a new form
AgentDialog(~110 lines) is an intent router. The definition family rendersPersonaDialogitself in create mode (via a new 2-linecreateFooterSlotprop — footer-left is empty in create mode; edit's import button owns it otherwise); the instance intent rendersCreateAgentDialogunchanged. A new standalone form would have duplicated ~400 lines that B3 deletes anyway; physical consolidation of the forms into one file is B3's job. Consequence: B1's shared sections are consumed transitively (both forms already use them).Entry point implies intent — "New agent" opens the definition family, "Custom agent" and the
open-create-agentevent open the instance form. There is no in-dialog mode picker; don't readAgentDialogexpecting one.Sequencing stays hook-side
usePersonaActions.handleSubmit(input, intent?)keeps ownership of create-then-instance (it already holds the mutations, feedback surfaces, and SecretRevealDialog plumbing). The definition intent is the existing create branch minus the instance step; upstream (runtime guard, avatar resolve) and downstream (instance step, error taxonomy, dialog close, pending reset) are untouched. Return type widens toPromise<boolean>so the unified mount can close on success — legacy callers ignore the return.definition_startpreserves this hook's semantics (harnessOverride: true, hard-error on unavailable runtime,resolveManagedAgentAvatarUrlbefore create feeding both records) — nothandleStartPersona's card-start mapping, which diverges (conditionalharnessOverride,resolvePersonaRuntimefallback) and stays untouched on the card path. Converging the two definition→instance mappings is a real cleanup but belongs to a visible future slice, not this PR.Intent defaults pin legacy behavior
resolveCreateIntentdefaults todefinition_start: PersonaDialog's duplicate path still callshandleSubmitwithout an intent until B3, and create/duplicate both always quick-start today. A unit test pins the default so duplicate can't silently become definition-only. The toggle-on dialog copy is derived fromcreatePersonaDialogStateand deepEqual-pinned against it — it cannot drift from the flow it replaces.Divergence flags (per the B1 rule: each intent preserves the flow it replaces)
lockedRuntimeResetstays per-form by construction: definition intents replace PersonaDialog-create →"full"; instance replaces CreateAgentDialog →"provider-only". The flag choice is a consequence of the replaces-rule, not a judgment call.Both-paths-alive (weaker form for one path — explicit)
CreateAgentDialog: fully alive and reachable — it is the instance form, byte-identical.PersonaDialogcreate mode: in-tree but unreachable via UI (edit/duplicate/import mounts remain live). Rollback = one-line revert of theAgentsViewmount wiring;openCreateis intact in the hook, unwired.personaDialogState(prepareCreatesplit out ofopenCreateprimes feedback/runtime-load without it), so the old and newPersonaDialogmounts — which share testids until B4's rename — can never coexist. Comment at the mount site names the assumption.Testids
The definition form reuses PersonaDialog's existing testids/ids (
persona-dialog,persona-dialog-submit,#persona-runtime, …), so the existing create-path e2e specs run unchanged — verified locally. Renames are B4's vocabulary flip. New:agent-dialog-start-toggle.Open product questions for @wesbillman (none block this PR)
Verification
src/), file-size/px-text/pubkey checks clean-g "agent|persona"56/56 locally; full suite in CI