Fix api_call actions running async, breaking book recommendations#584
Merged
Fix api_call actions running async, breaking book recommendations#584
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9875bdaaf
ℹ️ 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".
…mendations In production (GCP), api_call actions were enqueued to Cloud Tasks and processed asynchronously. This caused the recommendation sub-flow to return without book results — the flow continued to "Happy reading!" without ever showing books. Three fixes: - Remove api_call from async_actions set in ActionNodeProcessor so book recommendation queries run synchronously within the chat flow - Respect wait_for_acknowledgment in composite sub-flow processing loop - Flatten message results and handle COMPOSITE node type in parent flow return processing to prevent nested message dicts in responses
e9875bd to
73d68e5
Compare
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.
Summary
api_callfrom async actions set inActionNodeProcessor— in production (GCP), api_call actions were being enqueued to Cloud Tasks and processed asynchronously, causing the recommendation sub-flow to return without book results. Users saw "Good choices!" → "Looking for books..." → "Happy reading!" but never actual book recommendations.wait_for_acknowledgmentin composite sub-flow loop — message nodes withwait_for_ack: truewere being ignored inside composite sub-flow processing.COMPOSITEto handled node types and properly extract inner messages frommessages-type results instead of appending raw dicts.Root cause
ActionNodeProcessor.process()classifiedapi_callas an async action type. Locally, Cloud Tasks fails to enqueue (no GCP credentials) and falls back to synchronous processing, so this worked in development. In production on GCP, Cloud Tasks succeeds, the api_call is enqueued, andActionNodeProcessorreturns immediately with{type: "action", async: true}— nonext_node. The composite sub-flow loop breaks and the flow returns to the main flow without book results.Test plan