Bug Description
CoreToolScheduler.handleConfirmationResponse() in coreToolScheduler.ts receives a payload parameter but never passes it to originalOnConfirm(). This means external integrations (non-TUI) that use the onConfirm(outcome, payload) callback to pass user answers for ask_user tool calls never get the answers through.
Steps to Reproduce
- Use
CoreToolScheduler with a non-TUI confirmation handler (e.g., web UI, API)
ask_user tool fires, confirmationDetails.onConfirm is wrapped by handleConfirmationResponse
- External code calls
wrappedOnConfirm(ProceedOnce, { answers: {"0": "user's choice"} })
handleConfirmationResponse calls originalOnConfirm(outcome) — drops payload
AskUserInvocation.userAnswers stays {}, tool returns "User submitted without answering questions"
Root Cause
In coreToolScheduler.ts, handleConfirmationResponse:
async handleConfirmationResponse(callId, originalOnConfirm, outcome, signal, payload) {
// ...
await originalOnConfirm(outcome); // <-- payload is dropped here
// ...
}
Fix
await originalOnConfirm(outcome, payload);
Why it works in the TUI
The TUI's InkConfirmationManager sets userAnswers directly on the AskUserInvocation object via the React component state, bypassing onConfirm's payload entirely. So this bug is invisible in the terminal but breaks all external integrations.
Affected versions
Confirmed in 0.32.1 and 0.33.0.
Bug Description
CoreToolScheduler.handleConfirmationResponse()incoreToolScheduler.tsreceives apayloadparameter but never passes it tooriginalOnConfirm(). This means external integrations (non-TUI) that use theonConfirm(outcome, payload)callback to pass user answers forask_usertool calls never get the answers through.Steps to Reproduce
CoreToolSchedulerwith a non-TUI confirmation handler (e.g., web UI, API)ask_usertool fires,confirmationDetails.onConfirmis wrapped byhandleConfirmationResponsewrappedOnConfirm(ProceedOnce, { answers: {"0": "user's choice"} })handleConfirmationResponsecallsoriginalOnConfirm(outcome)— dropspayloadAskUserInvocation.userAnswersstays{}, tool returns "User submitted without answering questions"Root Cause
In
coreToolScheduler.ts,handleConfirmationResponse:Fix
Why it works in the TUI
The TUI's
InkConfirmationManagersetsuserAnswersdirectly on theAskUserInvocationobject via the React component state, bypassingonConfirm's payload entirely. So this bug is invisible in the terminal but breaks all external integrations.Affected versions
Confirmed in 0.32.1 and 0.33.0.