Skip to content

CoreToolScheduler.handleConfirmationResponse drops payload for ask_user tool #22120

@bryantinsley

Description

@bryantinsley

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

  1. Use CoreToolScheduler with a non-TUI confirmation handler (e.g., web UI, API)
  2. ask_user tool fires, confirmationDetails.onConfirm is wrapped by handleConfirmationResponse
  3. External code calls wrappedOnConfirm(ProceedOnce, { answers: {"0": "user's choice"} })
  4. handleConfirmationResponse calls originalOnConfirm(outcome) — drops payload
  5. 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.

Metadata

Metadata

Assignees

Labels

area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationstatus/need-triageIssues that need to be triaged by the triage automation.type/bug

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions