-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add option to control tool detail card collapsed/expanded state #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Adds support for controlling whether tool detail cards (SQL query and results) are shown expanded or collapsed by default. **R package:** - Option: `querychat.tool_details` - Environment variable: `QUERYCHAT_TOOL_DETAILS` **Python package:** - Environment variable: `QUERYCHAT_TOOL_DETAILS` **Valid values:** - `"expanded"` - Tool cards are always shown expanded - `"collapsed"` - Tool cards are always shown collapsed - `"default"` - Uses tool-specific behavior (some expanded, some collapsed based on tool type) **Usage:** ```r # Set for the session options(querychat.tool_details = "collapsed") # Or set via environment variable in .Renviron QUERYCHAT_TOOL_DETAILS=collapsed ``` The option takes precedence over the environment variable in R. Closes #120
Remove special handling for error states. The tool details setting now applies uniformly regardless of whether an error occurred. This simplifies the implementation and gives users full control over the display state in all cases.
Rename function in both R and Python packages for better clarity. The new name more directly describes what the function returns.
gadenbuie
commented
Dec 3, 2025
gadenbuie
commented
Dec 3, 2025
gadenbuie
commented
Dec 3, 2025
- R: Move querychat_tool_details_option() to querychat_tools.R adjacent to querychat_tool_starts_open() - R: Move validation logic into querychat_tool_details_option() - Python: Move validation logic into get_tool_details_setting() - Simplify querychat_tool_starts_open() in both packages to just apply validated settings Addresses review comments in PR #137
Remove self-explanatory comments that don't add value beyond what the code clearly expresses.
gadenbuie
commented
Dec 3, 2025
gadenbuie
commented
Dec 3, 2025
cpsievert
reviewed
Dec 3, 2025
cpsievert
reviewed
Dec 3, 2025
gadenbuie
commented
Dec 3, 2025
Co-authored-by: Carson Sievert <[email protected]>
gadenbuie
added a commit
that referenced
this pull request
Dec 3, 2025
Add entries to R NEWS.md and Python CHANGELOG.md documenting the new querychat.tool_details option and QUERYCHAT_TOOL_DETAILS environment variable introduced in PR #137.
Add entries to R NEWS.md and Python CHANGELOG.md documenting the new querychat.tool_details option and QUERYCHAT_TOOL_DETAILS environment variable introduced in PR #137.
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.
Closes #120
Summary
Adds support for controlling whether tool detail cards (SQL query and results) are shown expanded or collapsed by default through an R option and environment variable.
Changes
R Package
querychat.tool_detailsoption andQUERYCHAT_TOOL_DETAILSenvironment variablequerychat_tool_details_option()helper function inpkg-r/R/utils-ellmer.Rquerychat_tool_starts_open()function inpkg-r/R/querychat_tools.Rquerychat_tool_result()to use the new functionpkg-r/tests/testthat/test-querychat_tools.RPython Package
QUERYCHAT_TOOL_DETAILSenvironment variable supportget_tool_details_setting()andquerychat_tool_starts_open()functions inpkg-py/src/querychat/_utils.pytool_update_dashboard,tool_reset_dashboard,tool_query) to respect the settingpkg-py/tests/test_tools.pyAPI
Valid values:
"expanded"- Tool cards are always shown expanded"collapsed"- Tool cards are always shown collapsed"default"- Uses tool-specific behavior (query/update expanded, reset collapsed)When not set, behavior defaults to tool-specific (equivalent to
"default").Usage (R):
Usage (Python):
Implementation Notes
The setting is applied uniformly to all tool result cards regardless of whether the operation succeeded or failed, giving users complete control over the display state.