feat: allow chomp api service to handle unknown intents in response - #10609
Merged
Merged
Conversation
Jwhiles
force-pushed
the
fix-intents-parsing
branch
from
September 30, 2026 08:55
7b6a0aa to
ecca189
Compare
MoMannn
approved these changes
Sep 30, 2026
Jwhiles
marked this pull request as ready for review
September 30, 2026 14:18
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.
Explanation
Currently the chomp API client can't handle unknown intents being returned by the chomp API. The way this is most likely to manifest is something like
ChompIntentTypeenum to handle whatever new intent is now being usedThis PR loosens our validation of the API response, it initially parses the intents as strings and then filters out unknown values. This means that outdated clients simply won't see intents that they don't know about
References
Checklist
Note
Medium Risk
Changes intent visibility for outdated clients—they may not see newer intent types and could misjudge whether an intent already exists, though this replaces hard parse failures on mixed API responses.
Overview
Forward-compatible parsing when the CHOMP API returns intent types this package does not yet define. Previously, strict
enums(CHOMP_INTENT_TYPES)validation caused the whole response to fail if the API added a new type before clients shipped an updatedChompIntentTypelist.getIntentsByAddressnow validatesmetadata.typeas a string, then drops entries that are not in the localCHOMP_INTENT_TYPESlist viaisChompIntentType. Non-string types still fail validation.getServiceDetailsuses acoerceon each protocol'sintentTypes: accept string arrays from the API and filter to known types instead of rejecting the entire payload.Tests cover unknown string types (filtered), invalid non-string types (still throw), and service-details filtering. Changelog documents the fix under Unreleased.
Reviewed by Cursor Bugbot for commit b3df246. Bugbot is set up for automated code reviews on this repo. Configure here.