Skip to content

feat(hitl): declare multiSelect on AskUserQuestionRequest#293

Merged
danny-avila merged 1 commit into
mainfrom
feat/askuserquestion-multiselect
Jul 7, 2026
Merged

feat(hitl): declare multiSelect on AskUserQuestionRequest#293
danny-avila merged 1 commit into
mainfrom
feat/askuserquestion-multiselect

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

Adds multiSelect?: boolean to the SDK's AskUserQuestionRequest interface (src/types/hitl.ts, source for dist/types/types/hitl.d.ts).

When true, the host UI may let the user pick several options; the resulting AskUserQuestionResolution.answer is the selected option values joined by ", ". Omitted/false → single-select. Only meaningful alongside options.

Why

LibreChat's ask-user-question feature (#14139) passes a tool input containing multiSelect into askUserQuestion(). It works today only because the helper forwards the object verbatim into interrupt(), and librechat-data-provider's Agents.AskUserQuestionRequest mirror already declares multiSelect?: boolean.

Declaring the field in the SDK closes the type-contract gap so a future SDK change that validates or picks declared fields cannot silently drop it.

Changes

  • src/types/hitl.ts: add multiSelect?: boolean with doc comment; update AskUserQuestionResolution.answer JSDoc to cover the joined-values case.
  • src/tools/__tests__/hitl.test.ts: new case asserting multiSelect rides through the ask_user_question interrupt payload and resumes with the ", "-joined answer.

Verification

  • jest AskUserQuestion suite: 5 passed (incl. new test).
  • npm run build: confirmed multiSelect?: boolean; lands in generated dist/types/types/hitl.d.ts.

Related

Sibling to #292 — both stem from the LibreChat #14139 ask_user_question rollout. That PR fixes the tool-error-completion contract across interrupt/resume; this one closes the type-contract gap. No file overlap; independent.

@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 592f9692de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila danny-avila merged commit 328a7e8 into main Jul 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant