Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ def drain_events(): return _send({"meta": "drain_events"})["events"]
# --- navigation / page ---
def goto_url(url):
r = cdp("Page.navigate", url=url)
d = (Path(__file__).parent / "domain-skills" / (urlparse(url).hostname or "").removeprefix("www.").split(".")[0])
return {**r, "domain_skills": sorted(p.name for p in d.rglob("*.md"))[:10]} if d.is_dir() else r
hostname = (urlparse(url).hostname or "").removeprefix("www.").split(".")[0]
if hostname and hostname.isalnum():
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: hostname.isalnum() is too strict and blocks valid hyphenated host labels, causing domain-skills lookup regressions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At helpers.py, line 53:

<comment>`hostname.isalnum()` is too strict and blocks valid hyphenated host labels, causing domain-skills lookup regressions.</comment>

<file context>
@@ -49,8 +49,12 @@ def drain_events():  return _send({"meta": "drain_events"})["events"]
-    d = (Path(__file__).parent / "domain-skills" / (urlparse(url).hostname or "").removeprefix("www.").split(".")[0])
-    return {**r, "domain_skills": sorted(p.name for p in d.rglob("*.md"))[:10]} if d.is_dir() else r
+    hostname = (urlparse(url).hostname or "").removeprefix("www.").split(".")[0]
+    if hostname and hostname.isalnum():
+        d = Path(__file__).parent / "domain-skills" / hostname
+        if d.is_dir():
</file context>
Suggested change
if hostname and hostname.isalnum():
if hostname and hostname.replace("-", "").isalnum() and not hostname.startswith("-") and not hostname.endswith("-"):
Fix with Cubic

d = Path(__file__).parent / "domain-skills" / hostname
if d.is_dir():
return {**r, "domain_skills": sorted(p.name for p in d.rglob("*.md"))[:10]}
return r

def page_info():
"""{url, title, w, h, sx, sy, pw, ph} — viewport + scroll + page size.
Expand Down