loki-mode 11.120.1 → 11.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/issue-to-pr/action.yml +1 -1
- package/README.md +3 -2
- package/SKILL.md +16 -19
- package/VERSION +1 -1
- package/agents/custom_agents.py +1 -1
- package/api/openapi.yaml +3 -7
- package/api/routes/health.ts +5 -10
- package/api/routes/sessions.ts +12 -3
- package/api/server.js +6 -2
- package/api/services/cli-bridge.ts +1 -1
- package/api/types/api.ts +3 -5
- package/assets/welcome/welcome.html +1 -1
- package/autonomy/completion-council.sh +0 -52
- package/autonomy/context-tracker.py +10 -25
- package/autonomy/council-v2.sh +0 -28
- package/autonomy/grill.sh +3 -25
- package/autonomy/lib/chat.sh +3 -6
- package/autonomy/lib/claude-flags.sh +1 -1
- package/autonomy/lib/cost-summary.py +2 -2
- package/autonomy/lib/done-recognition.sh +1 -1
- package/autonomy/lib/efficiency_cost.py +1 -1
- package/autonomy/lib/effort_estimator.py +0 -4
- package/autonomy/lib/help-core.sh +6 -4
- package/autonomy/lib/iteration_attribution.py +1 -1
- package/autonomy/lib/mcp-config.sh +7 -34
- package/autonomy/lib/os_sandbox.py +2 -5
- package/autonomy/lib/outcome_ledger.py +1 -1
- package/autonomy/lib/project-graph.sh +1 -1
- package/autonomy/lib/setup-requirements.json +1 -4
- package/autonomy/lib/skill-link-heal.sh +1 -1
- package/autonomy/lib/telemetry-schema.json +3 -3
- package/autonomy/lib/wiki_llm.py +1 -4
- package/autonomy/loki +95 -335
- package/autonomy/migration-agents.sh +1 -1
- package/autonomy/prd-checklist.sh +1 -1
- package/autonomy/provider-offer.sh +7 -11
- package/autonomy/quickstart.sh +3 -11
- package/autonomy/route.sh +6 -6
- package/autonomy/run.sh +51 -291
- package/autonomy/sandbox.sh +8 -39
- package/autonomy/setup-wizard.sh +5 -5
- package/bin/loki +34 -25
- package/completions/_loki +4 -4
- package/completions/loki.bash +2 -4
- package/dashboard/__init__.py +1 -1
- package/dashboard/api_start.py +36 -6
- package/dashboard/build_supervisor.py +1 -5
- package/dashboard/server.py +18 -26
- package/docs/ARCHITECTURE.md +9 -10
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/COMPARE-OPENCODE.md +7 -6
- package/docs/COMPONENTS.md +5 -8
- package/docs/DOCKER.md +11 -10
- package/docs/INSTALLATION.md +5 -8
- package/docs/OPEN-CORE-BOUNDARY.md +1 -1
- package/docs/PRIVACY.md +2 -2
- package/docs/QUICKSTART.md +2 -2
- package/docs/TOOLS.md +3 -3
- package/docs/air-gapped.md +3 -3
- package/docs/alternative-installations.md +20 -10
- package/docs/cost-controls.md +0 -3
- package/docs/dev/architecture-reference.md +1 -1
- package/docs/dev/project-structure.md +1 -4
- package/docs/environment-variables.md +8 -10
- package/docs/exit-codes.md +5 -5
- package/docs/network-security.md +3 -6
- package/docs/v10/GUIDE.md +45 -34
- package/integrations/openclaw/README.md +1 -1
- package/integrations/openclaw/SKILL.md +3 -3
- package/learning/emit.sh +1 -1
- package/loki-ts/data/child-env.json +0 -8
- package/loki-ts/dist/cockpit.js +1 -1
- package/loki-ts/dist/loki.js +1339 -1345
- package/magic/core/debate.py +4 -11
- package/magic/core/generator.py +5 -18
- package/mcp/__init__.py +1 -1
- package/mcp/server.py +1 -1
- package/package.json +2 -3
- package/packages/control-plane/dist/ask-tools-server.js +1 -3
- package/packages/control-plane/dist/server.js +171 -395
- package/packages/control-plane/src/ask/invoke.ts +5 -13
- package/packages/control-plane/src/ask/parse.ts +3 -25
- package/packages/control-plane/src/ask/worker.ts +1 -2
- package/packages/control-plane/src/db/fixture-cleanup.ts +1 -1
- package/packages/control-plane/src/server/routes/ask.ts +3 -2
- package/packages/control-plane/src/server/routes/cost_ledger.ts +0 -1
- package/packages/control-plane/src/server/routes/providers.ts +4 -9
- package/packages/control-plane/src/server/spawn.ts +8 -4
- package/packages/control-plane/ui/dist/assets/{index-C4nb1aRV.js → index-Dy80VLtj.js} +22 -22
- package/packages/control-plane/ui/dist/index.html +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/loader.sh +23 -4
- package/providers/model_catalog.json +2 -104
- package/providers/models.sh +10 -11
- package/providers/opencode.sh +3 -6
- package/references/quality-control.md +1 -1
- package/schemas/loki-yaml.schema.json +1 -1
- package/skills/model-selection.md +26 -55
- package/skills/providers.md +54 -221
- package/skills/quality-gates.md +3 -3
- package/skills/troubleshooting.md +1 -1
- package/src/integrations/github/action-handler.js +2 -4
- package/src/protocols/tools/start-project.js +1 -1
- package/tools/index-codebase.py +1 -2
- package/tools/preflight.sh +2 -2
- package/tools/probe-model-catalog.py +1 -13
- package/tools/regen-state-machine-refs.py +1 -2
- package/tools/token-guard.py +1 -1
- package/web-app/dist/assets/{AdminPage-CSwrd2UA.js → AdminPage-BfxkhFXl.js} +1 -1
- package/web-app/dist/assets/{Avatar-B6SmKtXt.js → Avatar-xV4rK0ps.js} +1 -1
- package/web-app/dist/assets/{Badge-CR4U3l95.js → Badge-Ds_E82Ka.js} +1 -1
- package/web-app/dist/assets/{Button-DmcHmlo6.js → Button-BXAwY0ni.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-CR_GmqRg.js → CockpitPage-y3R9sk_M.js} +1 -1
- package/web-app/dist/assets/ComparePage-BGbCno4C.js +1 -0
- package/web-app/dist/assets/{ErrorBoundary-23WE8Kb8.js → ErrorBoundary-DGqkzHdy.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-dFODI74J.js → EvidenceReceiptPanel-Bj57TWoJ.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-CudHcPXf.js → GitHubIssuesPanel-CVbtUCRI.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-0WcASaRW.js → GitHubPRsPanel-DuNxI0k8.js} +1 -1
- package/web-app/dist/assets/{HomePage-CQL8xADH.js → HomePage-DogFuRvt.js} +2 -2
- package/web-app/dist/assets/{LoginPage-BRfdWXgI.js → LoginPage-U-r-YNKC.js} +1 -1
- package/web-app/dist/assets/{MagicPage-CaaPZyuJ.js → MagicPage-C5iDqK4d.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-BjQ0sz0F.js → MetricsPage-COVYOGfr.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-BNnrwX96.js → NotFoundPage-CZii6Z0s.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-pDqfWbBG.js → ProjectPage-QwOZzVqj.js} +25 -25
- package/web-app/dist/assets/{ProjectsPage-CiHCZYVm.js → ProjectsPage-BcxVfXVW.js} +1 -1
- package/web-app/dist/assets/SettingsPage-CBY9JiAE.js +10 -0
- package/web-app/dist/assets/{ShowcasePage-BCa643R5.js → ShowcasePage-D1YPQOp7.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-DcpAC9Lg.js +1 -0
- package/web-app/dist/assets/{TeamsPage-CG-DqMjn.js → TeamsPage-BTiJPkD4.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-CO_kXHRt.js → TemplatesPage-LUa3bH-A.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-C_iYHB-7.js → TerminalOutput-BM8LH-RG.js} +1 -1
- package/web-app/dist/assets/{activity-Cp6ZIiZc.js → activity-mZHuLoR5.js} +1 -1
- package/web-app/dist/assets/{bell-BZf6hsa9.js → bell-BR_y_nMB.js} +1 -1
- package/web-app/dist/assets/{bot-CGmNbYLx.js → bot-Ct3caGMX.js} +1 -1
- package/web-app/dist/assets/{check-CMDDpUDY.js → check-DuQpq9PN.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DTtdfTHr.js → chevron-left-CWSfVWba.js} +1 -1
- package/web-app/dist/assets/{circle-alert-Ch6h3j52.js → circle-alert-C7TCj9Jm.js} +1 -1
- package/web-app/dist/assets/{clock-Ce1nf2ai.js → clock-BFsj3bRT.js} +1 -1
- package/web-app/dist/assets/{cloud-p2TFekpg.js → cloud-78sYPXff.js} +1 -1
- package/web-app/dist/assets/{code-xml-Kyu4vmM1.js → code-xml-DuwBCDz-.js} +1 -1
- package/web-app/dist/assets/{database-B4HrqS9b.js → database-CwRTYKVV.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-Cw-uyKAg.js → dollar-sign-COXAsjgd.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-C8N3vuAd.js → file-code-corner-A8LPVBBy.js} +1 -1
- package/web-app/dist/assets/{file-plus-Ddd367Rd.js → file-plus-D9IXE7YW.js} +1 -1
- package/web-app/dist/assets/{globe-BW_Nzcek.js → globe-Ce6xgdLR.js} +1 -1
- package/web-app/dist/assets/{hammer-rS0zwOgP.js → hammer-Dtq836Al.js} +1 -1
- package/web-app/dist/assets/{index-BFtUVrg2.js → index-uce16-nn.js} +16 -16
- package/web-app/dist/assets/{layers-ChTtsWHz.js → layers-BOQdqOXk.js} +1 -1
- package/web-app/dist/assets/{loader-circle-Dl2j378Y.js → loader-circle-D3y4SHAn.js} +1 -1
- package/web-app/dist/assets/{lock-H0jwxcaH.js → lock-miFONHLo.js} +1 -1
- package/web-app/dist/assets/{package-Cn0OyUWi.js → package-ckZFIHTG.js} +1 -1
- package/web-app/dist/assets/{plus-c4Cn8Hg_.js → plus-COJKSbOp.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-CvtIp31h.js → refresh-cw-rPt-Oa4a.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CACNVELf.js → rotate-ccw-Dy50K31A.js} +1 -1
- package/web-app/dist/assets/{scroll-text-wcpAN4zz.js → scroll-text-CbczPkkS.js} +1 -1
- package/web-app/dist/assets/{server-C8tiYYoH.js → server-HkfTEf2O.js} +1 -1
- package/web-app/dist/assets/{shield-alert-D2EqAn5F.js → shield-alert-DjKF0yba.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-DoxGQgUE.js → thumbs-up-aObjUDQm.js} +1 -1
- package/web-app/dist/assets/{trash-2-HbLfFoN4.js → trash-2-CQfI6Z-c.js} +1 -1
- package/web-app/dist/assets/{trending-down-Djd4tkxi.js → trending-down-CP7J5aPV.js} +1 -1
- package/web-app/dist/assets/{trending-up-B9Nco_QQ.js → trending-up-CTJHoPnm.js} +1 -1
- package/web-app/dist/assets/{upload-Bu_bR4UG.js → upload-i1zoXd2k.js} +1 -1
- package/web-app/dist/assets/{usePolling-D6jTTEO8.js → usePolling-CZG-IV1Y.js} +1 -1
- package/web-app/dist/assets/{user-3vyW2Iwk.js → user-CJwbwmPE.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/web-app/server.py +26 -14
- package/autonomy/lib/codex-usage.py +0 -174
- package/providers/aider.sh +0 -191
- package/providers/cline.sh +0 -176
- package/providers/codex.sh +0 -408
- package/web-app/dist/assets/ComparePage-DH9gwrob.js +0 -1
- package/web-app/dist/assets/SettingsPage-B-1-R56L.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-BUHVmvMB.js +0 -1
package/docs/DOCKER.md
CHANGED
|
@@ -234,23 +234,24 @@ Claude is the default provider and the only CLI pre-installed in this image.
|
|
|
234
234
|
| Provider | Tier | In this image | Notes |
|
|
235
235
|
|----------|------|---------------|-------|
|
|
236
236
|
| Claude Code | Tier 1 (default) | Yes | Full feature support (subagents, parallel, Task tool, MCP) |
|
|
237
|
-
|
|
|
238
|
-
| Cline | Tier 2 | No | Reduced parallelism. Install the CLI in a derived image. |
|
|
239
|
-
| Aider | Tier 3 | No | Degraded mode. Install the CLI in a derived image. |
|
|
237
|
+
| opencode | Model-agnostic | No | Any model, including OpenRouter. Install the CLI in a derived image. |
|
|
240
238
|
|
|
241
|
-
|
|
239
|
+
codex, cline, aider and gemini were removed; `LOKI_PROVIDER` set to one of them exits 2 with a migration line.
|
|
240
|
+
|
|
241
|
+
To use opencode, build a derived image that installs its CLI, then set `LOKI_PROVIDER` and the relevant API key. Example skeleton:
|
|
242
242
|
|
|
243
243
|
```dockerfile
|
|
244
244
|
FROM asklokesh/loki-mode:latest
|
|
245
245
|
USER root
|
|
246
|
-
|
|
246
|
+
RUN npm install -g opencode-ai
|
|
247
247
|
USER loki
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
```bash
|
|
251
251
|
docker run -it \
|
|
252
|
-
-e LOKI_PROVIDER=
|
|
253
|
-
-e
|
|
252
|
+
-e LOKI_PROVIDER=opencode \
|
|
253
|
+
-e LOKI_OPENCODE_MODEL=openrouter/deepseek/deepseek-v3.2 \
|
|
254
|
+
-e OPENROUTER_API_KEY="$OPENROUTER_API_KEY" \
|
|
254
255
|
-v "$(pwd)":/workspace \
|
|
255
256
|
your-derived-image start prd.md
|
|
256
257
|
```
|
|
@@ -287,14 +288,14 @@ docker run -it \
|
|
|
287
288
|
| Variable | Description |
|
|
288
289
|
|----------|-------------|
|
|
289
290
|
| `ANTHROPIC_API_KEY` | Anthropic API key (Auth Method 1, default for Claude provider) |
|
|
290
|
-
| `
|
|
291
|
+
| `OPENROUTER_API_KEY` | OpenRouter key (for the opencode provider with an `openrouter/...` model, in a derived image) |
|
|
291
292
|
| `GITHUB_TOKEN` | GitHub personal access token |
|
|
292
293
|
|
|
293
294
|
### Core Configuration
|
|
294
295
|
|
|
295
296
|
| Variable | Description | Default |
|
|
296
297
|
|----------|-------------|---------|
|
|
297
|
-
| `LOKI_PROVIDER` | AI provider: `claude
|
|
298
|
+
| `LOKI_PROVIDER` | AI provider: `claude` or `opencode` | `claude` |
|
|
298
299
|
| `LOKI_MAX_ITERATIONS` | Max autonomous iteration cycles | `1000` |
|
|
299
300
|
| `LOKI_MAX_RETRIES` | Max retry attempts per iteration | `50` |
|
|
300
301
|
| `LOKI_DASHBOARD` | Enable dashboard server | `true` |
|
|
@@ -369,7 +370,7 @@ docker run -it \
|
|
|
369
370
|
### Start Options
|
|
370
371
|
|
|
371
372
|
```
|
|
372
|
-
--provider NAME AI provider: claude (default)
|
|
373
|
+
--provider NAME AI provider: claude (default) or opencode
|
|
373
374
|
--parallel Enable parallel mode with git worktrees
|
|
374
375
|
--bg, --background Run in background
|
|
375
376
|
--simple Force simple complexity tier
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Loki Mode, by [Autonomi](https://www.autonomi.dev/), turns a spec or an issue into a verified pull request with a receipt you can check. This page covers installing it, a first run, and the options around it.
|
|
4
4
|
|
|
5
|
-
**Version:** v11.
|
|
5
|
+
**Version:** v11.121.0
|
|
6
6
|
|
|
7
7
|
**Engine note:** `loki start` is the primary command. `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` all run the Loki 10 engine, whatever the flag order or input form (PRD file, issue ref, task or one-word brief). The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, or for one call when a flag Loki 10 cannot honor is present. See the [user guide](v10/GUIDE.md) and the [5-minute quickstart](QUICKSTART.md).
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ brew tap asklokesh/tap && brew install loki-mode # Homebrew
|
|
|
20
20
|
|
|
21
21
|
The Loki 10 engine runs on Bun. The npm package bundles a Bun binary for macOS and Linux (x64 and arm64) as an optional dependency, so a plain npm install needs nothing else. With Homebrew, install Bun too if you do not have it: `brew install oven-sh/bun/bun`.
|
|
22
22
|
|
|
23
|
-
The npm postinstall step repoints any stale skill links and installs shell completions (skipped in CI or with `LOKI_NO_COMPLETIONS=1`). It never fails the install. To install the Loki skill into each detected provider CLI (`~/.claude/skills/`, `~/.
|
|
23
|
+
The npm postinstall step repoints any stale skill links and installs shell completions (skipped in CI or with `LOKI_NO_COMPLETIONS=1`). It never fails the install. To install the Loki skill into each detected provider CLI (`~/.claude/skills/`, `~/.config/opencode/`), run:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
loki setup-skill
|
|
@@ -61,7 +61,7 @@ Required (`loki doctor` fails without them):
|
|
|
61
61
|
| git | any recent version |
|
|
62
62
|
| curl | any |
|
|
63
63
|
|
|
64
|
-
Plus a way to reach a model. Claude Code (`claude`) is the default provider and the only one with every feature, so the default path needs it installed and logged in: `npm install -g @anthropic-ai/claude-code`, then `claude auth login`. With only `ANTHROPIC_API_KEY` set, `loki "<goal>"` runs on the bundled Claude Agent SDK with no CLI and no extra setting. `loki edit` and `loki chat` call the `claude` CLI directly.
|
|
64
|
+
Plus a way to reach a model. Claude Code (`claude`) is the default provider and the only one with every feature, so the default path needs it installed and logged in: `npm install -g @anthropic-ai/claude-code`, then `claude auth login`. With only `ANTHROPIC_API_KEY` set, `loki "<goal>"` runs on the bundled Claude Agent SDK with no CLI and no extra setting. `loki edit` and `loki chat` call the `claude` CLI directly. The only other provider is `opencode` (optional; any model, including OpenRouter via `OPENROUTER_API_KEY`). codex, cline, aider and gemini were removed and exit 2 with a migration line.
|
|
65
65
|
|
|
66
66
|
Optional: Python 3.8+ (deep scans, Python repos and group runs; `loki "<goal>"` runs without it), jq (`loki status` and the bash fallback CLI), Bun 1.3+ (bundled by the npm package), bash 4+ (recommended), Ollama or an OpenRouter key for non-Claude model routes.
|
|
67
67
|
|
|
@@ -155,12 +155,9 @@ See [control-plane-migration.md](control-plane-migration.md) and [control-plane-
|
|
|
155
155
|
| Provider | Notes |
|
|
156
156
|
|----------|-------|
|
|
157
157
|
| `claude` | Default (Tier 1). Full feature set. |
|
|
158
|
-
| `
|
|
159
|
-
| `codex` | Sequential only. Engine10 cost parsed or estimated, guardrail scan, `--sandbox workspace-write`. |
|
|
160
|
-
| `aider` | Sequential only; `ollama_chat/<model>` works for local models. Engine10 cost reported or estimated, guardrail scan, `--no-auto-commits`. |
|
|
161
|
-
| `opencode` | Sequential only. Supported in engine10 (`--provider opencode`); cost not measured. Install with `npm install -g opencode-ai`; model via `LOKI_OPENCODE_MODEL=provider/model`. |
|
|
158
|
+
| `opencode` | Sequential only. Supported in engine10 (`--provider opencode`); cost not measured. Install with `npm install -g opencode-ai`; model via `LOKI_OPENCODE_MODEL=provider/model` or `--model`; OpenRouter models are `openrouter/<vendor>/<model>` with `OPENROUTER_API_KEY` set. |
|
|
162
159
|
|
|
163
|
-
When `LOKI_PROVIDER` is unset, Loki uses the first installed CLI in this order: `claude`, `
|
|
160
|
+
When `LOKI_PROVIDER` is unset, Loki uses the first installed CLI in this order: `claude`, `opencode`. An explicit `LOKI_PROVIDER` or `--provider NAME` always wins.
|
|
164
161
|
|
|
165
162
|
### Model routes and local models
|
|
166
163
|
|
|
@@ -19,7 +19,7 @@ today.
|
|
|
19
19
|
Everything that exists today, including:
|
|
20
20
|
|
|
21
21
|
- The full RARV-C autonomous loop (`loki start`), all providers
|
|
22
|
-
(Claude
|
|
22
|
+
(Claude Code, the Anthropic Agent SDK, opencode), multi-project, dashboard, memory system.
|
|
23
23
|
- 3-reviewer council + RARV-C closure (the trust engine).
|
|
24
24
|
- proof-of-run generation and local inspection: `loki proof list|show|open`.
|
|
25
25
|
- Sharing a proof to a GitHub Gist: `loki proof share <id>` (uses your own `gh`
|
package/docs/PRIVACY.md
CHANGED
|
@@ -13,7 +13,7 @@ match the code, the code is the bug; please open an issue.
|
|
|
13
13
|
version, error type, and sanitized stack signatures). It NEVER includes your
|
|
14
14
|
code, prompts, PRDs, file paths, environment values, API keys, repository
|
|
15
15
|
names, emails, or IP addresses. (This statement scopes to telemetry and
|
|
16
|
-
diagnostics; provider CLIs you configure, such as Claude or
|
|
16
|
+
diagnostics; provider CLIs you configure, such as Claude Code or opencode, make their
|
|
17
17
|
own network calls under your own credentials and are governed by their vendors.)
|
|
18
18
|
- Enterprise / CI / air-gapped deployments are safe out of the box: collection
|
|
19
19
|
AUTO-DISABLES (no opt-out needed) when any of these is detected -- CI
|
|
@@ -98,7 +98,7 @@ paths, keys, or repo names -- only anonymous diagnostics.
|
|
|
98
98
|
|---|---|---|
|
|
99
99
|
| `installed` | first command ever run | `first_command` (a known loki subcommand, else `other`) |
|
|
100
100
|
| `cli_command` | each command | `command` (a known loki subcommand, else `other`) |
|
|
101
|
-
| `session_start` | a run starts (legacy engine) | `provider` (claude,
|
|
101
|
+
| `session_start` | a run starts (legacy engine) | `provider` (claude, opencode), `complexity` (simple, standard, complex), `parallel` (true or false) |
|
|
102
102
|
| `session_end` | a run ends (legacy engine) | `provider`, `duration` (seconds), `iterations` (count), `result` (exit code 0 to 255) |
|
|
103
103
|
| `dashboard_start` | the dashboard starts | none |
|
|
104
104
|
| `first_start_attempted` | first `loki start`, strict opt-in (section 4) | `entry` (a known loki subcommand, else `other`) |
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -18,7 +18,7 @@ npm install -g @anthropic-ai/claude-code
|
|
|
18
18
|
claude auth login
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The other supported coding CLI, opencode, is optional (any model, including OpenRouter). Full list:
|
|
22
22
|
[INSTALLATION.md](INSTALLATION.md).
|
|
23
23
|
|
|
24
24
|
## 2. Set up
|
|
@@ -101,7 +101,7 @@ time. Use `loki quick "<task>"` when you want a verify loop.
|
|
|
101
101
|
loki models --local # finds Ollama, LM Studio, llama.cpp, vLLM
|
|
102
102
|
LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md
|
|
103
103
|
LOKI_MODEL_ROUTE=openrouter/deepseek/deepseek-v3.2 loki start prd.md # needs OPENROUTER_API_KEY
|
|
104
|
-
loki start --provider
|
|
104
|
+
loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 prd.md # opencode via OpenRouter
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
Routes: `openrouter`, `ollama`, `lmstudio`, `llamacpp`, `vllm`, and `custom`
|
package/docs/TOOLS.md
CHANGED
|
@@ -737,9 +737,9 @@ $ python3 tools/probe-model-catalog.py
|
|
|
737
737
|
To adopt a new model: edit providers/model_catalog.json -> bump latest_<tier>
|
|
738
738
|
and add to models[]. Then re-run this script to confirm it disappears from new_candidates.
|
|
739
739
|
```
|
|
740
|
-
`--strict` exits nonzero when new models are found. Note it still
|
|
741
|
-
|
|
742
|
-
adoptable.
|
|
740
|
+
`--strict` exits nonzero when new models are found. Note it may still probe
|
|
741
|
+
sections for removed providers; Loki supports only claude and opencode, so
|
|
742
|
+
those candidates are not adoptable.
|
|
743
743
|
|
|
744
744
|
### `regen-state-machine-refs.py`
|
|
745
745
|
|
package/docs/air-gapped.md
CHANGED
|
@@ -77,13 +77,13 @@ paths.
|
|
|
77
77
|
|
|
78
78
|
**We cannot run a build with no model at all.** Nobody can. What we can do is
|
|
79
79
|
let you point at a model you host. Only a local-weights provider clears the
|
|
80
|
-
required line: opencode
|
|
81
|
-
id in
|
|
80
|
+
required line: opencode with an `ollama/` or `lmstudio/` model
|
|
81
|
+
id in its own variable (for example
|
|
82
82
|
`LOKI_OPENCODE_MODEL=ollama/qwen2.5-coder`). An Ollama cloud model (a `:cloud`
|
|
83
83
|
or `-cloud` tag) runs on ollama.com and is still reported as required. The
|
|
84
84
|
verdict comes from the model id; the audit does not read where your Ollama or
|
|
85
85
|
LM Studio endpoint listens, so confirm that yourself. An in-network gateway for
|
|
86
|
-
claude
|
|
86
|
+
claude (`ANTHROPIC_BASE_URL`) keeps traffic inside
|
|
87
87
|
your network, but the audit still counts it as required egress.
|
|
88
88
|
|
|
89
89
|
Telemetry is ON by default for an individual interactive install and auto-off
|
|
@@ -12,9 +12,6 @@ Best for: contributors, development, or environments without npm/brew.
|
|
|
12
12
|
# Clone to Claude Code skills directory
|
|
13
13
|
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
14
14
|
|
|
15
|
-
# Optionally symlink for other providers:
|
|
16
|
-
ln -sf ~/.claude/skills/loki-mode ~/.codex/skills/loki-mode
|
|
17
|
-
|
|
18
15
|
# Optionally add CLI to PATH:
|
|
19
16
|
ln -sf ~/.claude/skills/loki-mode/bin/loki /usr/local/bin/loki
|
|
20
17
|
```
|
|
@@ -75,7 +72,7 @@ jobs:
|
|
|
75
72
|
```
|
|
76
73
|
|
|
77
74
|
**Prerequisites:**
|
|
78
|
-
- API key for your provider (set as repository secret): `ANTHROPIC_API_KEY` (Claude, recommended) or `
|
|
75
|
+
- API key for your provider (set as repository secret): `ANTHROPIC_API_KEY` (Claude, recommended) or `OPENROUTER_API_KEY` (opencode with an OpenRouter model).
|
|
79
76
|
- The action auto-installs `loki-mode` and `@anthropic-ai/claude-code`
|
|
80
77
|
|
|
81
78
|
**Action Inputs:**
|
|
@@ -83,7 +80,7 @@ jobs:
|
|
|
83
80
|
| Input | Default | Description |
|
|
84
81
|
|-------|---------|-------------|
|
|
85
82
|
| `mode` | `review` | `review`, `fix`, or `test` |
|
|
86
|
-
| `provider` | `claude` | `claude` (recommended)
|
|
83
|
+
| `provider` | `claude` | `claude` (recommended) or `opencode`. codex, cline, aider and gemini were removed and exit 2. |
|
|
87
84
|
| `budget_limit` | `5.00` | Max cost in USD (passed to the Loki 10 engine as `--max-cost`) |
|
|
88
85
|
| `max_iterations` | `3` | Max RARV cycles |
|
|
89
86
|
| `github_token` | (required) | GitHub token for PR comments |
|
|
@@ -137,7 +134,8 @@ A first task is ready when every required "All paths" item is present and at lea
|
|
|
137
134
|
|
|
138
135
|
- Claude Code CLI path: the default. `loki start` runs the `claude` binary you installed and logged in with `claude auth login`. `loki chat` (with the claude provider) and `loki edit` call the `claude` CLI directly.
|
|
139
136
|
- Anthropic API-key path (Agent SDK, no `claude` CLI): `loki "<goal>"` needs only Anthropic credentials (for example `ANTHROPIC_API_KEY`), the bundled `@anthropic-ai/claude-agent-sdk` platform binary, and Bun. No `claude` CLI and no extra setting: the engine runs every session on the bundled SDK unless `LOKI_E10_INVOKER=cli`. `loki start ./prd.md` runs the same engine for a PRD up to 100000 bytes. A provider CLI on PATH is still needed by `loki demo` and `loki quickstart` (their provider check runs before the run starts), and by anything that reaches the bash loop: `loki start --engine legacy`, a PRD over 100000 bytes, and the `--workspace` / `--deploy` front end. Under `LOKI_SDK_MODE=full` with the claude provider, `--engine legacy` and a PRD over 100000 bytes are refused in one line instead.
|
|
140
|
-
-
|
|
137
|
+
- opencode CLI path: `opencode` replaces the `claude` CLI for `loki start --provider opencode` and reaches any model, including OpenRouter (see [opencode with OpenRouter](#opencode-with-openrouter)). Loki never silently substitutes a different provider than the one requested.
|
|
138
|
+
- Removed: codex, cline, aider and gemini. Selecting one exits 2 with one line naming claude and opencode.
|
|
141
139
|
|
|
142
140
|
### Install methods
|
|
143
141
|
|
|
@@ -190,13 +188,10 @@ loki "<goal>" runs on the bundled Agent SDK over HTTPS with only a key; no claud
|
|
|
190
188
|
|
|
191
189
|
### Other provider CLIs
|
|
192
190
|
|
|
193
|
-
|
|
191
|
+
opencode: replaces the claude CLI and reaches any model, including OpenRouter.
|
|
194
192
|
|
|
195
193
|
| Requirement | Level | Check | Fix |
|
|
196
194
|
| --- | --- | --- | --- |
|
|
197
|
-
| codex CLI | optional | `codex` on PATH | npm install -g @openai/codex |
|
|
198
|
-
| cline CLI | optional | `cline` on PATH | npm install -g cline |
|
|
199
|
-
| aider CLI | optional | `aider` on PATH | pip install aider-chat |
|
|
200
195
|
| opencode CLI | optional | `opencode` on PATH | npm install -g opencode-ai |
|
|
201
196
|
|
|
202
197
|
### When an optional dependency is missing
|
|
@@ -208,6 +203,21 @@ codex (degraded), cline, aider, opencode: any one replaces the claude CLI.
|
|
|
208
203
|
|
|
209
204
|
<!-- END GENERATED REQUIREMENTS -->
|
|
210
205
|
|
|
206
|
+
### opencode with OpenRouter
|
|
207
|
+
|
|
208
|
+
Supported providers are Claude Code (`--provider claude`, the default; API-key users run it through the Anthropic Agent SDK with no CLI) and opencode (`--provider opencode`). opencode reaches OpenRouter directly:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm install -g opencode-ai
|
|
212
|
+
export OPENROUTER_API_KEY=sk-or-... # or: opencode auth login, then choose OpenRouter
|
|
213
|
+
opencode models openrouter | head # lists openrouter/<vendor>/<model> ids
|
|
214
|
+
loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 ./prd.md
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Without the key, `opencode models openrouter` reports `Provider not found: openrouter`. `LOKI_OPENCODE_MODEL=openrouter/<vendor>/<model>` sets the model without the flag. Loki passes `OPENROUTER_API_KEY` through unchanged and runs `opencode run --auto -m <model> <prompt>`.
|
|
218
|
+
|
|
219
|
+
The Claude path can reach OpenRouter too, through a model route: `loki start --model openrouter/<id> ./prd.md` with `--provider claude` (or `LOKI_MODEL_ROUTE=openrouter/<id>`) points the claude CLI at OpenRouter with `OPENROUTER_API_KEY`.
|
|
220
|
+
|
|
211
221
|
### Install smoke test
|
|
212
222
|
|
|
213
223
|
`scripts/smoke-install.sh` packs the repository, installs the tarball into a temporary prefix, and runs `loki --version`, `loki doctor --json` and `loki route "add a health endpoint" --json`. It then repeats with Bun and the optional Agent SDK hidden. It is run by hand, is not part of CI, and writes a reproducible log. A run on one machine is evidence for that machine and OS only; it is not an OS matrix.
|
package/docs/cost-controls.md
CHANGED
|
@@ -214,9 +214,6 @@ One table in `loki-ts/src/providers/provider_guard.ts` (`CAPABILITIES`) records
|
|
|
214
214
|
| provider | engine | cost | budget kill | cancel (pgroup) | sandbox flags | receipt | resume | guard scan | kill blocking |
|
|
215
215
|
|---|---|---|---|---|---|---|---|---|---|
|
|
216
216
|
| claude | engine10 | measured | post-iteration | yes | none | yes | yes | native | native |
|
|
217
|
-
| codex | engine10 | estimated | post-iteration | yes | --sandbox workspace-write | yes | no | post-iteration | none |
|
|
218
|
-
| cline | engine10 | estimated | post-iteration | yes | none | yes | no | post-iteration | none |
|
|
219
|
-
| aider | engine10 | estimated | post-iteration | yes | --no-auto-commits | yes | no | post-iteration | none |
|
|
220
217
|
| opencode | engine10 | none | none | yes | none | yes | no | post-iteration | none |
|
|
221
218
|
|
|
222
219
|
### Parallel units and groups
|
|
@@ -172,7 +172,7 @@ Command shape: `bin/loki route start <input> --json`. The representative inputs
|
|
|
172
172
|
| `acme/widgets#42` (issue ref) | issue | engine10 | engine10:claude |
|
|
173
173
|
| `./api.yaml` and `./api.json` (OpenAPI/JSON spec) | prd | engine10 | engine10:claude |
|
|
174
174
|
| `./prd.md --resume` (flagged) | prd | engine10 | engine10:claude |
|
|
175
|
-
| `./prd.md --provider
|
|
175
|
+
| `./prd.md --provider opencode` (flagged, other provider) | prd | engine10 | engine10:opencode |
|
|
176
176
|
| `./prd.md --engine legacy` (legacy-mode flag) | prd | legacy | legacy-bash:claude (runs `autonomy/run.sh`) |
|
|
177
177
|
|
|
178
178
|
Other flag outcomes from the same probe: `--parallel` and `--legacy` are refused on the default engine with a message pointing to `loki queue run --parallel K` or `--engine legacy`. `LOKI_LEGACY_BASH=1 loki route ...` answers `Unknown command: route` because that rollback flag forces every command through bash, which has no `route`. Every default-path input lands on engine10; the bash loop is reachable only through an explicit `--engine legacy` (or `LOKI_ENGINE=legacy`) and the `LOKI_LEGACY_BASH=1` rollback.
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
SKILL.md # Slim core skill (~410 lines) - progressive disclosure
|
|
7
7
|
providers/ # Multi-provider support (5 providers)
|
|
8
8
|
claude.sh # Claude Code - full features (Tier 1)
|
|
9
|
-
cline.sh # Cline - Tier 2
|
|
10
|
-
codex.sh # OpenAI Codex CLI - degraded mode (Tier 3)
|
|
11
|
-
aider.sh # Aider - degraded mode (Tier 3)
|
|
12
9
|
opencode.sh # opencode - model-agnostic mode
|
|
13
10
|
loader.sh # Provider loader utility
|
|
14
11
|
models.sh # Model name registry
|
|
@@ -116,7 +113,7 @@ Verified against v7.5.13 source on 2026-04-29. Line numbers drift; re-verify wit
|
|
|
116
113
|
|
|
117
114
|
### Critical Data Flow
|
|
118
115
|
|
|
119
|
-
A PRD enters via `loki start` (`autonomy/loki:622`), which execs `run.sh`. The `run_autonomous()` loop (`autonomy/run.sh:10253`) builds prompts via `build_prompt()` (`autonomy/run.sh:8987`) injecting RARV instructions, SDLC phases, memory context, queue tasks, and checklist status. The provider is invoked (Claude via `-p` flag,
|
|
116
|
+
A PRD enters via `loki start` (`autonomy/loki:622`), which execs `run.sh`. The `run_autonomous()` loop (`autonomy/run.sh:10253`) builds prompts via `build_prompt()` (`autonomy/run.sh:8987`) injecting RARV instructions, SDLC phases, memory context, queue tasks, and checklist status. The provider is invoked (Claude via `-p` flag, opencode via `run --auto -m <provider/model>`). Post-iteration, the system runs checklist verification, app runner management, playwright smoke tests, and code review. Completion is determined by a council vote (`council_should_stop` at `autonomy/completion-council.sh:1605`), completion promise text, or max iterations. All components communicate through `.loki/` filesystem state files.
|
|
120
117
|
|
|
121
118
|
**Deprecated entrypoints:**
|
|
122
119
|
- `loki run <issue-ref>` is a deprecated alias for `loki start <issue-ref>` since v6.84.0. Emits a `cli_command_deprecated` telemetry event. See `autonomy/loki:4436-4456`. Prefer `loki start`.
|
|
@@ -23,7 +23,7 @@ with nowhere to look them up.
|
|
|
23
23
|
|---|---|---|
|
|
24
24
|
| `LOKI_PRD_FILE` | none | Path to a spec file, as an alternative to the positional argument. |
|
|
25
25
|
| `LOKI_MAX_ITERATIONS` | `1000` | Hard cap on iterations. Reaching it is a deterministic terminal failure, not a success. Also in `config schema`. |
|
|
26
|
-
| `LOKI_BUDGET_LIMIT` | `100.00` | Spend cap in USD on the previous loop (the Loki 10 engine uses `--max-cost`, `budgets.per_run` or a default of $100 only when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set; none on a subscription). Also enforced by kill on
|
|
26
|
+
| `LOKI_BUDGET_LIMIT` | `100.00` | Spend cap in USD on the previous loop (the Loki 10 engine uses `--max-cost`, `budgets.per_run` or a default of $100 only when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set; none on a subscription). Also enforced by kill on opencode in the Loki 10 engine. Breaching it **pauses** the run (writes `.loki/PAUSE` and saves state); it never kills work or discards a deliverable. Remove `.loki/PAUSE` to resume, or raise the cap. Set to `""` for no cap. A warning is logged at 80%. |
|
|
27
27
|
| `LOKI_MAX_DURATION` | unset (no cap) | Wall-clock cap in seconds. Stops cleanly at the next iteration boundary with a `max_duration_reached` terminal status. `loki start --max-duration` also accepts `90m` / `2h`. |
|
|
28
28
|
| `LOKI_AUTO_CONFIRM` | unset | `true`/`false` to control prompts. Takes precedence over `CI`. |
|
|
29
29
|
| `LOKI_CONFIG_DUMP` | `0` | `1` prints the resolved configuration and exits **without starting a run or spending anything**. |
|
|
@@ -38,7 +38,7 @@ interact and why hitting one is a failure rather than a success.
|
|
|
38
38
|
|
|
39
39
|
| Variable | Default | Effect |
|
|
40
40
|
|---|---|---|
|
|
41
|
-
| `LOKI_PROVIDER` | `claude` | `claude
|
|
41
|
+
| `LOKI_PROVIDER` | `claude` | `claude` or `opencode`. `codex`, `cline`, `aider` and `gemini` were removed and exit 2 with a migration line. |
|
|
42
42
|
| `LOKI_SESSION_MODEL` | `medium` | The capability tier for the run: `small`, `medium`, or `high`. See below. |
|
|
43
43
|
| `LOKI_MAX_TIER` | unlimited | Caps model tier, so a run cannot escalate past what you are willing to pay for. |
|
|
44
44
|
| `LOKI_MODEL_OVERRIDE` | unset | Overrides the resolved model outright. A route spec (`ollama/<id>`) works too. |
|
|
@@ -61,11 +61,11 @@ interact and why hitting one is a failure rather than a success.
|
|
|
61
61
|
You do not need to know any vendor's model names. Ask for a capability class
|
|
62
62
|
and each provider supplies its own latest model in that class:
|
|
63
63
|
|
|
64
|
-
| Tier | Means | Claude |
|
|
65
|
-
|
|
66
|
-
| `small` | cheap and fast | `claude-haiku-4-5` |
|
|
67
|
-
| `medium` | the workhorse (**default**) | `claude-sonnet-5` |
|
|
68
|
-
| `high` | the most capable | `claude-opus-4-8` |
|
|
64
|
+
| Tier | Means | Claude | opencode |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| `small` | cheap and fast | `claude-haiku-4-5` | `deepseek-chat` |
|
|
67
|
+
| `medium` | the workhorse (**default**) | `claude-sonnet-5` | `deepseek-v3.2` |
|
|
68
|
+
| `high` | the most capable | `claude-opus-4-8` | `deepseek-v3.2` |
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
LOKI_SESSION_MODEL=small loki start ./prd.md # or: loki start --session-model small ./prd.md
|
|
@@ -79,9 +79,7 @@ use, so setting it explicitly changes nothing. The older spellings
|
|
|
79
79
|
**To see what a tier actually resolves to on your machine, run `loki provider
|
|
80
80
|
models`.** It prints the dispatched model per tier per provider along with
|
|
81
81
|
which environment variable set it, so you can verify what you will really get
|
|
82
|
-
rather than trusting the table above.
|
|
83
|
-
default: it sends no `--model` flag and lets Codex pick a model appropriate to
|
|
84
|
-
your account, because a hardcoded name breaks ChatGPT-account users.
|
|
82
|
+
rather than trusting the table above.
|
|
85
83
|
|
|
86
84
|
Override a single tier for one provider with `LOKI_<PROVIDER>_MODEL_<TIER>`
|
|
87
85
|
(for example `LOKI_CLAUDE_MODEL_FAST=claude-haiku-4-5`), or every tier at once
|
package/docs/exit-codes.md
CHANGED
|
@@ -442,6 +442,11 @@ The JSON carries `engine`, `adapter`, `provider`, `model`, `input_type`, `input`
|
|
|
442
442
|
- Default engine is `engine10` for a PRD file (`.md`, `.json`, `.yaml`), an issue reference (`owner/repo#N` or an issue URL), a multi-word task and a one-word brief.
|
|
443
443
|
- The legacy engine runs only on `--engine legacy` or `LOKI_ENGINE=legacy`, or for a PRD larger than 100000 bytes (engine10 carries the task in single strings, capped at 128 KiB on Linux). Under `LOKI_SDK_MODE=full`, `LOKI_SDK=full` or `LOKI_SDK_LOOP=1` with the claude provider, each of these exits 2 with one line instead: the bash loop has no SDK path. A flag engine10 does not support, a provider with no engine10 invoker, and a machine with no working bun each exit 2 with the fix. Inside a repository, `loki start` or `loki quick` with no task exits 64 with the `loki "<goal>"` usage (after offering to resume an interrupted run); outside one, a bare `loki start` shows the offline sample receipt and exits 0.
|
|
444
444
|
- `--engine engine10` with an unsupported flag is refused (exit 2) instead of rerouted.
|
|
445
|
+
- A removed provider (`codex`, `cline`, `aider`, `gemini`), from `--provider` or `LOKI_PROVIDER`, exits 2 before any routing, for every command, with one line:
|
|
446
|
+
|
|
447
|
+
```
|
|
448
|
+
loki: provider 'codex' is no longer supported. Supported providers: claude (Claude Code CLI, or an Anthropic API key through the Agent SDK) and opencode (any model, including OpenRouter via OPENROUTER_API_KEY). Switch with --provider claude or --provider opencode, or unset LOKI_PROVIDER.
|
|
449
|
+
```
|
|
445
450
|
- A missing PRD file path is a usage error (exit 2).
|
|
446
451
|
- Adapter is `<engine>:<provider>`, with the legacy engine written `legacy-bash:<provider>`.
|
|
447
452
|
- Claude Code is the primary provider. The `loki chat` surface does not use this router; it is a separate interactive entry point.
|
|
@@ -468,11 +473,6 @@ The table below is rendered from live `loki route --json` output.
|
|
|
468
473
|
| `start owner/repo#5 --provider claude` | engine10 | engine10:claude | none | default: issue input runs on engine10 regardless of flag order |
|
|
469
474
|
| `start https://github.com/owner/repo/issues/5` | engine10 | engine10:claude | none | default: issue input runs on engine10 regardless of flag order |
|
|
470
475
|
| `start hello` | engine10 | engine10:claude | none | default: brief input runs on engine10 regardless of flag order |
|
|
471
|
-
| `start p.md --provider codex` | engine10 | engine10:codex | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
472
|
-
| `start --provider codex p.md` | engine10 | engine10:codex | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
473
|
-
| `LOKI_PROVIDER=codex start p.md` | engine10 | engine10:codex | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
474
|
-
| `start p.md --provider cline` | engine10 | engine10:cline | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
475
|
-
| `start p.md --provider aider` | engine10 | engine10:aider | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
476
476
|
| `start p.md --provider opencode` | engine10 | engine10:opencode | 1 listed | default: prd input runs on engine10 regardless of flag order |
|
|
477
477
|
| `start p.md --engine legacy` | legacy | legacy-bash:claude | 1 listed | explicit: --engine legacy or LOKI_ENGINE=legacy |
|
|
478
478
|
| `start --engine legacy p.md` | legacy | legacy-bash:claude | 1 listed | explicit: --engine legacy or LOKI_ENGINE=legacy |
|
package/docs/network-security.md
CHANGED
|
@@ -46,12 +46,9 @@ iptables -A DOCKER-USER -p tcp --dport 53 -j ACCEPT
|
|
|
46
46
|
# Allow HTTPS to AI API endpoints only
|
|
47
47
|
# Anthropic (Claude)
|
|
48
48
|
iptables -A DOCKER-USER -d api.anthropic.com -p tcp --dport 443 -j ACCEPT
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
-
#
|
|
52
|
-
# and opencode are model-agnostic, so their endpoints depend on your config.
|
|
53
|
-
# The Gemini rule that used to sit here was removed with the provider (v7.5.18);
|
|
54
|
-
# do not re-add an allowlist entry for a provider you are not running.
|
|
49
|
+
# Add one rule per endpoint your chosen provider actually calls. opencode is
|
|
50
|
+
# model-agnostic, so its endpoint depends on your config (for OpenRouter:
|
|
51
|
+
# openrouter.ai). Do not add an allowlist entry for a provider you are not running.
|
|
55
52
|
|
|
56
53
|
# Drop all other outbound traffic from the isolated network
|
|
57
54
|
iptables -A DOCKER-USER -s 172.28.0.0/16 -j DROP
|
package/docs/v10/GUIDE.md
CHANGED
|
@@ -23,7 +23,7 @@ before the routing decision, so these all run on Loki 10:
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
loki start prd.md loki start --no-pr prd.md
|
|
26
|
-
loki start owner/repo#123 loki start --provider
|
|
26
|
+
loki start owner/repo#123 loki start --provider opencode owner/repo#123
|
|
27
27
|
loki start "fix the login bug" loki start --no-pr "fix the login bug"
|
|
28
28
|
loki start fixit loki quick -v "fix the login bug"
|
|
29
29
|
```
|
|
@@ -43,8 +43,14 @@ empty folder they create the repository first.
|
|
|
43
43
|
|
|
44
44
|
A flag Loki 10 does not support (for example `--simple`, `--parallel`,
|
|
45
45
|
`--github`, `--sandbox`, `--max-iterations`) is refused with exit 2 and a line
|
|
46
|
-
naming its replacement. A provider other than claude
|
|
47
|
-
|
|
46
|
+
naming its replacement. A provider other than claude or opencode, or a
|
|
47
|
+
machine with no working bun, also exits 2 with the fix. The removed providers
|
|
48
|
+
(codex, cline, aider, gemini) exit 2 with one line, from `--provider` or
|
|
49
|
+
`LOKI_PROVIDER`, for every command:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
loki: provider 'codex' is no longer supported. Supported providers: claude (Claude Code CLI, or an Anthropic API key through the Agent SDK) and opencode (any model, including OpenRouter via OPENROUTER_API_KEY). Switch with --provider claude or --provider opencode, or unset LOKI_PROVIDER.
|
|
53
|
+
```
|
|
48
54
|
|
|
49
55
|
The previous loop (autonomy/run.sh) runs only when you pass `--engine legacy`
|
|
50
56
|
or set `LOKI_ENGINE=legacy` (the flag wins over the variable), or when the PRD
|
|
@@ -101,8 +107,9 @@ loki quick "fix the login redirect loop"
|
|
|
101
107
|
```
|
|
102
108
|
|
|
103
109
|
If bun is not installed, or LOKI_PROVIDER names a provider the v10 engine
|
|
104
|
-
has no invoker for (anything but claude
|
|
105
|
-
|
|
110
|
+
has no invoker for (anything but claude or opencode), these entry points exit 2
|
|
111
|
+
with the fix; a removed provider (codex, cline, aider, gemini) prints the
|
|
112
|
+
migration line above.
|
|
106
113
|
|
|
107
114
|
Issue refs work the same way:
|
|
108
115
|
|
|
@@ -196,8 +203,8 @@ Define child agents as markdown with YAML frontmatter in `.loki/agents/<name>.md
|
|
|
196
203
|
over a user agent of the same name. The body is the system prompt.
|
|
197
204
|
|
|
198
205
|
Frontmatter keys: `name` (must equal the file name without `.md`),
|
|
199
|
-
`description` (required), `model`, `provider` (`claude` by default
|
|
200
|
-
`
|
|
206
|
+
`description` (required), `model`, `provider` (`claude` by default, or
|
|
207
|
+
`opencode`), `tools` (allow list), `deny` (deny list) and
|
|
201
208
|
`permission` (`plan` default, `edit` or `full`).
|
|
202
209
|
|
|
203
210
|
```
|
|
@@ -246,7 +253,7 @@ loki doctor --fix # create state dirs and a default config; prints exact com
|
|
|
246
253
|
loki config list # also: get <key>, set <key> <value>, path
|
|
247
254
|
```
|
|
248
255
|
|
|
249
|
-
`loki setup` flags: `--provider claude|
|
|
256
|
+
`loki setup` flags: `--provider claude|opencode`,
|
|
250
257
|
`--model`, `--budget USD` and `--global`. `loki doctor --fix` never installs
|
|
251
258
|
system packages and never runs sudo. Prerequisites are in
|
|
252
259
|
[INSTALLATION.md](../INSTALLATION.md).
|
|
@@ -404,38 +411,24 @@ receipt with no signing key configured (or a key that failed to load) reads
|
|
|
404
411
|
| Provider | Cost measured | Spend cap enforced | Guardrail scan | Kill blocking enforced |
|
|
405
412
|
|----------|---------------|--------------------|----------------|------------------------|
|
|
406
413
|
| claude | yes (provider-reported) | yes | native | yes |
|
|
407
|
-
| codex | yes (parsed or estimated) | yes | yes | no |
|
|
408
|
-
| cline | yes (parsed or estimated) | yes | yes | no |
|
|
409
|
-
| aider | yes (reported or estimated) | yes | yes | no |
|
|
410
414
|
| opencode | no | no (cost not measured); wall clock limit still applies | yes | no |
|
|
411
415
|
|
|
412
|
-
Claude Code is the default and the only Tier-1 provider
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
(aider's `Cost: $X session` line is used as-is). If the CLI prints no usage,
|
|
419
|
-
cost is estimated from prompt and response sizes (about 4 characters per
|
|
420
|
-
token) with the built-in price table (`loki-ts/src/providers/price_table.ts`).
|
|
421
|
-
A model not in the table prices at a mid-range default of $2 per 1M input
|
|
422
|
-
tokens and $10 per 1M output tokens. Estimated figures carry `estimated: true`
|
|
423
|
-
and `cost_basis` (`provider-tokens` or `size-estimate`) on the `cost` event in
|
|
424
|
-
`events.jsonl`, and the efficiency record has `cost_source: "estimated"`.
|
|
425
|
-
Estimates are approximate. The cap in `--max-cost` applies unchanged. A run
|
|
426
|
-
with no prompt and no output stays `not measured`, never `$0.00`.
|
|
416
|
+
Claude Code is the default and the only Tier-1 provider. It runs through the
|
|
417
|
+
`claude` CLI, or, for API-key users, through the Anthropic Agent SDK
|
|
418
|
+
(`@anthropic-ai/claude-agent-sdk`) with `ANTHROPIC_API_KEY`; both are
|
|
419
|
+
`--provider claude`. opencode is the optional model-agnostic provider. Select
|
|
420
|
+
one with `--provider <name>` or `LOKI_PROVIDER`. codex, cline, aider and gemini
|
|
421
|
+
were removed.
|
|
427
422
|
|
|
428
423
|
### Guardrails on non-Claude providers
|
|
429
424
|
|
|
430
|
-
With
|
|
425
|
+
With opencode, engine10 enforces the wall-clock limit
|
|
431
426
|
and `BUDGET_LIMIT` (for example `BUDGET_LIMIT=5 loki start prd.md`) by killing
|
|
432
427
|
the process group. After each iteration it scans the diff and reverts and
|
|
433
428
|
fails the iteration on mass deletion of tracked files, `.git/config` changes,
|
|
434
429
|
new git hooks, and symlinks or paths outside the project (a `guard.violation`
|
|
435
|
-
event).
|
|
436
|
-
|
|
437
|
-
opencode have no sandbox flag. The scan is post-hoc rather than inline, so
|
|
438
|
-
receipts still list `kill blocking not enforced` for these providers.
|
|
430
|
+
event). opencode has no sandbox flag. The scan is post-hoc rather than
|
|
431
|
+
inline, so receipts still list `kill blocking not enforced` for opencode.
|
|
439
432
|
|
|
440
433
|
For opencode, a run's Cost line reads `not measured` and the NOT PROVEN line
|
|
441
434
|
adds the literal entry `kill blocking not enforced`
|
|
@@ -446,14 +439,32 @@ engine10 provider (`loki-ts/src/runner/provider_opencode.ts`): install it with
|
|
|
446
439
|
`LOKI_OPENCODE_MODEL` (for example `openrouter/deepseek/deepseek-v3.2`; unset
|
|
447
440
|
uses opencode's own default), passes extra flags from `LOKI_OPENCODE_FLAGS`,
|
|
448
441
|
and honors `LOKI_OPENCODE_CLI` for the binary path. `LOKI_HOST_GUARD=1` is
|
|
449
|
-
incompatible with
|
|
442
|
+
incompatible with opencode.
|
|
443
|
+
|
|
444
|
+
#### opencode with OpenRouter
|
|
445
|
+
|
|
446
|
+
opencode reads `OPENROUTER_API_KEY` from the environment (or stores it once
|
|
447
|
+
with `opencode auth login`, choosing OpenRouter). With the key set,
|
|
448
|
+
`opencode models openrouter` lists the OpenRouter models as
|
|
449
|
+
`openrouter/<vendor>/<model>`; without it opencode reports
|
|
450
|
+
`Provider not found: openrouter`. Loki passes the key through unchanged and
|
|
451
|
+
runs `opencode run --auto -m <model> <prompt>`:
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
export OPENROUTER_API_KEY=sk-or-...
|
|
455
|
+
loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 ./prd.md
|
|
456
|
+
LOKI_OPENCODE_MODEL=openrouter/<vendor>/<model> loki start --provider opencode ./prd.md
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
With `--provider opencode`, any `--model` value (including `openrouter/...`)
|
|
460
|
+
becomes opencode's `-m` model.
|
|
450
461
|
|
|
451
462
|
### Model routes and local models
|
|
452
463
|
|
|
453
464
|
To run OpenRouter or a local model through the Claude harness, so every
|
|
454
465
|
Tier-1 control (cost, kill blocking, receipts) still applies, set
|
|
455
|
-
`LOKI_MODEL_ROUTE=<kind>/<id>` before `loki start
|
|
456
|
-
|
|
466
|
+
`LOKI_MODEL_ROUTE=<kind>/<id>` before `loki start`, or pass
|
|
467
|
+
`--model <kind>/<id>` with `--provider claude` (the default).
|
|
457
468
|
|
|
458
469
|
```
|
|
459
470
|
LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md
|
|
@@ -79,7 +79,7 @@ Example pipeline:
|
|
|
79
79
|
|
|
80
80
|
| Env Var | Description | Default |
|
|
81
81
|
|---------|-------------|---------|
|
|
82
|
-
| LOKI_PROVIDER | AI provider (claude/
|
|
82
|
+
| LOKI_PROVIDER | AI provider (claude/opencode) | claude |
|
|
83
83
|
| LOKI_BUDGET_LIMIT | Cost limit in USD | unlimited |
|
|
84
84
|
| LOKI_MAX_PARALLEL_AGENTS | Max concurrent agents | 10 |
|
|
85
85
|
| LOKI_COMPLEXITY | Force complexity tier (simple/standard/complex) | auto |
|
|
@@ -13,7 +13,7 @@ description: "Launch Loki Mode autonomous SDLC agent. Handles PRD-to-deployment
|
|
|
13
13
|
|
|
14
14
|
## Prerequisites
|
|
15
15
|
- `loki` CLI installed on the host (via `npm install -g loki-mode` or Homebrew)
|
|
16
|
-
- One of: Claude Code
|
|
16
|
+
- One of: Claude Code or opencode installed
|
|
17
17
|
- Corresponding API key set (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY)
|
|
18
18
|
|
|
19
19
|
## How to invoke
|
|
@@ -28,7 +28,7 @@ Key flags:
|
|
|
28
28
|
- `--bg`: Background mode (session outlives the tool call)
|
|
29
29
|
- `--yes`: Skip confirmation prompts
|
|
30
30
|
- `--no-dashboard`: Avoid port conflicts in sandboxed environments
|
|
31
|
-
- `--provider <claude|
|
|
31
|
+
- `--provider <claude|opencode>`: Select AI provider (default: claude)
|
|
32
32
|
- `--budget <amount>`: Set cost limit in USD (auto-pause when exceeded)
|
|
33
33
|
|
|
34
34
|
### Monitor progress
|
|
@@ -42,7 +42,7 @@ The JSON output contains:
|
|
|
42
42
|
- `status`: inactive, running, paused, stopped, completed, unknown
|
|
43
43
|
- `phase`: Current SDLC phase (e.g., BOOTSTRAP, DISCOVERY, ARCHITECTURE, DEVELOPMENT, QA, DEPLOYMENT)
|
|
44
44
|
- `iteration`: Current iteration number
|
|
45
|
-
- `provider`: Which AI provider is active (claude,
|
|
45
|
+
- `provider`: Which AI provider is active (claude, opencode)
|
|
46
46
|
- `pid`: Process ID of the running session (null if not running)
|
|
47
47
|
- `elapsed_time`: Seconds since session start
|
|
48
48
|
- `dashboard_url`: URL of the web dashboard (null if disabled)
|
package/learning/emit.sh
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
# Examples:
|
|
49
49
|
# # User preference signal
|
|
50
50
|
# ./emit.sh user_preference --source cli --action "provider_selection" \
|
|
51
|
-
# --key "provider" --value "claude" --rejected '["
|
|
51
|
+
# --key "provider" --value "claude" --rejected '["opencode"]'
|
|
52
52
|
#
|
|
53
53
|
# # Error pattern signal
|
|
54
54
|
# ./emit.sh error_pattern --source cli --action "cmd_start" \
|
|
@@ -8,16 +8,12 @@
|
|
|
8
8
|
"LOKI_CLAUDE_MODEL_FAST",
|
|
9
9
|
"LOKI_CLAUDE_MODEL_PLANNING",
|
|
10
10
|
"LOKI_CLAUDE_TASK_BUDGET",
|
|
11
|
-
"LOKI_CODEX_MODEL",
|
|
12
|
-
"LOKI_CODEX_REASONING_EFFORT",
|
|
13
|
-
"LOKI_CODEX_WEB_SEARCH",
|
|
14
11
|
"LOKI_COMPLEXITY",
|
|
15
12
|
"LOKI_COUNCIL_ENABLED",
|
|
16
13
|
"LOKI_COUNCIL_SIZE",
|
|
17
14
|
"LOKI_COUNCIL_TIMEOUT_MS",
|
|
18
15
|
"LOKI_ENTERPRISE_AUTH",
|
|
19
16
|
"LOKI_FIRST_PASS_EXCELLENCE",
|
|
20
|
-
"LOKI_GEMINI_MODEL",
|
|
21
17
|
"LOKI_HOST_GUARD",
|
|
22
18
|
"LOKI_HOST_GUARD_SETTINGS_JSON",
|
|
23
19
|
"LOKI_LEGACY_BASH",
|
|
@@ -41,8 +37,6 @@
|
|
|
41
37
|
"LOKI_ADVISOR_SCOPE",
|
|
42
38
|
"LOKI_AGENTS_PROJECT_DIR",
|
|
43
39
|
"LOKI_AGENTS_USER_DIR",
|
|
44
|
-
"LOKI_AIDER_FLAGS",
|
|
45
|
-
"LOKI_AIDER_MODEL",
|
|
46
40
|
"LOKI_AI_MARKING",
|
|
47
41
|
"LOKI_ALLOW_AGENT_GITHUB_TOKEN",
|
|
48
42
|
"LOKI_ALLOW_HAIKU",
|
|
@@ -63,10 +57,8 @@
|
|
|
63
57
|
"LOKI_CAVEMAN_USER_MODE",
|
|
64
58
|
"LOKI_CAVEMAN_VERSION",
|
|
65
59
|
"LOKI_CHANGE_TIER",
|
|
66
|
-
"LOKI_CLINE_MODEL",
|
|
67
60
|
"LOKI_CLI_VERSION",
|
|
68
61
|
"LOKI_COCKPIT_PROTOCOL",
|
|
69
|
-
"LOKI_CODEX_OUTPUT_LAST",
|
|
70
62
|
"LOKI_COMMIT_WALL",
|
|
71
63
|
"LOKI_CONFIRM",
|
|
72
64
|
"LOKI_CONTRACT",
|