feat(frontier): add InputHintOption for structured preference options#442
feat(frontier): add InputHintOption for structured preference options#442whoAbhishekSah merged 6 commits intomainfrom
Conversation
Add InputHintOption message with name and title fields for user-friendly option display in preference traits. The input_options field in PreferenceTrait allows specifying both machine-readable names and display titles. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded a new protobuf message Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@raystack/frontier/v1beta1/models.proto`:
- Around line 521-527: InputHintOption allows empty/invalid identifiers; add
validation rules to ensure name is non-empty (and matches a stable
machine-readable pattern) and title is non-empty. Update the InputHintOption
message to include validation annotations (e.g., protoc-gen-validate /
validate.rules) on fields name and title: require name to be non-empty and
enforce a conservative pattern such as lowercase alphanumerics/underscores (or
your project's chosen identifier regex) and require title to be non-empty;
reference the message name InputHintOption and the fields name and title when
applying these annotations so generated code/validators will reject
empty/invalid values.
- Around line 557-560: Clarify the precedence rule for InputHintOption vs
input_hints: update the comment for the repeated field input_options to state
explicitly that input_options only takes precedence when it is present and
non-empty; if clients send input_options: [] (an empty list), the service should
fall back to using input_hints to populate options. Mention that implementations
may validate/require non-empty input_options if they want to enforce Option A,
and reference the fields InputHintOption, input_options, and input_hints in the
comment so the behavior is unambiguous.
Add value_title field to show human-readable display title alongside the machine-readable value in preference responses. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename title to description in InputHintOption and value_title to value_description in Preference message for better semantic clarity. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@raystack/frontier/v1beta1/models.proto`:
- Around line 521-526: Update the docstrings for the InputHintOption message to
reference the renamed field description (not title): change both field comments
to mention "description" and user-friendly display description examples, and
apply the same wording fix to the other occurrence of the renamed field in the
file (the InputHintOption declaration elsewhere). Specifically update the
comment for string description = 2 in the InputHintOption message and any
duplicate comments so they no longer say "title" but clearly state "description"
and show the user-facing examples.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@raystack/frontier/v1beta1/models.proto`:
- Line 521: The comment for the InputHintOption message contains a typo
"descriptu=ion" — update the comment text associated with InputHintOption in
models.proto to read "description" instead of "descriptu=ion" so the
documentation is clear and correct.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
raystack/frontier/v1beta1/models.proto (1)
574-576: Markvalue_descriptionas output-only.The comment indicates it’s populated from
InputHintOption.description, so clients shouldn’t set it.♻️ Suggested annotation
// value_description is the human-readable display description for the value // Populated from InputHintOption.description when the trait has input_options configured - string value_description = 8; + string value_description = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
Summary
Add
InputHintOptionmessage andinput_optionsfield toPreferenceTraitfor user-friendly option display.Changes
Usage
When
input_optionsis provided, it takes precedence overinput_hints. This allows:Example:
Summary by CodeRabbit