-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat(core): expose Question.ask via API/SDK
#8404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
a4cbb10 to
68a801e
Compare
| Bus.publish(Event.Asked, info) | ||
| }) | ||
|
|
||
| return (awaitAnswers ? answerPromise : id) as T extends true ? typeof answerPromise : typeof id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/review EDIT: 😢 I was hoping I could summon a review bot to give me some early feedback, heh. |

What does this PR do?
Fixes: #8384
Exposes a new
POST /question/askserver endpoint that allows clients and the SDK to programmatically ask questions to users without blocking. Key changes:Question.ask()function to support an optionaloptionsparameter with anawaitAnswerskey:awaitAnswers: true(default): blocks and returns the answers (existing behavior)awaitAnswers: false: returns the question request ID immediately without waiting for answers/question/askAPI endpoint that creates a question request and returns its ID, enabling async question flows from external clients/question/askendpoint performs session existence validation and returns 404 when the session doesn't existQuestion.AskInputschema fromQuestion.Requestto provide a clean input type for the new endpoint (without the server-generatedidfield)Question.ask()method and types (QuestionAskInput,QuestionAskResponses, etc.)How did you verify your code works?
Question.askrefactor intest/question/question.test.tstest/server/question.test.ts: