Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions docs/known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,8 @@ lack the required `SKILL_NAME` / `SKILL_TRIGGERS` module attrs, so 4
confirmed 2026-07-02 during the log-review PRs). They look like leftover Pilot
e2e scratch files, not real skills. Fix: either add the required metadata +
regenerate `skills/.manifest.json`, or delete both files.

**RESOLVED 2026-07-03:** they were auto-generated Pilot trace recordings
(May 13) living in `~/.codec/skills/`, not repo files. Moved to
`~/.codec/pilot_archive/` β€” recordings preserved, skills dir clean,
`tests/test_skills.py` fully green (160/160).
16 changes: 16 additions & 0 deletions pilot/pilot_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,25 @@ def _record_step(action: dict, snap_text: str, el=None, result: str = "") -> Non
_recording.steps.append(step)


def _normalize_url(url: str) -> str:
"""Prepend https:// when the caller sends a bare domain (F8, 2026-07-03).

The Pilot UI normalizes before sending, but API callers (pilot skill,
MCP, curl) hitting /navigate with "example.com" got a 500 from the
browser driver. Scheme-relative (//host) and explicit schemes pass
through untouched; about:/data: etc. are left alone."""
u = (url or "").strip()
if not u:
return u
if "://" in u or u.startswith(("about:", "data:", "chrome:", "//")):
return u
return "https://" + u


@app.post("/navigate")
async def navigate(req: NavigateRequest):
pilot = _require_pilot()
req.url = _normalize_url(req.url)
await pilot.navigate(req.url, wait_until=req.wait_until)
snap = await take_snapshot(pilot.page)
_record_step(
Expand Down
21 changes: 21 additions & 0 deletions tests/test_pilot_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,24 @@ def test_headers_always_include_token(tmp_path, monkeypatch):

def test_stream_paths_cover_mjpeg():
assert "screenshot/stream" in pilot_proxy._STREAM_PATHS


# ── F8 (2026-07): runner-side bare-domain normalization ─────────────────────


def test_normalize_url_bare_domain():
import pytest
pytest.importorskip("playwright") # pilot deps absent on the CI runner
from pilot.pilot_runner import _normalize_url
assert _normalize_url("example.com") == "https://example.com"
assert _normalize_url(" avadigital.ai ") == "https://avadigital.ai"


def test_normalize_url_leaves_schemes_alone():
import pytest
pytest.importorskip("playwright") # pilot deps absent on the CI runner
from pilot.pilot_runner import _normalize_url
for u in ("https://example.com", "http://x.dev", "about:blank",
"data:text/html,hi", "//cdn.example.com/x"):
assert _normalize_url(u) == u
assert _normalize_url("") == ""