# Helix service configuration.
# Read by the service from /etc/helix/config (TOML format).
# This file contains secrets; keep it readable only by root.

[git]
# Git hosting provider. Options: "gitlab".
type = "gitlab"

# Access token used to authenticate against the GitLab API.
# Needs api, read_repository and write_repository scopes. Required.
access_token = ""

# Base URL of the GitLab instance including scheme, no trailing path.
# Example: "https://gitlab.com" or "https://git.example.net". Required.
host = ""

[orchestrator]
# Seconds between polls of GitLab for new or updated work. Must be > 0.
poll_interval = 20

# Maximum number of issue jobs run concurrently. Must be > 0.
max_jobs = 3

# Maximum number of repositories kept cloned on disk at once.
# 0 disables the limit; when set it must be >= max_jobs.
max_cloned_repositories = 5

# Number of times a failed job is retried before being abandoned. Must be >= 0.
max_retry_attempts = 3

# Base delay in seconds for exponential retry backoff. Must be > 0.
retry_base_delay = 10

# Directory where repositories are cloned and agent work is performed.
workspace_dir = "/var/helix/work"

# Emit verbose agent system/diagnostic messages to the log. Options: true, false.
system_messages = false

[provider]
# LLM provider used by the agents.
#
# The default below uses GitHub Copilot. To use a local or self-hosted model
# instead (Ollama, vLLM, LM Studio, or any OpenAI-compatible server), comment
# out the "GitHub Copilot" block and uncomment the "Local provider" block.

# --- GitHub Copilot (default) ---
# Selects the GitHub Copilot backend.
type = "github-copilot"

# GitHub Copilot access token used by the agent SDK. Required for this provider.
access_token = ""

# Model served through Copilot.
# Examples: "claude-opus-4.8", "claude-sonnet-4.5", "gpt-5".
model = "claude-opus-4.8"

# Maximum time in seconds a single agent prompt may run before timing out. Must be > 0.
prompt_timeout_seconds = 3600

# --- Local provider (alternative, e.g. Ollama) ---
# To use a local model, comment out the four "GitHub Copilot" lines above and
# uncomment the lines below. Any OpenAI-compatible server works.
#
# Use "openai" for Ollama, vLLM, LM Studio, etc.
# type = "openai"
#
# Base URL of the model API. Ollama's OpenAI-compatible endpoint ends with /v1.
# base_url = "http://localhost:11434/v1"
#
# Auth key. Ollama ignores the value but the OpenAI wire format requires one.
# api_key = "ollama"
#
# Model id exactly as the provider expects it.
# model = "llama3.1:8b"
#
# Maximum time in seconds a single agent prompt may run before timing out. Must be > 0.
# prompt_timeout_seconds = 3600
#
# Optional: wire protocol override (e.g. "chat-completions").
# wire_api = ""
#
# Optional: token caps (omit or 0 to leave unset).
# max_prompt_tokens = 0
# max_output_tokens = 0

[database]
# Filesystem path to the SQLite database holding job state.
path = "/var/helix/db/helix.db"
