Skip to content

[Bug]: AskUserQuestion answers dropped after Claude CLI 2.1.121 — model receives empty answer payload #2388

@jnsdls

Description

@jnsdls

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Use T3 Code with the claudeAgent provider on Claude CLI 2.1.121 (the version ~/.local/bin/claude currently resolves to).
  2. Start a thread and get the model to call the AskUserQuestion tool — e.g. ask it to confirm a multi-option decision via structured questions.
  3. When the question UI appears, pick an option and submit.
  4. Observe the next assistant turn: the model has no awareness of what was selected and typically asks again or proceeds blindly.

Expected behavior

The model's next turn receives a tool_result whose content includes the selected answer, e.g.:

User has answered your questions: "Approach"="Option A". You can now continue with the user's answers in mind.

Actual behavior

The model receives a tool_result whose content has an empty interpolation:

User has answered your questions: . You can now continue with the user's answers in mind.

The answer is captured correctly inside T3's own event log (user-input.resolved, tool_use_result.answers), but is dropped before it reaches the model on the next turn.

Impact

Major degradation or frequent failure

Version or commit

T3 Code Alpha (stable channel), Claude CLI 2.1.121

Environment

macOS, claudeAgent provider, Claude CLI 2.1.121 (regressed from 2.1.119)

Logs or stack traces

// Provider log — successful tool_use emitted by the model:
"content":[{"type":"tool_use","id":"toolu_…","name":"AskUserQuestion",
  "input":{"questions":[{"question":"Which approach do you prefer?",
                          "header":"Approach",
                          "multiSelect":false,
                          "options":[]}]}}]

// T3 captures the answer correctly in its own event:
"type":"user-input.resolved",
"payload":{"answers":{"Approach":"Option A"}}

// But the tool_result actually delivered to the model is empty:
"message":{"role":"user","content":[{
  "type":"tool_result",
  "content":"User has answered your questions: . You can now continue with the user's answers in mind.",
  "tool_use_id":"toolu_…"}]}

// Init line on the broken side: "claude_code_version":"2.1.121"
// Init line on the working side: "claude_code_version":"2.1.119"

Root cause (best guess from comparing the two SDK versions)

Between Claude CLI 2.1.119 (worked) and 2.1.121 (broken), the SDK's mapToolResultToToolResultBlockParam for AskUserQuestion changed how it constructs the tool_result string:

2.1.119 (worked) — key-agnostic:

({answers, annotations}, q) => ({
  type: "tool_result",
  content: `User has answered your questions: ${
    Object.entries(answers).map(([k, v]) => ).join(", ")
  }. You can now continue with the user's answers in mind.`
})

2.1.121 (broken) — looks up by full question text:

({questions, answers, annotations}, K) => ({
  type: "tool_result",
  content: `User has answered your questions: ${
    questions
      .map(({question}) => {
        const a = answers[question];          // looked up by question text
        if (!a && !annotations?.[question]?.notes) return null;
        return `"${question}"="${a}"`;
      })
      .filter(x => x !== null)
      .join(", ")
  }. You can now continue with the user's answers in mind.`
})

T3 currently submits answers keyed by header (e.g. "Approach"), not by the full question text (e.g. "Which approach do you prefer?"). Under 2.1.119 that was fine because the SDK iterated whatever keys came in. Under 2.1.121, every answers[question] lookup misses, every entry is filtered out as null, the array stringifies to empty, and the model sees no answer.

Suggested fix

Update T3's AskUserQuestion result handler so the answers object it returns to the SDK is keyed by the full question string, matching the documented outputSchema shape ("question text" -> "answer string"). The header field is intended for UI display only.

Workaround

Pin to the previous Claude CLI version:

ln -sfn ~/.local/share/claude/versions/2.1.119/claude ~/.local/bin/claude
# then restart T3 Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions