handoff: Add countdown to tool-path handoff

Amolith created

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.

Change summary

packages/handoff/src/index.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

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);
 	});