141 lines
4.4 KiB
Python
141 lines
4.4 KiB
Python
"""Service configuration."""
|
|
|
|
from pathlib import Path
|
|
from pydantic import Field
|
|
from lilith_ml_service_base import BaseServiceSettings
|
|
|
|
|
|
class AutoCommitSettings(BaseServiceSettings):
|
|
"""Settings for the auto-commit service."""
|
|
|
|
# Server settings
|
|
host: str = Field(
|
|
default="0.0.0.0",
|
|
description="Host to bind the service to",
|
|
)
|
|
port: int = Field(
|
|
default=8200,
|
|
description="Port to bind the service to",
|
|
)
|
|
|
|
# Llama service connection
|
|
llama_service_url: str = Field(
|
|
default="http://localhost:8000",
|
|
description="URL for llama-service inference",
|
|
)
|
|
llama_timeout: float = Field(
|
|
default=30.0,
|
|
description="Timeout for LLM requests in seconds",
|
|
)
|
|
|
|
# Scheduler settings
|
|
cycle_interval_seconds: int = Field(
|
|
default=60,
|
|
description="Seconds between commit cycles (default: 1 minute)",
|
|
)
|
|
enabled: bool = Field(
|
|
default=True,
|
|
description="Whether the daemon is enabled on startup",
|
|
)
|
|
|
|
# Repository configuration
|
|
repos_base_path: Path = Field(
|
|
default=Path("/var/home/lilith/Code/@applications/@lilith/lilith-platform"),
|
|
description="Base path containing repositories to process",
|
|
)
|
|
repo_names: list[str] = Field(
|
|
default=["codebase", "infrastructure", "tooling", "docs"],
|
|
description="Names of subdirectories to process as repositories",
|
|
)
|
|
|
|
# Persistent commit history
|
|
commit_history_file: Path = Field(
|
|
default=Path("~/.config/commits/commit-history.json").expanduser(),
|
|
description="Persistent commit history file (survives reboots)",
|
|
)
|
|
commit_history_max_per_daemon: int = Field(
|
|
default=20,
|
|
description="Maximum commits to keep per daemon in history",
|
|
)
|
|
|
|
# Recursive discovery settings
|
|
recursive_discovery: bool = Field(
|
|
default=False,
|
|
description="Auto-discover git repos recursively",
|
|
)
|
|
recursive_depth: int | None = Field(
|
|
default=None,
|
|
description="Max depth for recursive discovery (None = unlimited)",
|
|
)
|
|
cache_update_minutes: int = Field(
|
|
default=60,
|
|
description="Minutes between repo cache refreshes",
|
|
)
|
|
exclude_patterns: list[str] = Field(
|
|
default=["node_modules", "pyvenv", ".venv", "venv", "dist", "build"],
|
|
description="Patterns to exclude from recursive discovery",
|
|
)
|
|
|
|
# Git settings
|
|
git_remote: str = Field(
|
|
default="origin",
|
|
description="Git remote to push to",
|
|
)
|
|
git_branch: str = Field(
|
|
default="master",
|
|
description="Git branch to push to",
|
|
)
|
|
|
|
# Claude fallback settings
|
|
claude_fallback_enabled: bool = Field(
|
|
default=True,
|
|
description="Enable Claude Code fallback for failures",
|
|
)
|
|
claude_timeout_seconds: int = Field(
|
|
default=300,
|
|
description="Timeout for Claude Code execution in seconds",
|
|
)
|
|
|
|
# Llama service management
|
|
llama_service_autostart: bool = Field(
|
|
default=True,
|
|
description="Automatically start llama service if not running",
|
|
)
|
|
llama_service_startup_timeout: float = Field(
|
|
default=30.0,
|
|
description="Timeout for service startup in seconds",
|
|
)
|
|
llama_service_pid_file: Path = Field(
|
|
default=Path("~/.config/commits/llama-service.pid").expanduser(),
|
|
description="PID file for llama service tracking",
|
|
)
|
|
llama_service_lock_file: Path = Field(
|
|
default=Path("~/.config/commits/llama-service.lock").expanduser(),
|
|
description="Lock file for service startup coordination",
|
|
)
|
|
llama_service_health_check_interval: int = Field(
|
|
default=0,
|
|
description="Cycles between health checks (0 = check every cycle)",
|
|
)
|
|
|
|
# Model-boss integration for auto-loading LLM
|
|
llama_model_id: str = Field(
|
|
default="deepseek-r1-70b",
|
|
description="Model ID for commit message generation (resolved via model-boss)",
|
|
)
|
|
use_model_boss: bool = Field(
|
|
default=True,
|
|
description="Use model-boss to resolve model paths before starting llama-service",
|
|
)
|
|
|
|
# Logging
|
|
log_file: Path = Field(
|
|
default=Path("/tmp/auto-commit.log"),
|
|
description="Path for service log file",
|
|
)
|
|
activity_log_path: Path | None = Field(
|
|
default=None,
|
|
description="Optional path for commit activity log file",
|
|
)
|
|
|
|
model_config = {"env_prefix": "AUTO_COMMIT_"}
|