From 4586179700c75219958a2acc7ad58dd700cc3a2a Mon Sep 17 00:00:00 2001 From: Amolith Date: Mon, 6 Apr 2026 10:21:07 -0600 Subject: [PATCH] handoff: Add countdown to tool-path handoff The tool-path handoff (agent calling the handoff tool) bypassed the pause-to-edit countdown and sent the prompt immediately via sendUserMessage. Replace that with setEditorText + startCountdown so both paths give the user a 10-second window to review and edit the handoff draft before it's submitted. Set editor text before awaiting setModel to avoid a race where slow model setup could clobber user edits. --- packages/handoff/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/handoff/src/index.ts b/packages/handoff/src/index.ts index 97d0b9e1c2909a32ae594904c29e968cf10bcfdd..a619ff6a09862d818a578a7baafda421f06d63a8 100644 --- a/packages/handoff/src/index.ts +++ b/packages/handoff/src/index.ts @@ -191,6 +191,9 @@ export default function (pi: ExtensionAPI) { handoffTimestamp = Date.now(); setTimeout(async () => { + ctx.ui.setEditorText(prompt); + startCountdown(ctx); + if (newModel) { const slashIdx = newModel.indexOf("/"); if (slashIdx > 0) { @@ -200,7 +203,6 @@ export default function (pi: ExtensionAPI) { if (model) await pi.setModel(model); } } - pi.sendUserMessage(prompt); }, 0); });