@@ -23,7 +23,6 @@ import { useAgentChatPendingApproval } from "../hooks/useAgentChatPendingApprova
2323import { agentIngressBaseUrl } from "../utils/ingress" ;
2424import { AgentBuilderMcpConnectDialog } from "./AgentBuilderMcpConnectDialog" ;
2525import { AgentBuilderSecretForm } from "./AgentBuilderSecretForm" ;
26- import { AgentBuilderSeedDialog } from "./AgentBuilderSeedDialog" ;
2726import {
2827 AGENT_BUILDER_CHAT_ID ,
2928 AGENT_BUILDER_SLUG ,
@@ -322,37 +321,22 @@ export function AgentBuilderDock() {
322321 setPendingMcpConnect ( null ) ;
323322 }
324323
325- // Edit-with-AI hand-offs: send the seeded prompt once when a new seed lands.
326- // An empty dock starts immediately; if a chat is already in progress, confirm
327- // whether to start fresh or continue (so a deliberate "New agent" / "Edit with
328- // AI" doesn't silently wipe or append onto an unrelated conversation).
324+ // Contextual hand-offs ("New agent" / "Edit with AI" / …): prefill the
325+ // seeded prompt into the composer when a new seed lands — never send it. The
326+ // user reviews and hits send, so opening the dock doesn't fire a chat on its
327+ // own. Prefilling is non-destructive, so no start-fresh-vs-continue prompt is
328+ // needed: it drops into whatever chat is open, and the header "New chat" (+)
329+ // clears first if the user wants a fresh conversation.
329330 const lastSeedRef = useRef ( 0 ) ;
330- const [ seedConfirm , setSeedConfirm ] = useState < string | null > ( null ) ;
331+ const [ draft , setDraft ] = useState < { text : string ; token : number } | null > (
332+ null ,
333+ ) ;
331334 useEffect ( ( ) => {
332335 if ( ! seed || seed . seq === lastSeedRef . current ) return ;
333336 lastSeedRef . current = seed . seq ;
334337 consumeSeed ( seed . seq ) ;
335- if ( chat . messages . length === 0 ) {
336- chat . send ( seed . prompt ) ;
337- } else {
338- setSeedConfirm ( seed . prompt ) ;
339- }
340- } , [ seed , chat , consumeSeed ] ) ;
341-
342- function seedStartFresh ( ) {
343- if ( ! seedConfirm ) return ;
344- setPendingSecret ( null ) ;
345- setPendingMcpConnect ( null ) ;
346- chat . newChat ( ) ;
347- setLastSession ( null ) ;
348- chat . send ( seedConfirm ) ;
349- setSeedConfirm ( null ) ;
350- }
351- function seedContinue ( ) {
352- if ( ! seedConfirm ) return ;
353- chat . send ( seedConfirm ) ;
354- setSeedConfirm ( null ) ;
355- }
338+ setDraft ( { text : seed . prompt , token : seed . seq } ) ;
339+ } , [ seed , consumeSeed ] ) ;
356340
357341 return (
358342 < Flex
@@ -432,6 +416,7 @@ export function AgentBuilderDock() {
432416 placeholder = { placeholder }
433417 emptyState = { < AgentBuilderEmptyState page = { page } onPick = { chat . send } /> }
434418 emptyHint = "Ask the agent builder to inspect, debug, or edit your agents. It can see what you're looking at and walk you there."
419+ draft = { draft ?? undefined }
435420 belowConversation = {
436421 pendingApproval ? (
437422 < AgentChatPendingApprovalCard
@@ -459,14 +444,6 @@ export function AgentBuilderDock() {
459444 />
460445 ) }
461446
462- < AgentBuilderSeedDialog
463- open = { seedConfirm != null }
464- prompt = { seedConfirm ?? "" }
465- onStartFresh = { seedStartFresh }
466- onContinue = { seedContinue }
467- onCancel = { ( ) => setSeedConfirm ( null ) }
468- />
469-
470447 < AgentBuilderMcpConnectDialog
471448 pending = { pendingMcpConnect }
472449 busy = { mcpConnectBusy }
0 commit comments