refactor(desktop): definition-edit routes through AgentDialog — single dialog entry point (Phase 1B.3c)#1643
Conversation
resolveSourcePath treated any dotted basename as already-extensioned
(path.extname('.../ProfileAvatarEditor.utils') is '.utils'), handing
node an unresolvable path. Any test importing the dialog component tree
died on AgentCreationPreview -> ProfileAvatarEditor.utils. Decide by
file existence instead, falling back to default resolution so
genuinely-extensioned specifiers (.mjs/.json/explicit .ts) resolve
exactly as before.
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
…B.3c) AgentDialog gains a definition-edit union arm — a pass-through to AgentDefinitionDialog driven by the caller's PersonaDialogState (edit/ duplicate/import). The two remaining direct AgentDefinitionDialog mounts re-point through it (UserProfilePersonaDialogs, AgentsView), making AgentDialog the single dialog entry point for every intent: create-definition(+/-start), create-instance, edit-instance, edit-definition. AgentDefinitionDialog is now internal to the dialog family. New routing pinning test covers exact prop pass-through per arm. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Review — APPROVE (via comment; formal approve blocked, same authed account)Reviewed per the five pins agreed in-channel, plus the loader carve-in conditions. Loader commit Pin 1 (cascade zero-diff): Routing test: hook-free plain-function-call inspection is a clean pattern; the exact-pass-through + discriminant-stripped assertions pin the contract, and the test itself is a living witness for the loader fix (cannot pass on an unpatched loader). Manual verification (fresh detached checkout of
Matches the builder's reported results independently. LGTM — queues at Wes's gate once CI settles. |
What (Phase 1B.3c — profile cutover)
AgentDialoggains a third union arm,definition-edit— a pass-through toAgentDefinitionDialogdriven by the caller'sPersonaDialogState(edit / duplicate / import flows). The two remaining directAgentDefinitionDialogmounts re-point through it:UserProfilePersonaDialogs(profile panel)AgentsView(edit/dup/import mount)After this, AgentDialog is the single dialog entry point for every intent — create-definition(±start), create-instance, edit-instance, edit-definition — and
AgentDefinitionDialogis internal to the dialog family. Nothing is deleted: PersonaDialog died in B3a (#1627), EditAgentDialog in B3b (#1639); B3c collapses the last two out-of-family mounts.Pins (pre-agreed in-channel)
submitProfilePersonaDialog(persona→linked-agent cascade,validateLinkedAgentRuntimeEdit, toasts) zero-diff; profile keeps ownership of itspersonaDialogState, only the mount re-points.desktop/tests/e2e/diff is 0 lines; AgentDefinitionDialog body untouched, all testids stay put.Test-loader fix (isolated in its own commit for review)
Writing the routing test surfaced a latent bug in
test-loader-hooks.mjs:resolveSourcePathearly-returns whenpath.extname()is truthy, so dotted basenames (ProfileAvatarEditor.utils→.utils.tson disk) never resolved — the entire dialog component tree was unimportable from unit tests. Fixed by deciding on file existence, with fallback to node's default resolution so genuinely-extensioned specifiers (.mjs,.json, explicit.ts) resolve exactly as before. Reviewer ruling (Pinky): keep in this PR — the routing test cannot pass without it.New test
agentDialogRouting.test.mjs(3 tests): definition-edit exact prop pass-through (mode discriminant stripped), instance-edit contract props, create modes route through the internal router.Validation