Close local release-quality gaps and reconcile workplan status
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 2s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a0e332-3365-77c0-8491-084e9ea33ac1
This commit is contained in:
tegwick 2026-09-27 17:36:27 +02:00
parent 37436bb562
commit 7cd633986e
56 changed files with 462 additions and 237 deletions

View file

@ -2,10 +2,10 @@
LLM configuration and API key resolution.
"""
import os
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional, Dict, Any
import os
from typing import Any
@dataclass
@ -25,19 +25,19 @@ class LLMConfig:
provider: str = "openrouter"
model: str = "moonshotai/kimi-k3"
api_key: Optional[str] = None
api_key: str | None = None
api_base: str = "https://openrouter.ai/api/v1"
claude_cli_path: str = "claude"
timeout_seconds: int = 300
max_retries: int = 3
extra: Dict[str, Any] = field(default_factory=dict)
extra: dict[str, Any] = field(default_factory=dict)
def resolve_api_key(
explicit: Optional[str] = None,
explicit: str | None = None,
env_var: str = "OPENROUTER_API_KEY",
key_file_paths: Optional[list[Path]] = None,
) -> Optional[str]:
key_file_paths: list[Path] | None = None,
) -> str | None:
"""Return an API key from the first available source.
Resolution order:
@ -65,7 +65,7 @@ def resolve_api_key(
return None
def find_project_root(start: Optional[Path] = None) -> Optional[Path]:
def find_project_root(start: Path | None = None) -> Path | None:
"""Walk up from *start* (default CWD) looking for ``pyproject.toml``.
Returns the directory containing the marker file, or ``None``.
@ -79,8 +79,8 @@ def find_project_root(start: Optional[Path] = None) -> Optional[Path]:
def load_config(
provider: str = "openrouter",
model: Optional[str] = None,
api_key: Optional[str] = None,
model: str | None = None,
api_key: str | None = None,
**overrides: Any,
) -> LLMConfig:
"""Build an :class:`LLMConfig` with sensible defaults.
@ -99,7 +99,7 @@ def load_config(
key_file_paths=key_file_paths,
)
defaults: Dict[str, Any] = {
defaults: dict[str, Any] = {
"provider": provider,
"model": model or "moonshotai/kimi-k3",
"api_key": resolved_key,