Repository navigation
Description
Problem Description
The check of a web search query reads the host of each word of the query (_host_of in src/devops_cli/ai/web_search.py). It parses the word with urlsplit(f"//{word}"). For a word that is a URL with a scheme, such as https://docs.example.com/page, that call gives the scheme https as the host. So the check of a URL word does not read the host that the word names, and its result for the word differs from its result for the bare host.
Reproduction Steps
- Call
_host_of("docs.example.com"): the result isdocs.example.com. - Call
_host_of("https://docs.example.com/page"): the result ishttps.
Expected vs Actual Behavior
- Expected: the check reads the same host for a bare host, for a host with a port and for a URL with a scheme, a port, a path or brackets.
- Actual: a word with a scheme reads as the host
httpsorhttp.
Proposed Fix
Read the host of a word with the standard URL parser in the form that fits the word: a word that holds a scheme is parsed as a URL, and each URL that a word holds inside its path or its query is read too. Tests give each form of a word and the host that the check must read.
Acceptance Criteria
- Test first: for one host, the check gives the same result for the bare host, the host with a port, and a URL of that host with a scheme, with a port, with a path and in a longer word. The test fails on the base.
- A test: the result for a word with no host does not change.
-
docs/roadmap/alternatives.mdand each other page that describes the check stay correct.
Environment Diagnostics
devops-cli 0.223.0, Python 3.14.
Dependencies
None.
Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches found only URL parsers and link extractors (yarl, urlextract, linkify-it-py); each assumes a scheme or a public suffix, so none reads the host for every word form, and the fix stays in the existing urlsplit helper.
Lacks:
- No one host for bare, port, bracketed and scheme words
- No reading of URLs embedded in a word's path or query
- Needs a public suffix, so a bare service name finds no URL
Activity
dan-petty commentedon Nov 26, 2026
Both address URL host parsing inconsistencies, but the candidate fixes one function in web_search.py while #1112 fixes egress checks across multiple modules.devops-cli-service commentedon Nov 26, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 26, 2026
Released in v0.223.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.223.1
devops-cli-service commentedon Nov 26, 2026
Live since 2026-11-26 19:52 UTC