Skip to content

fix(filters): use eq for --name so run/trace list name filtering works - #174

Open
Palash Shah (Palashio) wants to merge 1 commit into
mainfrom
fix/run-list-name-exact-match
Open

fix(filters): use eq for --name so run/trace list name filtering works#174
Palash Shah (Palashio) wants to merge 1 commit into
mainfrom
fix/run-list-name-exact-match

Conversation

@Palashio

Copy link
Copy Markdown
Contributor

Problem

langsmith run list --name <x> (and trace list --name <x>, which shares the same filter flags) returns HTTP 400 for any value:

querying runs: POST .../api/v1/runs/query: 400 Bad Request
{"detail":"Comparison comparator=<Comparator.SEARCH: 'search'> attribute='name' value='...' multi=False not accepted."}

internal/cmd/filters.go built the clause as search(name, %q), but the backend runs/query validator does not accept the SEARCH comparator on the name attribute — only eq. So the --name filter is completely non-functional. It also contradicts the flag's own help, which documents it as exact match.

Fix

One-line comparator change: emit eq(name, %q) instead of search(name, %q). eq is both what the backend accepts and what the flag already promises. Value interpolation (%q quoting) is unchanged. Updated the two tests that asserted the old search(name, …) output.

Verification

  • go build ./... + go test ./internal/cmd/ pass.
  • Built the binary and ran it against a live project:
    • before: run list --name ChatAnthropicWithOpenAIFallback → HTTP 400
    • after: returns the matching runs, all named exactly ChatAnthropicWithOpenAIFallback (exact match, no 400)

🤖 Generated with Claude Code

The --name flag on `run list` / `trace list` built its filter clause as
`search(name, …)`, but the backend runs/query validator rejects the SEARCH
comparator on the `name` attribute, so every `--name` query returned
HTTP 400 ("Comparison comparator=<Comparator.SEARCH> attribute='name' …
not accepted"). The flag is already documented as an exact-match filter,
so emit `eq(name, …)` instead — which the backend accepts and matches the
documented behavior.

Verified against a live project: `run list --name <name>` now returns the
matching runs (exact-match) instead of a 400.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants