Add share_payload message type and book_feedback input type#594
Merged
Add share_payload message type and book_feedback input type#594
Conversation
Share payload: MessageNodeProcessor resolves share_payload_variable from session state, returning structured data the frontend can render as a shareable card. Book feedback: QuestionNodeProcessor supports input_type "book_feedback" with a book_source variable reference. Users can rate books (like/dislike/ read) and the structured feedback is stored in session state for downstream condition routing. Updated recommendation flow to v2.0.0 with feedback collection, share payload generation, and liked-book branching.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f609e16a18
ℹ️ 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".
- Add book_feedback to InteractionCreate.input_type regex pattern so clients can submit feedback without getting a 422 - Fix CEL has() macro to use field-path syntax: has(obj.field) not has(obj, 'field')
The hardcoded enum of allowed input types required a schema change for every new flow input type. Replace with a simple identifier pattern so flow authors can define custom input types without API changes.
Same change as InteractionCreate — flow authors can define custom question input types without needing API schema changes.
Centralizes the set of known input types in a frozenset so they're discoverable via IDE autocomplete and OpenAPI examples, while keeping input_type as an open string for custom types.
The test used "invalid_input_type" which now passes the relaxed identifier regex. Use "123-INVALID!" which actually violates the pattern.
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
MessageNodeProcessorresolvesshare_payload_variablefrom session state, returning atype: "share_payload"message with structured data (title, subtitle, items, link) for the frontend to render as a shareable cardQuestionNodeProcessorsupportsinput_type: "book_feedback"withbook_sourcevariable reference — users rate books (like/dislike/read) and structured feedback is stored in session statehuey-recommendation-flow.jsonwith feedback collection on book display nodes, share payload generation via CEL aggregation, and liked-book condition branchingCompanion PRs
Test plan
poetry run pytest app/tests/unit/ -v)bash scripts/integration-tests.sh)