my harness for niri
1# ── Primary model (OpenAI-compatible) ────────────────────────────────────────
2OPENAI_BASE_URL=https://api.openai.com/v1
3OPENAI_API_KEY=
4MODEL=
5
6# Used when the primary endpoint is unreachable or rate-limited (429/5xx).
7# Supports any OpenAI-compatible provider (OpenRouter, LM Studio, etc.).
8FALLBACK_OPENAI_BASE_URL=http://localhost:1234/v1
9FALLBACK_OPENAI_API_KEY=
10FALLBACK_MODEL=
11# Tool call policy for fallback requests: required, auto, none
12FALLBACK_TOOL_CHOICE=required
13# Optional headers
14FALLBACK_OPENAI_REFERER=
15FALLBACK_OPENAI_TITLE=
16# Context window enforcement for fallback. Defaults to true for localhost, false otherwise.
17FALLBACK_ENFORCE_CONTEXT_LIMIT=
18FALLBACK_N_CTX=4096
19FALLBACK_CONTEXT_MARGIN=256
20FALLBACK_HARD_OVERFLOW_TOKENS=1024
21
22# Set to "local" to skip the primary model and route all requests to the fallback.
23NIRI_ENV=default
24
25# Must match the user created in the Dockerfile and the volume mount in docker-compose.yml.
26NIRI_USER=niri
27NIRI_CONTAINER=niri
28# UID/GID the container process runs as — match your host user to avoid permission issues.
29AGENT_UID=1001
30AGENT_GID=1001
31
32PORT=3000
33# Used by the chat CLI to connect. Include the scheme, exclude the port.
34NIRI_HOST=http://localhost
35
36# ── Context & token limits ────────────────────────────────────────────────────
37TOKEN_NUDGE_THRESHOLD=120000
38FALLBACK_TOKEN_NUDGE_THRESHOLD=50000
39CONTEXT_COMPACT_TARGET_TOKENS=65000
40CONTEXT_COMPACT_TRIGGER_TOKENS=90000
41CONTEXT_COMPACT_RECENT_MESSAGES=80
42CONTEXT_COMPACT_CHUNK_MESSAGES=32
43CONTEXT_COMPACT_SUMMARY_MAX_CHARS=16000
44
45# ── Tools ─────────────────────────────────────────────────────────────────────
46# Max bytes accepted by image_tool before rejecting the file.
47IMAGE_TOOL_MAX_BYTES=150000
48# Override the image directory exposed to the agent (default: /home/$NIRI_USER/images).
49IMAGE_ROOT=
50
51# ── Discord ───────────────────────────────────────────────────────────────────
52DISCORD_BOT_TOKEN=
53# Optional — auto-detected from the gateway on first connect if left blank.
54DISCORD_BOT_USER_ID=
55# Enable the built-in gateway listener (messageCreate → ingest pipeline).
56DISCORD_GATEWAY_ENABLED=true
57# Log every ingest decision (verbose, for debugging).
58DISCORD_GATEWAY_TRACE=false
59# Also ingest raw MESSAGE_CREATE packets — recommended for DM reliability.
60DISCORD_GATEWAY_RAW_FALLBACK=true
61# Comma-separated channel IDs scanned by discord_scan when no channel_ids arg is passed.
62DISCORD_SCAN_CHANNEL_IDS=
63# Wake the agent immediately on any new Discord event (leave false to avoid spam).
64DISCORD_WAKE_ON_EVENT=false
65# Wake immediately on DMs even when DISCORD_WAKE_ON_EVENT is false.
66DISCORD_WAKE_ON_DM=true
67# How often to batch pending Discord events into a single harness message.
68DISCORD_BATCH_INTERVAL_MS=60000
69# Restrict batch digests to configured scan channels + DMs (recommended).
70DISCORD_BATCH_ONLY_CONFIGURED=true
71# Auto-demote pending inbox items to seen after N minutes (0 = disabled).
72DISCORD_PENDING_AUTO_SEEN_MINUTES=10
73# Include a channel scan snapshot in each batch payload.
74DISCORD_BATCH_SCAN=true
75# Max messages included in a single batch digest.
76DISCORD_BATCH_MAX_MESSAGES=40