Skip to content

Fix api_call actions running async, breaking book recommendations#584

Merged
hardbyte merged 1 commit intomainfrom
fix/deploy-composite-subflows
Feb 10, 2026
Merged

Fix api_call actions running async, breaking book recommendations#584
hardbyte merged 1 commit intomainfrom
fix/deploy-composite-subflows

Conversation

@hardbyte
Copy link
Owner

@hardbyte hardbyte commented Feb 9, 2026

Summary

  • Remove api_call from async actions set in ActionNodeProcessor — 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.
  • Respect wait_for_acknowledgment in composite sub-flow loop — message nodes with wait_for_ack: true were being ignored inside composite sub-flow processing.
  • Fix message flattening in parent flow return — add COMPOSITE to handled node types and properly extract inner messages from messages-type results instead of appending raw dicts.

Root cause

ActionNodeProcessor.process() classified api_call as 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, and ActionNodeProcessor returns immediately with {type: "action", async: true} — no next_node. The composite sub-flow loop breaks and the flow returns to the main flow without book results.

Test plan

  • Unit tests pass (443/443)
  • Lint passes (ruff check)
  • Local E2E: full flow produces 7 correctly-structured messages including book recommendations
  • Production E2E after deploy: verify book recommendations appear in chatflow

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: 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
@hardbyte hardbyte force-pushed the fix/deploy-composite-subflows branch from e9875bd to 73d68e5 Compare February 9, 2026 18:38
@hardbyte hardbyte merged commit 0d0c17f into main Feb 10, 2026
11 checks passed
@hardbyte hardbyte deleted the fix/deploy-composite-subflows branch February 10, 2026 07:15
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