fix(search-events): Preserve structured trace searches#969
Merged
Conversation
d25ace3 to
8600ce5
Compare
Respect caller-provided structured search syntax for explicit trace-item dataset requests and add targeted attribute discovery and validation so agents do not discard valid custom fields. Fixes #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
8600ce5 to
e34c33e
Compare
Append non-replay environment filters to trusted structured trace searches and avoid partial markdown escaping in executed-search output. Type trace item attribute sources using the upstream Sentry API shape instead of forwarding unknown JSON. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Avoid treating URL schemes, time labels, and prose labels as trusted structured Sentry search syntax for trace datasets. Keep valid tags, dotted fields, known fields, and lowercase custom field filters eligible for direct structured execution. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Only accept an agent-repaired structured trace query when the repaired query still contains the original user filters. This lets the agent add constraints without replacing caller-supplied search input. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Use token-aware containment when deciding whether an agent-repaired structured trace query preserved the original user filters. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Tokenize structured query filters without splitting quoted values so repaired trace queries cannot pass preservation checks after changing a quoted filter value. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Add a behavior-level search_events agent eval that starts from a user-style request and asserts explicit Sentry search filters, fields, sort, and time range survive the agent translation. Mock trace item attribute validation for eval runs so future agent calls can validate exact attributes without escaping the local mock server. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Keep the preservation eval focused on output behavior so future exact datasetAttributes validation arguments do not fail the test. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Remove the environment-name sniffing from appendSearchFilter so quoted search values cannot suppress an explicit environment parameter. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Avoid appending the same exact environment filter twice when an agent-repaired structured trace query already contains it. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 89d737b. Configure here.
Pad executed-search inline code when values start or end with backticks so Markdown parsers preserve the literal value. Refs #968 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary of changes from
main:search_eventsfor spans/logs/metrics. Complete explicit requests can execute directly, and partial requests that still invoke the embedded agent now keep the caller-provided query filters, fields, sort, and time range when those inputs are explicit and valid.datasetAttributestool with targeted trace-item attribute lookup, exact attribute validation,attributeTypes, substring/query filtering, and typed attribute-source parsing.Fixes #968