Skip to content

PR #62 follow-up 17: resolve_dataset prefers exact-case selection; correct not_found message - #73

Merged
VibeSWE merged 4 commits into
mainfrom
fix/pr62-17-resolve-dataset-exact-case
Oct 24, 2026
Merged

VibeSWE merged 4 commits into
mainfrom
fix/pr62-17-resolve-dataset-exact-case

Conversation

@VibeSWE

@VibeSWE VibeSWE commented Oct 24, 2026 •

Copy link
Copy Markdown

Stacked on #62 (upstream/tool-catalog-1831). Retarget to main after #62 merges.

Problem

resolve_dataset_candidates (in code inherited from upstream parseablehq#1831) validated selectedDataset/contextDataset by taking the first case-insensitive name match. Dataset names are case-sensitive, so with both Logs and logs visible, selectedDataset: "logs" resolved to Logs, and the agent then queried the wrong dataset.

Separately, when every visible dataset was filtered out (for example by telemetryType), the result was status: "not_found" but its message said "Dataset resolution is ambiguous…".

Fix

  • Prefer an exact, case-sensitive name match. Fall back to a case-insensitive match only when exactly one dataset matches. If several datasets differ only in case, return status: "ambiguous" with those datasets as candidates.
  • When there are no candidates but some datasets are visible, the message is now "No caller-visible datasets match requested telemetry type X." (or "…match the request." when no type was given).
  • docs/tool-api.md: the resolve_dataset paragraph now describes the case rules and when not_found is returned.

Tests

  • shared_dataset_resolution_prefers_exact_case_selection: with Logs/logs visible, both names resolve exactly; a unique case-insensitive fallback (traces → Traces) still resolves; LOGS returns ambiguous with both candidates.
  • shared_dataset_resolution_reports_no_matching_candidates: when nothing matches the telemetry type, the result is not_found and the message is not "ambiguous".
  • Both tests fail against the code before this fix (the first resolves Logs instead of logs, the second gets the "ambiguous" message). cargo test --lib tool_: 40 passed. cargo clippy --all-targets: no warnings in touched files.

Upstream fidelity

This is a small, local change to an upstream function: the selection block and the final message expression. It doesn't change the rest of the function's structure, so merge conflicts with upstream should stay small. We plan to propose the same change upstream.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

VibeSWE and others added 3 commits October 24, 2026 14:30
…nd message

Dataset names are case-sensitive, but selectedDataset/contextDataset took
the first case-insensitive match, so with both `Logs` and `logs` visible a
request for `logs` could resolve to `Logs`. Prefer an exact match, fall
back to a case-insensitive match only when it is unique, and return
`ambiguous` with the case variants as candidates otherwise.

When every dataset is filtered out the status was `not_found` but the
message claimed the resolution was ambiguous; report that no visible
dataset matches instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fix/pr62-17-resolve-dataset-exact-case

# Conflicts:
#	docs/tool-api.md
@VibeSWE
VibeSWE changed the base branch from upstream/tool-catalog-1831 to main October 24, 2026 21:53
@VibeSWE
VibeSWE merged commit 37f0997 into main Oct 24, 2026
9 checks passed
@VibeSWE
VibeSWE deleted the fix/pr62-17-resolve-dataset-exact-case branch October 24, 2026 22:17
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