Skip to content

feat(search-attributes): add attribute list as default behaviour - #1913

Open
nikkikapadia wants to merge 9 commits into
mainfrom
nikki/search-attributes/list-attr-table
Open

nikkikapadia wants to merge 9 commits into
mainfrom
nikki/search-attributes/list-attr-table

Conversation

@nikkikapadia

Copy link
Copy Markdown
Member

Contributes to EXP-1353

The default behaviour to search-attributes would be a table of attributes to show users who don't pass in a query. I've built out that table response. For all cases right now it will return an explanation message and then just a list of attributes. My next pr will be implementing the querying and narrowing down attributes.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 9, 2026 9:01pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

EXP-1353

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@nikkikapadia
nikkikapadia marked this pull request as ready for review November 5, 2026 17:21
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 5, 2026

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The list path looks solid overall. Requiring a dataset, putting the recommended fields first, and adding the "Showing N of M" note all make sense, and the bot feedback (the provider warning on the no-query path, limit/description drift, the double period) looks addressed. Two things before this lands:

  • In format.ts, describeCell flattens and truncates brief but adds examples raw. Some sentry-conventions examples have embedded newlines. exception.stacktrace, which is common on logs and spans, has one, and a newline in a cell ends the markdown row early and breaks the table. Others are long JSON blobs: aws.dynamodb.consumed_capacity is ~500 chars and gen_ai.tool.definitions ~355, and the 255-char cap doesn't apply to them. Flatten the examples too, and cap the examples (or the whole cell) the same way you cap brief. While you're there, examples are dropped when an attribute has no brief, but the hint asks the model to show examples, so it's probably worth emitting them on their own in that case.
  • The "lists attributes with a note when the AI provider fails" test never reaches generateText, so the rejected mock is never used and the test passes whether or not provider failure is handled. I'd make it an it.todo (or drop it) until search lands, along with the scaffolding that only it would need: mockAgentResponse, the @ai-sdk/openai mock, and the unused Tag / withProviderFallback imports in search.ts. As written, it reads like failure handling is covered when it isn't.

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great to me, as a non-toolkit-y person!

import type { Tag, TraceItemAttribute } from "../../../api-client";
import { UserInputError } from "../../../errors";
import { hasAgentProvider } from "../../../internal/agents/provider-factory";
import { withProviderFallback } from "../../../internal/agents/provider-fallback";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
import { withProviderFallback } from "../../../internal/agents/provider-fallback";

Non-blocking nit: some unused code. I'm surprised this repo doesn't lint for it yet... I'll send a PR.

const lines: string[] = [];

if (importantInfo) {
importantInfo.map((info) => lines.push(info));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Refactor] Nit: .map conveys mapping info. Using it instead of .forEach like this is a little odd. https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-builtin-method-return.md

...but also, this can be a little cleaner:

Suggested change
importantInfo.map((info) => lines.push(info));
lines.push(...importantInfo);

const labels = DATASET_LABELS[dataset];
const lines: string[] = [];

if (importantInfo) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Refactor] importantInfo is always defined, since it defaults to []. I'll send a PR for the missing lint rules that would catch things like this. https://typescript-eslint.io/rules/no-unnecessary-condition & co

Suggested change
if (importantInfo) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Style] A bunch of functions in this file manually craft strings from lines. In the past I've enjoyed using a generator pattern for that to make it a bit easier to write. Totally not a request for changes, just a "hey you might like this or might not": e21adfc8 -> nikki/search-attributes/list-attr-table...josh/search-attributes-format-generator. Enjoy 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oooo i def like this, I'm gonna do this in a following PR once i have the full tool done 😌 Thanks Josh!

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3b2e096. Configure here.

{ statsPeriod: period },
{ context: true },
);
const rows = Object.values(attributes) as TraceItemAttribute[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same-name attribute types get collapsed

Medium Severity

fetchCustomAttributes stores attributes in a map keyed only by name, so Object.values keeps a single row when the attributes API returns the same key with more than one type. The table then shows one type and omits the other, so callers can miss a valid typed attribute.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3b2e096. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we don't really have this issue because custom attributes would be defined like tags[attribute,string] as the tag. The sentry defined ones wouldn't have duplicate keys like this suggests so we can ignore this

This branch was successfully deployed

2 active deployments
Preview — 3b2e0963 Deployed Nov 9, 2026 by vercel[bot]
Actions — 3b2e0963 Deployed Nov 9, 2026 by nikkikapadia via eval #1751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants