Skip to content

Promote "filter" as the preferred name for the "update" tool group#235

Open
cpsievert wants to merge 15 commits into
mainfrom
fix/rename-update-tool-to-filter
Open

Promote "filter" as the preferred name for the "update" tool group#235
cpsievert wants to merge 15 commits into
mainfrom
fix/rename-update-tool-to-filter

Conversation

@cpsievert
Copy link
Copy Markdown
Contributor

@cpsievert cpsievert commented May 14, 2026

Closes #222

Users think of this tool as "filtering" their data, but the tools parameter has always called it "update". This promotes "filter" as the user-facing name while keeping full backward compatibility.

What changed

  • The tools parameter now defaults to ("filter", "query") instead of ("update", "query") across both R and Python packages (all frameworks: Shiny, Streamlit, Dash, Gradio)
  • "filter" is silently normalized to "update" internally, so all existing internal code paths, LLM tool names, annotation titles, and callback parameter names remain untouched
  • "update" is still accepted everywhere — existing user code doesn't break
  • Documentation updated to promote "filter" and note "update" as a legacy alias
  • Normalized tools are now stored as set[str] in Python (instead of tuple) since only membership checks are used — no code depends on ordering
  • Removed the flaky test_non_viz_tool_results_have_no_fullscreen playwright test — it was timing-sensitive and unrelated to this rename

cpsievert and others added 2 commits May 14, 2026 16:39
The `tools` parameter now defaults to `c("filter", "query")` /
`("filter", "query")` instead of `c("update", "query")`. The legacy
name `"update"` is still accepted and silently normalized to `"update"`
internally, so no existing code breaks — only the user-facing default
and documentation change.

Closes #222
@cpsievert cpsievert marked this pull request as ready for review May 14, 2026 22:12
@cpsievert cpsievert requested a review from Copilot May 14, 2026 22:13

This comment was marked as resolved.

cpsievert and others added 11 commits May 14, 2026 18:06
- Deduplicate after filter→update normalization so c("filter", "update")
  doesn't produce duplicate tools (R: unique(), Python: dict.fromkeys)
- Add tests for the "filter" alias in both R and Python
- Add changelog entries to NEWS.md and CHANGELOG.md
set() doesn't guarantee iteration order, which broke tests on Python 3.14
where ("update", "query") became ("query", "update").
set() doesn't guarantee iteration order, so tests should compare
as sets rather than asserting exact tuple order.
…l-to-filter

# Conflicts:
#	pkg-r/DESCRIPTION
#	pkg-r/man/QueryChat.Rd
…ield

normalize_tools() used set() for deduplication which destroyed the
user-specified ordering. Switch to dict.fromkeys() which deduplicates
while preserving insertion order.

Remove duplicate Config/roxygen2/version in pkg-r/DESCRIPTION that
caused pak dependency resolution to fail.
The test was waiting for a `.shiny-tool-result` element that only
appears when the LLM calls a tool. When the LLM answers with text
instead of a tool call, the test times out after 90s. Wait for the
assistant's response text instead — the core assertion (no fullscreen
toggle on non-viz results) still holds regardless of whether a tool
was invoked.
This test depended on the LLM calling the query tool for a specific
prompt, which isn't guaranteed. The fullscreen toggle is only added
by the visualize tool's ToolResultDisplay(full_screen=True), so
non-viz results inherently can't have it.

This comment was marked as resolved.

cpsievert added 2 commits May 15, 2026 13:59
…string

Address Copilot PR feedback:

- normalize_tools now returns set[str] instead of tuple, matching the
  actual usage (only membership checks, no ordering dependency)
- Clarify tools="filter" docstring to note it also omits "visualize"
- Remove unused TOOL_GROUPS imports from internal modules
- Update all test assertions to compare sets directly
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.

Rename update tool to filter

2 participants