Skip to content

Comments

Feat/ask user tool#150

Open
saurav0369 wants to merge 2 commits intovirattt:mainfrom
saurav0369:feat/ask-user-tool
Open

Feat/ask user tool#150
saurav0369 wants to merge 2 commits intovirattt:mainfrom
saurav0369:feat/ask-user-tool

Conversation

@saurav0369
Copy link
Contributor

✨ 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.

@saurav0369
Copy link
Contributor Author

hey @virattt, can you review the code ?

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