Skip to content

test(assisted_query): add eval for organizationName tag filter on issues dataset#117802

Closed
DominikB2014 wants to merge 1 commit into
masterfrom
eval/issues-organization-name-filter
Closed

test(assisted_query): add eval for organizationName tag filter on issues dataset#117802
DominikB2014 wants to merge 1 commit into
masterfrom
eval/issues-organization-name-filter

Conversation

@DominikB2014

Copy link
Copy Markdown
Contributor

What

Adds a test class to tests/sentry/seer/assisted_query/test_issues_tools.py with four evals targeting the issues dataset tool layer.

Why

User feedback captured in Sentry: "Organization filter not found". The AI search agent was asked to filter issues by an organizationName-style custom tag but couldn't find the filter, so it fell back to embedding the raw org name (mtk_agent_workshop) as free text in the query instead of generating a proper tag filter (organizationName:mtk_agent_workshop).

What's tested

Test Verifies
test_get_issue_filter_keys_includes_organization_name_tag get_issue_filter_keys surfaces organizationName in the tags list when events carry that custom tag
test_get_filter_key_values_returns_organization_name_values get_filter_key_values(attribute_key="organizationName") returns expected values so the agent can build a correct tag filter
test_execute_issues_query_with_organization_name_tag_filter execute_issues_query accepts organizationName:acme_corp and returns matching issues (not an error dict)
test_get_filter_key_values_returns_empty_list_when_tag_absent When no events carry the tag, returns [] (not None) — the signal the agent must use to decide "no values" vs "invalid field"

All four tests exercise the issues dataset path (Dataset.Events + Dataset.IssuePlatform) via real Snuba queries, consistent with the surrounding test_issues_tools.py patterns.


View Session in Sentry

…ues dataset

Regression scenario: when asked to filter issues by an organizationName-style
custom tag, the AI search agent fell back to embedding the raw org name as free
text in the query (e.g., 'mtk_agent_workshop') instead of generating a proper
tag filter ('organizationName:mtk_agent_workshop'). User feedback captured as
'Organization filter not found'.

Adds TestOrganizationNameTagFilter with four evals against the issues dataset
tool layer:
- get_issue_filter_keys surfaces organizationName when events carry that tag
- get_filter_key_values returns the expected values for the tag
- execute_issues_query accepts an organizationName tag filter and returns matches
- get_filter_key_values returns [] (not None) when the tag is absent, giving the
  agent the correct signal to report 'no values' rather than fall back to text

Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
@DominikB2014

Copy link
Copy Markdown
Contributor Author

Closing — wrong file. The eval belongs in getsentry/seer evals/assisted_query/fixtures/examples/issues.json.

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