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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@


def load_local_manifest(path: Path | None = None) -> LocalManifest:
return LocalManifest.model_validate_json((path or MANIFEST_PATH).read_text())
return LocalManifest.model_validate_json(
(path or MANIFEST_PATH).read_text(encoding="utf-8")
)


def empty_manifest() -> LocalManifest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@


def load_remote_manifest(path: Path | None = None) -> RemoteManifest:
return RemoteManifest.model_validate_json((path or MANIFEST).read_text())
return RemoteManifest.model_validate_json(
(path or MANIFEST).read_text(encoding="utf-8")
)


@lru_cache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""The committed manifest is the one every remote label comes from."""

import subprocess
import sys

import pytest

from modules.llm.catalog.remote.manifest.loader import (
Expand All @@ -19,6 +22,31 @@ def test_the_shipped_manifest_loads() -> None:
assert "openrouter" in manifest.providers


def test_the_shipped_manifest_loads_without_the_system_encoding() -> None:
"""Windows reads cp1252 by default, and the manifest's UTF-8 left it empty."""
load = (
"from modules.llm.catalog.remote.manifest.loader import load_remote_manifest;"
"load_remote_manifest()"
)
run = subprocess.run(
[
sys.executable,
"-X",
"warn_default_encoding",
"-W",
"error::EncodingWarning",
"-c",
load,
],
capture_output=True,
text=True,
encoding="utf-8",
check=False,
)

assert run.returncode == 0, run.stderr


def test_the_shipped_manifest_knows_an_embedder_is_not_a_chat_model() -> None:
"""The old snapshot labelled text-embedding-3-small a chat model."""
found = remote_lookup().classify("text-embedding-3-small", provider="openai")
Expand Down
Loading