Skip to content

Comments

feat(frontier): add InputHintOption for structured preference options#442

Merged
whoAbhishekSah merged 6 commits intomainfrom
feat/preference-input-options
Feb 16, 2026
Merged

feat(frontier): add InputHintOption for structured preference options#442
whoAbhishekSah merged 6 commits intomainfrom
feat/preference-input-options

Conversation

@whoAbhishekSah
Copy link
Member

@whoAbhishekSah whoAbhishekSah commented Feb 11, 2026

Summary

Add InputHintOption message and input_options field to PreferenceTrait for user-friendly option display.

Changes

// New message
message InputHintOption {
  string name = 1;   // Machine-readable identifier (e.g., "sq_km")
  string title = 2;  // User-friendly display (e.g., "Square Kilometers")
}

// New field in PreferenceTrait
repeated InputHintOption input_options = 28;

Usage

When input_options is provided, it takes precedence over input_hints. This allows:

  • Machine-readable values for storage/validation
  • User-friendly titles for UI display

Example:

input_options:
  - name: sq_km
    title: Square Kilometers
  - name: sq_ft
    title: Square Feet

Summary by CodeRabbit

  • New Features
    • Preference settings now support structured input options with machine-friendly IDs and user-facing descriptions.
    • Preferences can display a description for the selected value (value_description populated from option descriptions).
    • Structured input options take precedence over legacy input hints when provided.

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>
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added a new protobuf message InputHintOption and two fields: PreferenceTrait.input_options (repeated InputHintOption, field 28) and Preference.value_description (string, field 8) populated from InputHintOption.description when input_options is configured.

Changes

Cohort / File(s) Summary
Protobuf model updates
raystack/frontier/v1beta1/models.proto
Added message InputHintOption { string name = 1; string description = 2; }. Added repeated InputHintOption input_options = 28; to PreferenceTrait. Added string value_description = 8; to Preference (populated from InputHintOption.description when configured).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I munched on schema leaves today,
New options hopped in bright array,
Names and notes tucked in their place,
Preferences gained a gentler space,
A tiny hop — the protos play!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding InputHintOption for structured preference options in the frontier protobuf schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/preference-input-options

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@whoAbhishekSah
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
raystack/frontier/v1beta1/models.proto (1)

574-576: Mark value_description as 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];

@whoAbhishekSah whoAbhishekSah merged commit 330c755 into main Feb 16, 2026
3 checks passed
@whoAbhishekSah whoAbhishekSah deleted the feat/preference-input-options branch February 16, 2026 10:26
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.

2 participants