Open
Conversation
Contributor
Author
|
hey @virattt, can you review the code ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Add ask_user Tool : Enabling Real Clarification in the Agent Loop
This PR introduces an ask_user tool that allows Dexter to pause mid-execution and request clarification directly from the user.
When the model detects ambiguity or missing context, it can now:
Ask a precise question
Suspend execution cleanly
Wait for the user’s input
Resume the agent loop with that response as a tool result
Instead of guessing, Dexter now validates.
What Changed
Added ask-user.ts with tool definition and LLM schema
Introduced AskUserEvent into the event system
Updated the tool executor to intercept ask_user, emit an event, and await a Promise resolver
Registered the tool (always enabled)
Updated CLI and UI to handle the clarification state and render the question
All changes are strictly additive. Existing flows remain untouched.
Why This Matters, This improves:
Answer accuracy in ambiguous scenarios
Human–agent alignment
Transparency in reasoning flow
It shifts Dexter from being purely autonomous to being interactively intelligent, capable of knowing when to ask before proceeding.