Skip to content

feat: change tool approval message when no parameters are required#596

Open
fmartingr wants to merge 2 commits intomasterfrom
feat/tool-config-empty
Open

feat: change tool approval message when no parameters are required#596
fmartingr wants to merge 2 commits intomasterfrom
feat/tool-config-empty

Conversation

@fmartingr
Copy link
Copy Markdown
Contributor

@fmartingr fmartingr commented Apr 6, 2026

Summary

  • Display "No parameters required" inside the tool call code block instead of an empty JSON object ({}) when a tool call has no arguments
  • Makes it clear the empty state is intentional and the tool is not broken
Screenshot 2026-04-17 at 09 42 25

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Tool parameter display has been improved: tools with no parameters now show a clear, localized message instead of empty braces
    • Fixed parameter display updates to correctly reflect localization preferences
    • Enhanced how tool information is rendered to better communicate when no parameters are required

@fmartingr fmartingr self-assigned this Apr 6, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@fmartingr fmartingr requested review from Copilot and crspeller April 6, 2026 12:43
@fmartingr fmartingr added the 2: Dev Review Requires review by a developer label Apr 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🤖 LLM Evaluation Results

OpenAI

⚠️ Overall: 17/19 tests passed (89.5%)

Provider Total Passed Failed Pass Rate
⚠️ OPENAI 19 17 2 89.5%

❌ Failed Evaluations

Show 2 failures

OPENAI

1. TestReactEval/[openai]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text "heart_eyes_cat", not an actual cat emoji (e.g., 😺/🐱) or a heart/love emoji (e.g., ❤️/😍). Therefore it does not satisfy the rubric.

2. TestThreadsOpenQuestionsFromExportedData/[openai]_open_questions_from_eval_timed_dnd.json

  • Score: 0.00
  • Rubric: does not list any questions that went completely unanswered
  • Reason: The output includes at least one question that is not shown as answered: @harrison asked whether the API/DB should be standardized (e.g., always ms, or auto-detect units by magnitude). The text provides discussion/opinions but no clear resolution or direct answer to that question. Therefore it vi...

Anthropic

⚠️ Overall: 17/19 tests passed (89.5%)

Provider Total Passed Failed Pass Rate
⚠️ ANTHROPIC 19 17 2 89.5%

❌ Failed Evaluations

Show 2 failures

ANTHROPIC

1. TestReactEval/[anthropic]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text "heart_eyes_cat", which is neither an actual cat emoji (e.g., 😺/🐱) nor a heart/love emoji (e.g., ❤️/😍).

2. TestThreadsSummarizeFromExportedData/[anthropic]_thread_summarization_from_eval_timed_dnd.json

  • Score: 0.00
  • Rubric: contains the usernames involved as @mentions if referenced
  • Reason: The output includes all referenced usernames as @mentions: @harrison, @agniva.de-sarker, @jesse.hallam, @alejandro.garcia, and also mentions Yasser (not as an @mention). Since the rubric requires usernames involved to be @mentions if referenced, the presence of "Yasser" without an @mention means ...

This comment was automatically generated by the eval CI pipeline.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Security Review: No Issues Found

This PR makes a purely client-side UI presentation change that controls the default collapsed/expanded state of tool call cards when their arguments are empty. No server-side code, authentication/authorization logic, data access paths, or LLM prompt construction is modified. No security concerns identified.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces UI noise in the tool approval “call” stage by default-collapsing tool cards when their arguments are empty (or null), so tools without configuration don’t take up unnecessary space.

Changes:

  • Add an hasEmptyArguments helper to detect empty/null tool arguments.
  • Update the collapse-default logic so call-stage tools with empty arguments start collapsed unless the user toggles them open.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/src/components/tool_approval_set.tsx Outdated
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 0dc55448-2d9a-4df5-97f3-f58aa6bb2c6f

📥 Commits

Reviewing files that changed from the base of the PR and between c222695 and 555cdf1.

📒 Files selected for processing (1)
  • webapp/src/components/tool_card.tsx

📝 Walkthrough

Walkthrough

Adjusted webapp/src/components/tool_card.tsx so empty plain-object tool.arguments ({}) is treated as “no parameters required” by inserting the localized message key ai.tool_call.no_parameters_required into the fenced json code block; non-empty argument objects remain JSON-formatted. Also added formatMessage to the useMemo dependency list.

Changes

Cohort / File(s) Summary
Tool Card rendering
webapp/src/components/tool_card.tsx
Changed renderedArguments logic to detect an empty plain object ({}) and render the localized message key ai.tool_call.no_parameters_required inside the json code block instead of stringifying {}; retained JSON.stringify behavior for non-empty objects. Also expanded useMemo dependencies to include formatMessage so output updates with the formatter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating the tool approval message to display 'No parameters required' instead of an empty JSON object when a tool has no arguments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tool-config-empty

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

Copy link
Copy Markdown

@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)
webapp/src/components/tool_approval_set.tsx (1)

239-245: Consider treating [] as empty arguments too.

Line 244 excludes arrays, so arguments: [] won’t default-collapse even though it’s effectively empty input. Expanding the helper to include empty arrays would make behavior consistent for all empty JSON argument shapes.

Suggested tweak
 const hasEmptyArguments = (tool: ToolCall) => {
     const args = tool.arguments;
     if (args == null) {
         return true;
     }
-    return typeof args === 'object' && !Array.isArray(args) && Object.keys(args).length === 0;
+    if (Array.isArray(args)) {
+        return args.length === 0;
+    }
+    return typeof args === 'object' && Object.keys(args).length === 0;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webapp/src/components/tool_approval_set.tsx` around lines 239 - 245, The
helper hasEmptyArguments currently treats null and empty plain objects as empty
but explicitly excludes arrays, so ToolCall.arguments: [] isn’t considered
empty; update hasEmptyArguments to return true when arguments is null OR
(Array.isArray(args) && args.length === 0) OR (typeof args === 'object' &&
!Array.isArray(args) && Object.keys(args).length === 0) so empty arrays are
collapsed the same as empty objects; keep the function name hasEmptyArguments
and the ToolCall.arguments references to locate and update the logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@webapp/src/components/tool_approval_set.tsx`:
- Around line 239-245: The helper hasEmptyArguments currently treats null and
empty plain objects as empty but explicitly excludes arrays, so
ToolCall.arguments: [] isn’t considered empty; update hasEmptyArguments to
return true when arguments is null OR (Array.isArray(args) && args.length === 0)
OR (typeof args === 'object' && !Array.isArray(args) && Object.keys(args).length
=== 0) so empty arrays are collapsed the same as empty objects; keep the
function name hasEmptyArguments and the ToolCall.arguments references to locate
and update the logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c892e24e-50e2-4b09-b233-b58b26904f86

📥 Commits

Reviewing files that changed from the base of the PR and between 605e0db and 7a35e4c.

📒 Files selected for processing (1)
  • webapp/src/components/tool_approval_set.tsx

Copy link
Copy Markdown
Collaborator

@nickmisasi nickmisasi left a comment

Choose a reason for hiding this comment

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

Could we enhance the front-end so that rather than {} is just shows something like No arguments provided or something?

I think a lot of people see {} as "the tool is broken" even though it's intended, and this change doesn't fully fix that.

@fmartingr fmartingr requested a review from nickmisasi April 8, 2026 09:02
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@webapp/src/components/tool_card.tsx`:
- Around line 76-80: NoArgumentsLabel currently applies padding-left: 24px which
duplicates the indentation already provided by ToolCallArguments; remove the
padding-left rule from the NoArgumentsLabel styled component so the
empty-arguments label inherits the existing indentation from ToolCallArguments
(locate the NoArgumentsLabel definition and delete or omit the padding-left
property).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ba4612f7-4be5-40aa-833f-9f6edfecc046

📥 Commits

Reviewing files that changed from the base of the PR and between 7a35e4c and e9dedfc.

📒 Files selected for processing (1)
  • webapp/src/components/tool_card.tsx

Comment thread webapp/src/components/tool_card.tsx Outdated
Copy link
Copy Markdown
Collaborator

@nickmisasi nickmisasi left a comment

Choose a reason for hiding this comment

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

LGTM! Not blocking - but perhaps poke Asaad to get some recommended padding-top/bottom numbers

Comment thread webapp/src/components/tool_card.tsx Outdated
@fmartingr fmartingr requested a review from asaadmahmood April 8, 2026 14:30
@crspeller crspeller removed their request for review April 16, 2026 05:42
Display "No parameters required" inside the tool call code block
instead of an empty JSON object ({}), making it clear the empty
state is intentional and the tool is not broken.
@fmartingr fmartingr force-pushed the feat/tool-config-empty branch from e9dedfc to c222695 Compare April 17, 2026 07:46
@fmartingr fmartingr changed the title feat: collapse tool calls with empty arguments by default feat: change tool approval message when no parameters are required Apr 17, 2026
@fmartingr fmartingr requested a review from nickmisasi April 17, 2026 07:47
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@webapp/src/components/tool_card.tsx`:
- Line 392: The string literal "No parameters required" in the assignment to
content (const content = isEmpty ? 'No parameters required' :
JSON.stringify(argumentsValue, null, 2)) must be localized; replace the
hardcoded text with a react-intl message (e.g. useIntl().formatMessage or
<FormattedMessage>) and reference a new message id like "toolCard.noParameters"
with a sensible defaultMessage; update the component to import and use useIntl
(or wrap with <FormattedMessage>) and add the new message key to your
messages/locale files so the fallback/default text remains "No parameters
required".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: db7050fa-7398-4da8-8655-47f85938737d

📥 Commits

Reviewing files that changed from the base of the PR and between e9dedfc and c222695.

📒 Files selected for processing (1)
  • webapp/src/components/tool_card.tsx

Comment thread webapp/src/components/tool_card.tsx Outdated
Route the empty-arguments label through react-intl so it can be
translated, matching the project's i18n conventions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a developer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants