rust(feat): default explore links to a single source type - #762
Merged
Conversation
Agents building an Explore link were passing both `assets` and `runs` on their own, opening the view on two sources when the user asked about one. A run is already scoped to its asset, so the asset only widens the selection. MCP `explore_url` now rejects `assets` and `runs` together with INVALID_PARAMS unless the new `include_assets_and_runs` flag is set, and its description and the installed skill tell agents to send one source type. `sift-cli import` links to the run it imported into, falling back to the asset only when there is no run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gw582tAF2wdN5if7FxLfT3
evan-sift
marked this pull request as ready for review
August 26, 2026 18:59
lineville
reviewed
Aug 26, 2026
lineville
reviewed
Aug 26, 2026
lineville
requested changes
Aug 26, 2026
lineville
left a comment
Contributor
There was a problem hiding this comment.
Looking good! Just one potential issue with run name collisions within the same org
lineville
previously approved these changes
Aug 27, 2026
lineville
left a comment
Contributor
There was a problem hiding this comment.
Looks like there's a conflict now, but other than that lgtm!
lineville
approved these changes
Aug 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.
Motivation
ENG-13868. Programmatic Explore links were coming out with both
assetsandrunsset even when the user asked about one of them.explore_urlappended each parameter independently, so an agent that had resolved a run and its parent asset had no reason not to send both, andsift-cli importalways emittedassets=<asset>and then appendedruns=<run>.A run is already scoped to its asset, so naming both opens the view on two sources: the run, plus the asset over its full history. Mixed run/asset selections are valid in Explore and stay supported, but they should be what the user asked for rather than the default an agent falls into.
Changes
ExploreUrlRequestandExploreUrlParamsgaininclude_assets_and_runs(defaults to false).assetsandrunstogether are rejected withINVALID_PARAMSunlessinclude_assets_and_runsis true. The error names the opt-in and tells the caller to passrunsalone when the request names a run,assetsalone otherwise. Empty vectors still count as unset, soassets: []alongsiderunsis not a conflict, and the flag is a no-op when only one source type is set.Errorssection, and tells agents not to add the asset alongside a run to be thorough.references/explore-links.mdin the installed skill carries the same rule, so agents get it before the call rather than from an error.sift-cli importlinks to the run it imported into and falls back to the asset only when there is no run (util/explore_url.rs).sift-cli get assetis unaffected; it already passed no run.sift-cliCHANGELOG entry under Unreleased.Tests
assets_and_runs_together_are_rejected_by_default:INVALID_PARAMS, and the message namesinclude_assets_and_runs.assets_and_runs_together_are_allowed_when_requested: both parameters survive when the opt-in is set.an_empty_asset_list_does_not_conflict_with_runsandthe_opt_in_is_ignored_for_a_single_source_type: the guard does not fire on a single source type.handler_rejects_assets_and_runs_without_the_opt_inandhandler_keeps_both_source_types_when_the_opt_in_is_setcover the param plumbing.import_target_uses_the_configured_app_uri,run_id_takes_priority_over_run_name(now asserting the whole URL), and a newan_import_without_a_run_links_to_the_asset.cargo test -p sift_mcppasses (284 tests).cargo test -p sift_clipasses exceptcmd::agent::tests::failed_later_client_install_rolls_back_earlier_clients_and_skills, which fails the same way on a clean checkout of this base commit in this environment.cargo build -p sift_mcp --no-default-features,cargo fmt --check, andcargo clippy --all-targets --all-featuresare clean for the touched files; the two remaining clippy warnings are pre-existing in untouched files.https://claude.ai/code/session_01Gw582tAF2wdN5if7FxLfT3
Generated by Claude Code