feat(agent-obs): close MCP parity gaps for projects, datasets, and span search - #681
Merged
platinummonkey merged 1 commit intoJul 27, 2026
Conversation
platinummonkey
previously approved these changes
Jul 27, 2026
… search Brings `pup llm-obs` closer to the LLM Observability MCP toolset in dd-source (domains/ml-observability/shared/libs/mcp/tools). Four read/write gaps closed; all four reuse endpoints pup already talks to, so no new API surface is added. - projects list: add --filter-id/--filter-name/--limit/--cursor, mapping to the public v2 filter[id]/filter[name]/page[limit]/page[cursor] params. Closes both list_llmobs_projects pagination and get_llmobs_project name resolution — the MCP tool is itself a zero-or-one-match filter (src/commands/llm_obs.rs:36) - datasets list: same four flags, closing list_llmobs_datasets (src/commands/llm_obs.rs:126) - datasets records-add: new command wrapping the records-add endpoint, closing add_llmobs_dataset_records. Keeps the endpoint's two-step safety — previews by default, writes only with --confirm (src/commands/llm_obs.rs:265) - spans search: add --tags (comma-separated key:value, sent as the JSON object map the endpoint expects) and --apm-trace-id. parse_tag_filters splits on the first colon only, so values like "version:1.2:3" survive (src/commands/llm_obs.rs:646) - read-only guard: classify "-add" suffixed leaves as writes. The guard is name-based and no existing pattern matched "records-add", so without this it would bypass --read-only and be advertised as read-only in the agent schema (src/main.rs:10786) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gsvigruha
force-pushed
the
gergely.svigruha/agent-obs-pup-cli-gaps
branch
from
July 27, 2026 17:01
f501e90 to
d3607d3
Compare
platinummonkey
approved these changes
Jul 27, 2026
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
Closes four LLM Observability parity gaps between
pup llm-obsand the LLM Obs MCP toolset in dd-source (domains/ml-observability/shared/libs/mcp/tools). All four reuse endpoints pup already talks to, so no new API surface is introduced.Found by auditing pup's LLM Obs surface against the 40 tools the MCP registers; pup covered 25 of them.
Changes
llm-obs projects list— filters + pagination (src/commands/llm_obs.rs:36)New
--filter-id,--filter-name,--limit,--cursor, mapping to the public v2filter[id]/filter[name]/page[limit]/page[cursor]params. Closes both project gaps:list_llmobs_projectspagination andget_llmobs_projectname→UUID resolution — the MCP tool is itself a zero-or-one-match filter, so--filter-nameis the same operation. This matters for agents: every dataset/record command needs a project UUID, and there was previously no name resolution step.llm-obs datasets list— filters + pagination (src/commands/llm_obs.rs:126)Same four flags, closing
list_llmobs_datasets.llm-obs datasets records-add— new command (src/commands/llm_obs.rs:265)Wraps
POST /api/unstable/llm-obs-mcp/v1/dataset/records-add, closingadd_llmobs_dataset_records. Preserves the endpoint's two-step safety: previews by default, writes only with--confirm.--create-new-version <bool>controls the version bump. Records come from--file.llm-obs spans search—--tagsand--apm-trace-id(src/commands/llm_obs.rs:646)--tagstakes comma-separatedkey:valueand converts to the JSON object map the endpoint expects.parse_tag_filterssplits on the first colon only, so values likeversion:1.2:3survive intact.src/main.rs:10786)Added
name.ends_with("-add")tois_write_command_name. The guard is name-based and no existing pattern matchedrecords-add, so without this it would bypass--read-onlyand be advertised as read-only in the agent schema.docs/COMMANDS.md:69) — addedrecords-addto the llm-obs command inventory.Testing
13 new tests in
src/commands/llm_obs.rsandsrc/main.rs:PartialJsonbody matchers for the new span filters and for bothrecords-addmodes (preview vs confirmed, includingcreate_new_version: false)--tags(envprod,:prod,env:), non-array / empty-array / missing records file,records-add400parse_tag_filterscovering the colon-in-value caserecords-addis a write whilerecordsandrecords-fullstay read-onlyAlso smoke-tested against the live API (
datadoghq.com):--tags=env:prod,ml_app:docstorereturns matching spans, while a bogus tag returns 0 results — confirming the filter is applied server-side rather than silently ignored--apm-trace-idreturns only that trace's spansrecords-addpreview returned a realconfirmation_prompt, and--create-new-version=falsecorrectly flippedwill_bump_versioncargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test llm_obs(99/99) all pass.Two notes for reviewers:
records-addinsert branch (--confirm) is covered by unit tests only — I did not write to a real dataset, since the one available belonged to another person's project.cargo test(full suite) shows a handful of failures intraces/dbm/monitors/security. These are pre-existing flakes unrelated to this PR: they reproduce on an unmodified tree and all pass in isolation (env-var-lock contention under parallelism).Not included
launch_llmobs_experimentwas deliberately left out. The other experiment-side gap,create_llmobs_experiment, is a pure record-create with no inference and is already covered byllm-obs experiments create.Still open from the audit, for follow-up: Topic Discovery / Patterns (7 tools), Agent Insights (4 tools),
get_llmobs_model_pricing,get_llmobs_bits_session, and the 9 LLM-Obs workflow skills thatpup skillscan't reach (it targets/api/v2/onboarding/skills, a different backend).🤖 Generated with Claude Code