Skip to content

fix(evaluator): fix tag dropdown for evaluator block#807

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/evaluator
Jul 28, 2025
Merged

fix(evaluator): fix tag dropdown for evaluator block#807
waleedlatif1 merged 2 commits into
stagingfrom
fix/evaluator

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Description

fix tag dropdown for evaluator block, was showing generic tag dropdown values for agent block

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested manually

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Screenshot 2025-07-28 at 10 53 49 AM

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 6:10pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 28, 2025 6:10pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes a bug in the tag dropdown component where evaluator blocks were displaying generic agent block tag dropdown values instead of their specific metric-based outputs. The change adds special handling for evaluator blocks in two locations within the TagDropdown component.

The evaluator block is unique in that it has dynamically generated outputs based on user-defined metrics (like 'accuracy', 'relevance', 'clarity') rather than static predefined outputs. The existing tag dropdown logic was falling back to generic block outputs or response format schema, which didn't account for this dynamic behavior.

The fix implements identical logic in two places: one for handling active source blocks (drag & drop scenarios) and another for accessible blocks (general workflow context). Both implementations check if a block is of type 'evaluator', retrieve the metrics configuration from the subblock store using useSubBlockStore.getState().getValue(), and generate appropriate tag suggestions based on the metric names. If no metrics are defined, it falls back to the default block outputs using the existing generateOutputPaths function.

This change integrates well with the existing codebase by leveraging the established patterns for block type checking, subblock store access, and tag generation while maintaining backward compatibility through the fallback mechanism.

Confidence score: 3/5

• This PR appears safe to merge as it's a targeted bug fix with fallback handling, but the code duplication raises maintainability concerns
• The identical code blocks in two locations violate DRY principles and could lead to maintenance issues if future changes are needed
apps/sim/components/ui/tag-dropdown.tsx needs attention for the duplicated logic that should be extracted into a reusable function

1 file reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

Comment thread apps/sim/components/ui/tag-dropdown.tsx
Comment thread apps/sim/components/ui/tag-dropdown.tsx
@vercel vercel Bot temporarily deployed to Preview – docs July 28, 2025 18:02 Inactive
@waleedlatif1 waleedlatif1 merged commit 6f390c0 into staging Jul 28, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/evaluator branch July 28, 2025 18:03
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* fix(evaluator): fix tag dropdown for evaluator block

* lint

---------

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
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.

1 participant