tui: add handoff text command handling in prompt

pull/12755/head
Dax Raad 2026-02-08 18:44:09 -05:00
parent 0eaa6b5fc8
commit 4cc9104942
1 changed files with 21 additions and 0 deletions

View File

@ -569,6 +569,27 @@ export function Prompt(props: PromptProps) {
command: inputText,
})
setStore("mode", "normal")
} else if (inputText.startsWith("/handoff ")) {
// Handle handoff command specially - call endpoint and replace prompt
const goal = inputText.slice(9).trim() // Remove "/handoff " prefix
if (goal) {
const result = await sdk.client.session.handoff({
sessionID,
goal,
model: {
providerID: selectedModel.providerID,
modelID: selectedModel.modelID,
},
})
if (result.data) {
// Replace prompt with the handoff text
const handoffText = result.data.text
input.setText(handoffText)
setStore("prompt", { input: handoffText, parts: [] })
// Don't submit yet - let user review and submit manually
return
}
}
} else if (
inputText.startsWith("/") &&
iife(() => {