feature/chat questionaire - #377
ahmad-ajmal merged 3 commits into
Conversation
| ) | ||
|
|
||
| status = "success" if simulated_mode else "ok" | ||
| return {"status": status, "fire_at_delay": 10800} |
There was a problem hiding this comment.
agent_base needs wait_for_user_reply in order to pause the trigger continuation. This does not return that and hence does not pause the flow. Currently it will fire the next trigger after 10800 even if the user never replies.
There was a problem hiding this comment.
Fixed: return "wait_for_user_reply": True (always pauses by design), matching send_message.py.
| // Esc abandons the whole batch — only while it's still unanswered. | ||
| useEffect(() => { | ||
| if (resolved) return | ||
| const handler = (e: KeyboardEvent) => { |
There was a problem hiding this comment.
Is there a way to make this specific to tasks rather than a global key check? This would basically decline every question batch no matter where you press the escape key since its just a base keydown listener
There was a problem hiding this comment.
Fixed: moved to onKeyDown on the stepper's own root div, so it only fires via DOM bubbling from that stepper's own focused controls.
There was a problem hiding this comment.
not sure but please validate if scroll up pagination works. Do not want this questionnaire to be removed from the rendered messages history if you scroll up after a while
There was a problem hiding this comment.
Fixed both to match the live-broadcast serialization.
| const isReview = !single && step === questions.length | ||
| const current = questions[step] | ||
|
|
||
| const goToStep = (i: number) => { |
There was a problem hiding this comment.
sometimes when I navigate back and forth - it wipes the values
There was a problem hiding this comment.
Fixed: goToStep now rehydrates from the stored answer, and answerCurrent's forward step routes through it too for consistency.
- Error instead of parking 3h when no UI can answer (CLI mode / no clients), via new InterfaceAdapter.can_prompt_user() - Drop duplicate submits from stale tabs (atomic first-submission-wins in storage) and broadcast resolution to all clients - QuestionStepper: structured per-question drafts (comma values no longer corrupt on back-nav), selected-choice highlight, Dismiss button, Esc in free-text clears instead of declining - Resume text falls back to storage after restart (no more raw "q1" ids) - Dedupe question serializers into ChatMessageQuestion to_dict/from_dict - Extract WAIT_FOR_REPLY_PARK_DELAY_SECONDS (imported inside action bodies - executor exec()s function source only)
Summary
Adds
ask_user_questions, an agent-driven clarifying-question UI for chat. Instead of the agent asking for missing/ambiguous info as a plain text message, it can now ask via an interactive stepper — multiple-choice (single- or multi-select) or open-ended, batched with a review step when there's more than one question, with a free-text override and an Esc-to-decline escape hatch.ask_user_questionsaction (app/data/action/ask_user_questions.py): batch of questions, each with optional choices and multi-select; resumes the parked task through the existing reply-to-task path (submit_message+reply_context) rather than adding new resume machinery.send_messagereply, so the UI isn't popping a form for every question.QuestionStepperfrontend component: nav/back for multi-question batches (collapses to a bare question when there's just one), checkboxes for multi-select, an always-visible free-text fallback, decline via Esc.Why this PR's base is
feature/multi-account-integrations, notV1.4.1This branch was created off
feature/multi-account-integrationsrather thanV1.4.1because of a real dependency: the first concrete trigger forask_user_questionsis the Gmail account-ambiguity case, whereresolve_account()(only present on that branch) returns an error listing candidate accounts, and prompt guidance here teaches the agent to turn that into anask_user_questionscall with those accounts as choices. Without multi-account support already in place, that trigger path doesn't exist to test against.Against this base, the diff is scoped to just this feature's commit, the multi-account commits aren't part of what's under review here, they're the prerequisite this branch builds on. No changes are made in this PR to account-resolution logic itself (
accounts.py,gmail_actions.py,_helpers.py); that work continues separately.Test plan
ruff checkon touched Python filespytest tests/vite build)Tip: Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install 'code' command in PATH" to enable IDE integration