{"record":{"id":"4a6e98e5184d778a","repo":"langchain-ai/deepagents","slug":"remote-source-must-not-contain-a-query-string-or-f","errorCode":null,"errorMessage":"remote source must not contain a query string or fragment","messagePattern":"remote source must not contain a query string or fragment","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/configuration/types.py","lineNumber":83,"sourceCode":"        msg = \"remote source must not contain whitespace or control characters\"\n        raise ValueError(msg)\n    try:\n        parsed = urlsplit(source)\n    except ValueError as exc:\n        msg = \"remote source is not a valid URL\"\n        raise ValueError(msg) from exc\n    if not source.isascii():\n        msg = \"remote source must contain only ASCII URI characters\"\n        raise ValueError(msg)\n    if parsed.scheme.lower() != \"https\" or not parsed.hostname:\n        msg = \"remote source must be an absolute HTTPS URL\"\n        raise ValueError(msg)\n    if parsed.username is not None or parsed.password is not None:\n        msg = \"remote source must not contain credentials\"\n        raise ValueError(msg)\n    if parsed.query or parsed.fragment:\n        msg = \"remote source must not contain a query string or fragment\"\n        raise ValueError(msg)\n    try:\n        port = parsed.port\n    except ValueError as exc:\n        msg = \"remote source has an invalid port\"\n        raise ValueError(msg) from exc\n    host = parsed.hostname.rstrip(\".\")\n    netloc = f\"[{host}]\" if \":\" in host else host\n    if port is not None:\n        netloc = f\"{netloc}:{port}\"\n    return parsed._replace(scheme=\"https\", netloc=netloc).geturl()\n\n\n@dataclass(frozen=True, slots=True)\nclass ProviderStatus:\n    \"\"\"Health and safe diagnostic detail for one provider.\"\"\"\n\n    name: str\n    path: Path | None","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/configuration/types.py#L65-L101","documentation":"Raised by `_validate_remote_source_url` when the URL contains a query string ('?...') or fragment ('#...'). The library normalizes remote sources to a canonical URL, and query/fragment parts would make two textual spellings of the same source compare unequal and complicate caching, so they are rejected outright.","triggerScenarios":"Constructing the remote-source dataclass with URLs like 'https://example.com/config.toml?token=abc' or 'https://example.com/config.toml#section' — parsed.query or parsed.fragment is truthy.","commonSituations":"Copying a URL from a browser address bar that includes a tracking query ('?utm_source=...'); appending a cache-buster ('?v=2'); pasting a share link with a '#subsection' fragment; using a signed URL with query auth.","solutions":["Remove the '?' query and '#' fragment, keeping only scheme://host/path","If auth was passed via query parameters, move it to headers or an env-based credential","Strip tracking parameters (utm_*, v=, token=) before assigning the source","If you need to reference part of a file, handle that after fetch, not in the source URL"],"exampleFix":"// before\nRemoteSource(source=\"https://example.com/config.toml?token=abc#shared\")\n// after\nRemoteSource(source=\"https://example.com/config.toml\")","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\n\ndef has_query_or_fragment(source: str) -> bool:\n    parsed = urlparse(source)\n    return bool(parsed.query or parsed.fragment)\n\nif has_query_or_fragment(src):\n    src = src.split(\"?\", 1)[0].split(\"#\", 1)[0]","typeGuard":"def is_bare_https_path(value: str) -> bool:\n    parsed = urlparse(value)\n    return not parsed.query and not parsed.fragment","tryCatchPattern":"try:\n    RemoteSource(source=src)\nexcept ValueError as exc:\n    if \"query string or fragment\" in str(exc):\n        raise ConfigError(f\"strip query/fragment from remote source: {src!r}\") from exc\n    raise","preventionTips":["Copy URLs from the canonical source, not the browser address bar","Strip utm_*/token/v= parameters before saving config","Reference in-file sections via config keys, not #fragments"],"tags":["validation","url","canonicalization"],"backgroundTag":"invalid-remote-source-url","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}