Skip to content

feat: add interactive menu for single select elicitations - #10327

Merged
DOsinga merged 5 commits into
aaif-goose:mainfrom
panyamkeerthana:add-interactive-menu-select
Aug 4, 2026
Merged

feat: add interactive menu for single select elicitations#10327
DOsinga merged 5 commits into
aaif-goose:mainfrom
panyamkeerthana:add-interactive-menu-select

Conversation

@panyamkeerthana

@panyamkeerthana panyamkeerthana commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds support for single property schemas with oneOf/enum options, rendering them as an interactive menu using cliclack::select. Users can navigate options with arrow keys instead of manual input.
Supersedes: #9763

  • Shows interactive menu using cliclack::select for single-property schemas
  • Users navigate with arrow keys instead of typing numbers
  • Supports both oneOf (with const) and enum schemas

Addresses all feedback from bot on #9763:

  • Default value handling extracting default from schema and sets it as initial value
  • Optional field handling checks required array to determine if field is optional and accepts elicitation w empty data
  • oneOf const checking only shows menu when all oneOf branches have const values

Adds support for single property schemas with oneOf/enum options,
rendering them as an interactive menu using cliclack::select.
Users can navigate options with arrow keys instead of manual input.

Signed-off-by: Keerthana Panyam <panyam.k@northeastern.edu>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: f722e9992a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/elicitation.rs Outdated
@panyamkeerthana
panyamkeerthana force-pushed the add-interactive-menu-select branch from f722e99 to 1f4f962 Compare July 8, 2026 17:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 1f4f962c99

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +81 to +84
data.insert(
field_name.clone(),
Value::String(selected_value.to_string()),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow optional single-select fields to be skipped

For a schema with exactly one enum/oneOf property that is omitted from required and has no default, this branch still only returns after inserting the selected option, and it returns before the later required handling can distinguish optional fields; that is the fresh evidence that the optional single-select case remains affected. The previous text prompt let an empty answer omit optional fields, but the new menu has no skip choice, so tools receive a value the user did not intend instead of an accepted {} response.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added Skip for optional fields with no default that returns Accept with empty data when Skip is selected

@panyamkeerthana
panyamkeerthana force-pushed the add-interactive-menu-select branch from 1f4f962 to c176104 Compare July 8, 2026 20:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: c1761049ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/elicitation.rs Outdated
@panyamkeerthana
panyamkeerthana force-pushed the add-interactive-menu-select branch from c176104 to f71d314 Compare July 8, 2026 21:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: f71d314908

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +93 to +97
if selected_value.is_empty() {
return Ok(ElicitationInput {
action: ElicitationAction::Accept,
user_data: HashMap::new(),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not overload empty selections as Skip

When a single-select schema legitimately includes "" as an enum value or oneOf const, this check treats selecting that value as the synthetic Skip action. For required fields no Skip option is added, but choosing the valid empty-string option still returns Accept with {} and bypasses the later required-field validation; for optional fields it makes the empty-string value impossible to submit. Use a distinct sentinel/typed selection for Skip instead of using the empty string itself.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, now uses sentinel \x00__SKIP__ instead of empty string for Skip, so real empty values work correctly.

- Extracts default from schema and finds its position in options
   - Sets initial_value to highlight correct option
   - Pressing enter selects schema default instead of first item

- oneOf const checking
   - Counts total oneOf branches vs const only branches
   - Only shows menu when all branches have const values
   - Falls back to text input for mixed schemas

- Optional field handling
   - Prepends "Skip" option for optional fields with no default
   - Empty selection returns Accept with no data
   - Ctrl+C always returns Cancel

Signed-off-by: Keerthana Panyam <panyam.k@northeastern.edu>
@panyamkeerthana
panyamkeerthana force-pushed the add-interactive-menu-select branch from f71d314 to a2489c0 Compare July 8, 2026 21:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: a2489c077c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +75 to +80
// Find option index that matches the default
let initial_index = if let Some(default) = default_value {
options.iter().position(|(value, _)| value == default)
} else {
None
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Default optional single-selects to Skip

For a schema with one optional enum/oneOf field and no default, the previous text prompt let users press Enter to omit the field, but this menu appends Skip without making it the initial selection; because initial_index is only set from default_value, a bare Enter now submits the first real option instead of {}. Even with the new Skip item, preserve the no-default optional behavior by initially highlighting Skip.

Useful? React with 👍 / 👎.

@panyamkeerthana panyamkeerthana Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Starting at the first real option (not Skip) is correct because it prevents accidental skips, users must consciously arrow down to Skip, not accidentally press Enter too fast. Skip is clearly labeled at the bottom. The small extra effort I feel is worth the safety gain. Let me know what you think 😄

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: d3193c4c56

ℹ️ 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".

Comment thread crates/goose-cli/src/session/elicitation.rs Outdated
Comment thread crates/goose-cli/src/session/elicitation.rs Outdated
@DOsinga

DOsinga commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Sorry this took so long. I tried to clean up the implementation and pushed a follow-up commit, but Codex still isn't happy with part of it. Could you have a look at the latest review feedback?

@DOsinga

DOsinga commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Sorry this took so long. I tried to clean up the implementation and pushed a follow-up, but Codex still isn't happy with it. Could you have another look at the remaining feedback when you get a chance?

@DOsinga DOsinga removed this from Goose Issues Jul 31, 2026
- Also check stderr is a terminal since cliclack renders via
  Term::stderr(); prevents failure when stderr is redirected
- Include field description in selector prompt to match the
  text input path
@panyamkeerthana

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and the cleanup @DOsinga! Just pushed a fix addressing the two remaining comments. Let me know if anything else needs attention! 😁

@DOsinga
DOsinga added this pull request to the merge queue Aug 4, 2026
Merged via the queue into aaif-goose:main with commit 1366eef Aug 4, 2026
25 checks passed
alexhancock added a commit that referenced this pull request Aug 4, 2026
* origin/main: (58 commits)
  Handle MCP tool list change notifications
  fix: restore final_output_tool when agent is recreated after LRU eviction (#10793)
  feat(ui): bring back make sidebar resizable with drag handle and persisted width (#10795)
  docs: document auto-injected GOOSE_SHELL flags (#10759)
  feat: surface output-token-limit info (#10831)
  fix(desktop): avoid O(n²) cloning during session load (#10665)
  feat: add interactive menu for single select elicitations (#10327)
  fix(acp): prefix child stderr log target so it passes the default goose=info filter (#10901)
  chore (codex-acp): migrate to @agentclientprotocol/codex-acp (#10923)
  style: add dark mode inline code styling for message bubbles (#10861)
  docs: clarify macOS sandbox feature was removed in post-v1.25.0 cleanup (#10900)
  fall back to static model list only for non-models payloads (#10189)
  Remove CLI project support (#10838)
  fix(anthropic): add claude-sonnet-5 and claude-fable-5 to known models list (#10865)
  fix: stdio extensions silently skipped when name missing or env: used in config (#10773)
  feat(desktop): show session metadata on sidebar chat hover (#10663)
  fix(serve): start scheduler at startup instead of first ACP connection (#10766)
  fix: respect disabled builtin extensions (developer) at session start (#10223)
  fix: parse PyPI requirements for OSV checks (#10510)
  fix(telegram): contain voice file extensions (#10456)
  ...

# Conflicts:
#	Cargo.lock
#	crates/goose/src/agents/extension_manager.rs
#	crates/goose/tests/mcp_replays/npx-y@modelcontextprotocol_server-everything@2026.1.14
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