-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
344 lines (240 loc) · 10.8 KB
/
.env.example
File metadata and controls
344 lines (240 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# =========================
# Runtime / Server
# =========================
# HTTP server port (1–65535, default 3000 when not set).
# PORT=3000
# Runtime environment (production | development | test).
# NODE_ENV=production
# Global Express body size limit for webhook requests.
# WEBHOOK_BODY_LIMIT=1mb
# UI locale for user-facing text (en | zh).
# PR_AGENT_LOCALE=en
# Enable core structured logs.
# PR_AGENT_CORE_LOGS=false
# Include stack trace in webhook error JSON responses (debug only).
# EXPOSE_ERROR_STACK=false
# Generic HTTP client defaults (used by shared fetch wrapper).
# HTTP_TIMEOUT_MS=30000
# HTTP_RETRIES=2
# HTTP_RETRY_BACKOFF_MS=400
# HTTP_RETRY_MAX_DELAY_MS=30000
# Max in-memory metric counter records.
# MAX_METRIC_COUNTER_RECORDS=5000
# Runtime state backend:
# - memory (default): in-memory only, reset on process restart
# - file: JSON file persistence
# - sqlite: SQLite persistence (recommended for single-instance deployment)
# RUNTIME_STATE_BACKEND=sqlite
# Runtime state sqlite file path (used when RUNTIME_STATE_BACKEND=sqlite).
# RUNTIME_STATE_SQLITE_FILE=/data/pr-agent/runtime-state.sqlite3
# Runtime state JSON file path (used when RUNTIME_STATE_BACKEND=file|fs).
# RUNTIME_STATE_FILE=.pr-agent-runtime-state.json
# SQLite busy timeout (ms) for runtime state backend.
# RUNTIME_STATE_SQLITE_BUSY_TIMEOUT_MS=5000
# File-lock timeout (ms) for file runtime state backend.
# RUNTIME_STATE_FILE_LOCK_TIMEOUT_MS=5000
# Stale lock timeout (ms) for file runtime state backend.
# Locks older than this threshold are considered stale and auto-removed.
# RUNTIME_STATE_FILE_STALE_LOCK_TIMEOUT_MS=30000
# Enable webhook event store for debugging/replay only. Keep disabled in normal production.
# WEBHOOK_EVENT_STORE_ENABLED=false
# Stored webhook event file path (NDJSON).
# WEBHOOK_EVENT_STORE_FILE=.pr-agent-webhook-events.ndjson
# Webhook event sampling rate (0-1].
# WEBHOOK_EVENT_STORE_SAMPLE_RATE=1
# Max stored webhook events.
# WEBHOOK_EVENT_STORE_MAX_ENTRIES=2000
# Max stored payload bytes per webhook event.
# WEBHOOK_EVENT_STORE_MAX_BODY_BYTES=524288
# Whether to keep sensitive headers in stored webhook events (debug only).
# WEBHOOK_EVENT_STORE_INCLUDE_SENSITIVE_HEADERS=false
# Enable replay endpoints:
# - POST /github/replay/:eventId
# - POST /gitlab/replay/:eventId
# - GET /webhook/events
# Keep disabled in normal production.
# WEBHOOK_REPLAY_ENABLED=false
# Replay auth token required by replay endpoints.
# WEBHOOK_REPLAY_TOKEN=replace-with-strong-random-token
# =========================
# GitHub App mode (recommended)
# =========================
# GitHub App numeric ID.
APP_ID=123456
# GitHub App slug (lowercase name), used for @mention detection in Issues/PRs.
# GITHUB_APP_SLUG=pr-agent
# Optional explicit bot login used for @mention detection.
# Supports values with or without the "[bot]" suffix.
# Example: condev-code-agent or condev-code-agent[bot]
# GITHUB_BOT_LOGIN=pr-agent
# GitHub App private key content (single-line string with escaped \n).
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\\nYOUR_PRIVATE_KEY\\n-----END RSA PRIVATE KEY-----\\n"
# Alternative to PRIVATE_KEY: absolute file path of the private key.
# PRIVATE_KEY_PATH=/abs/path/to/private-key.pem
# GitHub App webhook secret (used to verify /api/github/webhooks signatures).
WEBHOOK_SECRET=replace-with-your-webhook-secret
# =========================
# AI provider and model
# =========================
# AI provider selector: openai | openai-compatible | anthropic | gemini
AI_PROVIDER=openai
# Optional global model override (highest priority, covers all providers).
# AI_MODEL=
# OpenAI API key (used when AI_PROVIDER=openai, and also fallback for openai-compatible).
OPENAI_API_KEY=replace-with-openai-key
# OpenAI model name.
OPENAI_MODEL=gpt-4.1-mini
# OpenAI-compatible base URL (required for AI_PROVIDER=openai-compatible).
# OPENAI_BASE_URL=https://api.openai.com/v1
# OpenAI-compatible API key (optional; falls back to OPENAI_API_KEY).
# OPENAI_COMPATIBLE_API_KEY=replace-with-compatible-key
# OpenAI-compatible model name.
# OPENAI_COMPATIBLE_MODEL=deepseek-chat
# Anthropic API key.
# ANTHROPIC_API_KEY=replace-with-anthropic-key
# Anthropic model name.
# ANTHROPIC_MODEL=claude-3-5-haiku-latest
# Anthropic max output tokens per request.
# ANTHROPIC_MAX_TOKENS=4096
# Gemini API key.
# GEMINI_API_KEY=replace-with-gemini-key
# Gemini model name.
# GEMINI_MODEL=gemini-2.0-flash
# =========================
# AI tuning (optional)
# =========================
# HTTP timeout for AI review requests (ms).
# AI_HTTP_TIMEOUT_MS=30000
# HTTP timeout for /ask command requests (ms), usually longer since Q&A may need more tokens.
# AI_ASK_HTTP_TIMEOUT_MS=60000
# Number of HTTP retries on transient AI provider failures.
# AI_HTTP_RETRIES=2
# Retry backoff base delay for AI provider HTTP requests (ms).
# AI_HTTP_RETRY_BACKOFF_MS=400
# Max concurrent AI requests.
# AI_MAX_CONCURRENCY=4
# Max queued AI requests before rejecting new tasks.
# AI_MAX_QUEUE_SIZE=200
# Graceful shutdown drain timeout (ms) for in-flight AI tasks.
# AI_SHUTDOWN_DRAIN_TIMEOUT_MS=15000
# Max cached OpenAI client instances.
# MAX_OPENAI_CLIENT_CACHE_ENTRIES=200
# Enable AI request/response debug logging.
# AI_DEBUG_LOGS=false
# Health check AI provider timeout (ms).
# HEALTHCHECK_AI_TIMEOUT_MS=5000
# Perform actual API call for deep health check instead of config-only check.
# HEALTHCHECK_AI_LIVE_PROBE=false
# =========================
# Notification webhooks (optional)
# =========================
# Default notification webhook for both GitHub and GitLab review results.
# NOTIFY_WEBHOOK_URL=
# Notification format: wecom (default) | slack | discord | generic
# NOTIFY_WEBHOOK_FORMAT=wecom
# GitHub-specific notification webhook (overrides NOTIFY_WEBHOOK_URL for GitHub flows).
# GITHUB_PUSH_URL=
# GitLab-specific notification webhook (overrides NOTIFY_WEBHOOK_URL for GitLab flows).
# GITLAB_PUSH_URL=
# Notification HTTP timeout (ms).
# NOTIFY_HTTP_TIMEOUT_MS=15000
# Notification HTTP retry count.
# NOTIFY_HTTP_RETRIES=1
# Notification HTTP retry backoff (ms).
# NOTIFY_HTTP_RETRY_BACKOFF_MS=300
# Per-user per-command rate limit for PR/MR comment commands.
# COMMAND_RATE_LIMIT_MAX=10
# Rate limit window (ms) for COMMAND_RATE_LIMIT_MAX.
# COMMAND_RATE_LIMIT_WINDOW_MS=3600000
# =========================
# Plain GitHub webhook mode (non-GitHub-App)
# =========================
# Signature secret for /github/trigger (falls back to WEBHOOK_SECRET if unset).
# GITHUB_WEBHOOK_SECRET=replace-with-github-webhook-secret
# Token used to call GitHub API in plain webhook mode (preferred).
# GITHUB_WEBHOOK_TOKEN=replace-with-github-token-or-pat
# Generic GitHub token fallback (used when GITHUB_WEBHOOK_TOKEN is absent).
# GITHUB_TOKEN=replace-with-github-token-or-pat
# GitHub REST API base URL (for GitHub Enterprise, etc.).
# GITHUB_API_URL=https://api.github.com
# Skip GitHub webhook signature verification in plain mode (debug only; not for production).
# GITHUB_WEBHOOK_SKIP_SIGNATURE=false
# Extra hard cap for /github/trigger payload size (bytes).
# GITHUB_WEBHOOK_MAX_BODY_BYTES=10485760
# GitHub REST request timeout/retry settings.
# GITHUB_HTTP_TIMEOUT_MS=30000
# GITHUB_HTTP_RETRIES=2
# GITHUB_HTTP_RETRY_BACKOFF_MS=400
# GitHub diff patch truncation controls.
# GITHUB_MAX_PATCH_CHARS_PER_FILE=4000
# GITHUB_MAX_TOTAL_PATCH_CHARS=60000
# TTL for dedupe of merged/report events in GitHub mode, milliseconds.
# Default is 86400000 (24h). Increase for stronger idempotency, decrease for faster replay.
# GITHUB_MERGED_DEDUPE_TTL_MS=86400000
# Policy reminder comment dedupe TTL (ms) for issue/PR pre-check reminders.
# GITHUB_POLICY_COMMENT_DEDUPE_TTL_MS=600000
# Repo policy config cache TTL (ms) for `.pr-agent.yml` lookups.
# GITHUB_POLICY_CONFIG_CACHE_TTL_MS=300000
# Auto-triage Issues on opened/edited when repository has no `.pr-agent.yml`.
# GITHUB_ISSUE_AUTO_TRIAGE_ENABLED=true
# Auto-apply labels from issue auto-triage inference.
# GITHUB_ISSUE_AUTO_TRIAGE_AUTO_LABELS=true
# Dedup window (ms) for issue auto-triage comments.
# GITHUB_ISSUE_AUTO_TRIAGE_DEDUPE_TTL_MS=300000
# Max number of similar issues attached in auto-triage summary.
# GITHUB_ISSUE_AUTO_TRIAGE_SIMILAR_LIMIT=5
# Skip AI call in issue auto-triage and use built-in fallback summary only.
# GITHUB_ISSUE_TRIAGE_DISABLE_AI=false
# Incremental review state TTL (ms), tracks last reviewed head sha per PR.
# GITHUB_INCREMENTAL_STATE_TTL_MS=604800000
# Feedback signal TTL (ms), used by /feedback and review-thread resolved/unresolved events.
# GITHUB_FEEDBACK_SIGNAL_TTL_MS=2592000000
# Changelog file path for `/changelog --apply` in GitHub mode.
# GITHUB_CHANGELOG_PATH=CHANGELOG.md
# Check-run name used when `.pr-agent.yml` sets mode=enforce.
# GITHUB_POLICY_CHECK_NAME=PR Agent Policy
# =========================
# GitLab webhook compatibility mode
# =========================
# GitLab instance base URL (auto-inferred from payload project.web_url when unset).
# GITLAB_BASE_URL=https://gitlab.example.com
# Webhook secret for validating x-gitlab-token.
# GITLAB_WEBHOOK_SECRET=replace-with-gitlab-webhook-secret
# GitLab API token used to read MR changes and publish comments.
# GITLAB_TOKEN=replace-with-gitlab-private-token
# Extra hard cap for /gitlab/trigger payload size (bytes).
# GITLAB_WEBHOOK_MAX_BODY_BYTES=10485760
# Require GitLab webhook secret when true (rejects unsigned webhooks).
# GITLAB_REQUIRE_WEBHOOK_SECRET=false
# Allow insecure http:// base URL for GitLab (local debug only).
# ALLOW_INSECURE_GITLAB_HTTP=false
# GitLab REST request timeout/retry settings.
# GITLAB_HTTP_TIMEOUT_MS=30000
# GITLAB_HTTP_RETRIES=2
# GITLAB_HTTP_RETRY_BACKOFF_MS=400
# GitLab diff patch truncation controls.
# GITLAB_MAX_PATCH_CHARS_PER_FILE=4000
# GITLAB_MAX_TOTAL_PATCH_CHARS=60000
# TTL for dedupe of merged/report events in GitLab mode, milliseconds.
# GITLAB_MERGED_DEDUPE_TTL_MS=86400000
# Incremental review state TTL (ms), tracks last reviewed head sha per MR.
# GITLAB_INCREMENTAL_STATE_TTL_MS=604800000
# Feedback signal TTL (ms) for GitLab `/feedback` and note-driven learning.
# GITLAB_FEEDBACK_SIGNAL_TTL_MS=2592000000
# Repo policy config cache TTL (ms) for `.pr-agent.yml` lookups in GitLab mode.
# GITLAB_POLICY_CONFIG_CACHE_TTL_MS=300000
# Changelog file path for `/changelog --apply` in GitLab mode.
# GITLAB_CHANGELOG_PATH=CHANGELOG.md
# =========================
# Review scope / policy (optional)
# =========================
# Comma-separated file extensions treated as code review targets.
# REVIEW_CODE_EXTENSIONS=ts,tsx,js,jsx,vue,py,java,go,rs,php,rb,swift,kt,scala,c,cc,cpp,cs
# Cache TTL for GitHub process guideline files (ms).
# GITHUB_GUIDELINE_CACHE_TTL_MS=300000
# Cache TTL for GitLab process guideline files (ms).
# GITLAB_GUIDELINE_CACHE_TTL_MS=300000
# Ask-session retention controls for `/ask` multi-turn context.
# ASK_SESSION_TTL_MS=7200000
# ASK_SESSION_MAX_TURNS=6
# ASK_SESSION_MAX_ENTRIES=2000