Skip to content

Add wait_for_acknowledgment support and fix MESSAGE node chaining#578

Merged
hardbyte merged 2 commits intomainfrom
feat/wait-for-acknowledgment
Feb 7, 2026
Merged

Add wait_for_acknowledgment support and fix MESSAGE node chaining#578
hardbyte merged 2 commits intomainfrom
feat/wait-for-acknowledgment

Conversation

@hardbyte
Copy link
Owner

@hardbyte hardbyte commented Feb 7, 2026

Summary

  • Adds wait_for_acknowledgment support so MESSAGE nodes with wait_for_ack: true pause flow processing and return accumulated messages to the client (used for the searching animation in the Huey Bookbot flow)
  • Rewrites the MESSAGE branch in process_interaction to properly chain through ACTION → CONDITION → MESSAGE → QUESTION nodes when resuming from a paused message node (continueFlow)
  • Fixes a double-processing bug where the QUESTION branch while loop would re-process CMS random questions (fetching a different random question each time) when awaiting_input was already set

Test plan

  • 298 unit tests pass
  • Full E2E flow test against Docker: start → greeting → school_confirm (with resolved school name) → age → reading_ability → 3 preference questions → searching_msg pauses with wait_for_acknowledgment: true → continue → book recommendations → end_msg → restart_choice

Allow MESSAGE nodes with `wait_for_ack: true` to pause flow processing
and return accumulated messages to the client. The frontend can then
auto-continue after a delay (e.g., showing a searching animation).

Changes:
- Add `wait_for_acknowledgment` field to InteractionResponse schema
- Pass wait_for_acknowledgment through the chat API endpoint
- Check for wait_for_acknowledgment in QUESTION branch while loop
- Rewrite MESSAGE branch in process_interaction to properly chain
  through ACTION, CONDITION, MESSAGE, and QUESTION nodes when
  resuming from a paused message (continueFlow)
- Fix double-processing bug: skip while loop when awaiting_input
  is already True, preventing CMS random questions from being
  fetched twice
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf964b8766

ℹ️ 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".

When a MESSAGE node's next node is a QUESTION, persist current_node_id
and _current_options via chat_repo.update_session_state so the session
points at the correct QUESTION node for the next user response. Also
handle the ACTION→QUESTION recursive chain case.
@hardbyte hardbyte merged commit b6908d2 into main Feb 7, 2026
11 checks passed
@hardbyte hardbyte deleted the feat/wait-for-acknowledgment branch February 7, 2026 05:31
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