Skip to content

Comments

fix missing ToolRubric import#741

Closed
ADharaUTEXAS123007 wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
ADharaUTEXAS123007:fix/missing_tool_rubric
Closed

fix missing ToolRubric import#741
ADharaUTEXAS123007 wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
ADharaUTEXAS123007:fix/missing_tool_rubric

Conversation

@ADharaUTEXAS123007
Copy link

@ADharaUTEXAS123007 ADharaUTEXAS123007 commented Jan 17, 2026

Description

When I ran "wiki-search" example, it gave an error saying "verifiers has no attribute ToolRubric".
So, I created file verifiers/verifiers/rubrics/tool_rubric.py with ToolRubric class
Added the import .rubrics.tool_rubric import ToolRubric to init.py

Type of Change

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • [ x] All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • [ x] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas
  • [ x] I have made corresponding changes to the documentation
  • [ x] My changes generate no new warnings
  • [ x] Any dependent changes have been merged and published

Additional Notes


Note

Adds a rubric to evaluate tool usage and exposes it as part of the public API.

  • New ToolRubric counts total tool calls and per-tool calls from assistant messages; initializes reward funcs dynamically from provided tools
  • Exports ToolRubric in verifiers/__init__.py (runtime exports and TYPE_CHECKING) to fix verifiers has no attribute ToolRubric

Written by Cursor Bugbot for commit 284335b. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


ARNAB DHARA seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

tool_call.function, "name"
):
if tool_call.function.name == tool_name:
count += 1
Copy link

Choose a reason for hiding this comment

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

Per-tool counter uses attribute access on dictionary

High Severity

The get_tool_call_count_func method uses attribute access (hasattr(tool_call, "function") and tool_call.function.name) on tool_call items, but completion messages passed to rubric functions are dictionaries, not OpenAI response objects. Dictionary items don't have a function attribute, so hasattr returns False and per-tool counts are always 0. The existing ToolMonitorRubric in tool_env.py correctly uses dictionary access: tool_call.get("function", {}).get("name").

Fix in Cursor Fix in Web

@mikasenghaas
Copy link
Member

ToolRubric could deprecated in #653 and became the more general and internal MonitorToolRubric. check the most recent release notes for some more details on migration but the tldr is that you can just remove any usage of ToolRubric in your env implementation. any ToolEnv will automatically do the reporting that the rubric did before. for wiki-search specifically, the implementation on current main and the env hub should be up-to-date, maybe refresh your venv?

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.

3 participants