loki-mode 11.120.0 → 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 +18 -30
- 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 +3 -56
- 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/contract-scaffold/README.md +2 -2
- 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/proof-generator.py +1 -2
- package/autonomy/lib/scaffold-hook.sh +3 -7
- 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 -336
- package/autonomy/migration-agents.sh +1 -1
- package/autonomy/notification-checker.py +2 -2
- 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 +79 -348
- 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/api_v2.py +1 -1
- package/dashboard/build_supervisor.py +1 -5
- package/dashboard/server.py +18 -26
- package/docs/ARCHITECTURE.md +13 -14
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/COMPARE-OPENCODE.md +7 -6
- package/docs/COMPONENTS.md +6 -11
- 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 +9 -13
- 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 -10
- package/loki-ts/data/finding-schema.json +2 -2
- package/loki-ts/dist/cockpit.js +1 -1
- package/loki-ts/dist/loki.js +1348 -1354
- package/magic/core/debate.py +4 -11
- package/magic/core/generator.py +5 -18
- package/mcp/__init__.py +1 -1
- package/mcp/lsp_proxy.py +3 -3
- 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 +27 -56
- package/skills/providers.md +54 -221
- package/skills/quality-gates.md +11 -41
- package/skills/testing.md +1 -1
- package/skills/troubleshooting.md +1 -2
- package/src/integrations/github/action-handler.js +2 -4
- package/src/protocols/tools/start-project.js +1 -1
- package/tools/calibration-audit.py +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-D1_vz1LQ.js → AdminPage-BfxkhFXl.js} +1 -1
- package/web-app/dist/assets/{Avatar-BefQj_9m.js → Avatar-xV4rK0ps.js} +1 -1
- package/web-app/dist/assets/{Badge-BcAowN-N.js → Badge-Ds_E82Ka.js} +1 -1
- package/web-app/dist/assets/{Button-BeVwFkYh.js → Button-BXAwY0ni.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-Q-sO8Psm.js → CockpitPage-y3R9sk_M.js} +1 -1
- package/web-app/dist/assets/ComparePage-BGbCno4C.js +1 -0
- package/web-app/dist/assets/{ErrorBoundary-DdIh2DlF.js → ErrorBoundary-DGqkzHdy.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-cf2Jhgl3.js → EvidenceReceiptPanel-Bj57TWoJ.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-SfgkosoM.js → GitHubIssuesPanel-CVbtUCRI.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-DsUqn99r.js → GitHubPRsPanel-DuNxI0k8.js} +1 -1
- package/web-app/dist/assets/{HomePage-C6PCzqqg.js → HomePage-DogFuRvt.js} +2 -2
- package/web-app/dist/assets/{LoginPage-Bqci5QVa.js → LoginPage-U-r-YNKC.js} +1 -1
- package/web-app/dist/assets/{MagicPage-NO5PIrOb.js → MagicPage-C5iDqK4d.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-B0oveHbr.js → MetricsPage-COVYOGfr.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CDh2DiQC.js → NotFoundPage-CZii6Z0s.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-CrJ_t9m_.js → ProjectPage-QwOZzVqj.js} +25 -25
- package/web-app/dist/assets/{ProjectsPage-UPhA-lpV.js → ProjectsPage-BcxVfXVW.js} +1 -1
- package/web-app/dist/assets/SettingsPage-CBY9JiAE.js +10 -0
- package/web-app/dist/assets/{ShowcasePage-sZmG4qo4.js → ShowcasePage-D1YPQOp7.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-DcpAC9Lg.js +1 -0
- package/web-app/dist/assets/{TeamsPage-DFuLa1I9.js → TeamsPage-BTiJPkD4.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-C_U8lRMD.js → TemplatesPage-LUa3bH-A.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-DdU-3V0-.js → TerminalOutput-BM8LH-RG.js} +1 -1
- package/web-app/dist/assets/{activity-BwXV9-sA.js → activity-mZHuLoR5.js} +1 -1
- package/web-app/dist/assets/{bell-DF148FeB.js → bell-BR_y_nMB.js} +1 -1
- package/web-app/dist/assets/{bot-BM1t71_O.js → bot-Ct3caGMX.js} +1 -1
- package/web-app/dist/assets/{check-DHJPb450.js → check-DuQpq9PN.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DZIgwXb6.js → chevron-left-CWSfVWba.js} +1 -1
- package/web-app/dist/assets/{circle-alert-31lHNmy0.js → circle-alert-C7TCj9Jm.js} +1 -1
- package/web-app/dist/assets/{clock-D4QAxoCy.js → clock-BFsj3bRT.js} +1 -1
- package/web-app/dist/assets/{cloud-Dd2iypzJ.js → cloud-78sYPXff.js} +1 -1
- package/web-app/dist/assets/{code-xml-CnUOPwx8.js → code-xml-DuwBCDz-.js} +1 -1
- package/web-app/dist/assets/{database-Dhpbplpo.js → database-CwRTYKVV.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-DCt7L7Pk.js → dollar-sign-COXAsjgd.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-D2SPiEH7.js → file-code-corner-A8LPVBBy.js} +1 -1
- package/web-app/dist/assets/{file-plus-cCrpp-pe.js → file-plus-D9IXE7YW.js} +1 -1
- package/web-app/dist/assets/{globe-Cn6TYK_z.js → globe-Ce6xgdLR.js} +1 -1
- package/web-app/dist/assets/{hammer-sMLkpUw2.js → hammer-Dtq836Al.js} +1 -1
- package/web-app/dist/assets/{index-Dgb8Kves.js → index-uce16-nn.js} +16 -16
- package/web-app/dist/assets/{layers-DuPguIVU.js → layers-BOQdqOXk.js} +1 -1
- package/web-app/dist/assets/{loader-circle-BBhsXs18.js → loader-circle-D3y4SHAn.js} +1 -1
- package/web-app/dist/assets/{lock-n-qJvU_o.js → lock-miFONHLo.js} +1 -1
- package/web-app/dist/assets/{package-cDxKfjAD.js → package-ckZFIHTG.js} +1 -1
- package/web-app/dist/assets/{plus-COk5sQxp.js → plus-COJKSbOp.js} +1 -1
- package/web-app/dist/assets/{refresh-cw--VKVhvpo.js → refresh-cw-rPt-Oa4a.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-DvZ6KExW.js → rotate-ccw-Dy50K31A.js} +1 -1
- package/web-app/dist/assets/{scroll-text-HRyHuQUy.js → scroll-text-CbczPkkS.js} +1 -1
- package/web-app/dist/assets/{server-CoZSZtid.js → server-HkfTEf2O.js} +1 -1
- package/web-app/dist/assets/{shield-alert--WkXdHlN.js → shield-alert-DjKF0yba.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-YeW2Lb8g.js → thumbs-up-aObjUDQm.js} +1 -1
- package/web-app/dist/assets/{trash-2-DuhNrOPo.js → trash-2-CQfI6Z-c.js} +1 -1
- package/web-app/dist/assets/{trending-down-55EMrZu6.js → trending-down-CP7J5aPV.js} +1 -1
- package/web-app/dist/assets/{trending-up-BaUDEQ-n.js → trending-up-CTJHoPnm.js} +1 -1
- package/web-app/dist/assets/{upload-BrHq6BXI.js → upload-i1zoXd2k.js} +1 -1
- package/web-app/dist/assets/{usePolling-BEtK-_qo.js → usePolling-CZG-IV1Y.js} +1 -1
- package/web-app/dist/assets/{user-DL5XlCBR.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-CiJ3FrSl.js +0 -1
- package/web-app/dist/assets/SettingsPage-DKO1LhLq.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-Drvx9eXK.js +0 -1
package/docs/COMPONENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ purpose, key files, public interface, and dependencies on other components.
|
|
|
6
6
|
Loki Mode is an autonomous spec-to-product system. It takes a spec (PRD, GitHub
|
|
7
7
|
issue, OpenAPI/JSON/YAML, or one-line brief) to a deployed product through the
|
|
8
8
|
RARV-C closure loop (Reason - Act - Reflect - Verify - Close) with 8 quality
|
|
9
|
-
gates. It
|
|
9
|
+
gates. It runs on Claude Code (CLI or Anthropic Agent SDK) and opencode (any model, including OpenRouter).
|
|
10
10
|
|
|
11
11
|
## Component Map
|
|
12
12
|
|
|
@@ -93,10 +93,8 @@ provider abstraction, and metrics.
|
|
|
93
93
|
**Key files:**
|
|
94
94
|
- `src/cli.ts` - CLI entry.
|
|
95
95
|
- `src/version.ts` - Version reporting.
|
|
96
|
-
- `src/runner/` -
|
|
96
|
+
- `src/runner/` - Provider invocation, budget, state and the attempts runner used by the Loki 10 engine.
|
|
97
97
|
- `src/runner/providers.ts` - Provider abstraction with automatic failover.
|
|
98
|
-
- `src/runner/council.ts` - Completion-council hook: convergence tracking, the stagnation and done-signal force-stop valves, and the v8 confidence-spike re-check.
|
|
99
|
-
- `src/runner/goal_score.ts` - Goal-measurability scoring (v8.0.0). Advisory only; flags a goal the loop cannot hill-climb. Byte-mirrored in `autonomy/run.sh`.
|
|
100
98
|
- `src/runner/retry_class.ts` - Failure classification (v8.0.0). Separates transient failures from positively-identified permanent ones; unrecognized failures stay transient.
|
|
101
99
|
- `src/council/` - Reviewer council and verdict logic.
|
|
102
100
|
- `src/commands/` - Command implementations.
|
|
@@ -158,21 +156,18 @@ across projects.
|
|
|
158
156
|
Multi-provider support. Shell-sourceable provider configs and a model registry
|
|
159
157
|
shared by both the bash route and loki-ts.
|
|
160
158
|
|
|
161
|
-
**Purpose:** Abstract over Claude Code
|
|
162
|
-
capability degradation.
|
|
159
|
+
**Purpose:** Abstract over Claude Code and opencode.
|
|
163
160
|
|
|
164
161
|
**Key files:**
|
|
165
162
|
- `claude.sh` - Claude Code (Tier 1: full features).
|
|
166
|
-
- `
|
|
167
|
-
- `codex.sh` - OpenAI Codex CLI (Tier 3: degraded, sequential).
|
|
168
|
-
- `aider.sh` - Aider (Tier 3: degraded).
|
|
163
|
+
- `opencode.sh` - opencode (model-agnostic, sequential; OpenRouter via `OPENROUTER_API_KEY`).
|
|
169
164
|
- Non-Claude engine10 sessions run under `loki-ts/src/providers/provider_guard.ts` (timeout, budget stop, post-iteration diff scan with revert).
|
|
170
165
|
- `loader.sh` - Provider loader utility.
|
|
171
166
|
- `models.sh`, `model_catalog.json` - Model name registry and catalog.
|
|
172
167
|
- `managed.py` - Managed provider client.
|
|
173
168
|
|
|
174
|
-
Note:
|
|
175
|
-
migration message.
|
|
169
|
+
Note: codex, cline, aider and gemini were removed; selecting one exits 2 with a
|
|
170
|
+
one-line migration message (`loki_removed_provider_message` in `loader.sh`).
|
|
176
171
|
|
|
177
172
|
**Public interface:**
|
|
178
173
|
- `--provider <name>` flag, `LOKI_PROVIDER` env var.
|
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
|
|
@@ -61,15 +61,11 @@ Four measured-harness disciplines on the trust core. None can weaken a gate.
|
|
|
61
61
|
that orders the prompt; it sets no `cache_control` header. The ordering rule
|
|
62
62
|
above still matters on every route -- a stable prefix is what any cache, ours
|
|
63
63
|
or the CLI's, can reuse.
|
|
64
|
-
- **Confidence-spike re-check
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
one-shot so a re-spiking run cannot postpone the valve forever.
|
|
68
|
-
`LOKI_CONFIDENCE_SPIKE=0` / `_DELTA` (40) / `_MIN` (90).
|
|
69
|
-
- **Goal scoring** (`loki-ts/src/runner/goal_score.ts`): flags a
|
|
64
|
+
- **Confidence-spike re-check**: removed. It lived only in the separate Bun loop
|
|
65
|
+
(removed in v11.119.0); `LOKI_CONFIDENCE_SPIKE` and its `_DELTA` / `_MIN` have no reader.
|
|
66
|
+
- **Goal scoring** (`autonomy/run.sh`): flags a
|
|
70
67
|
`COMPLETION_PROMISE` with no measurable target. Advisory only. Suppressed for
|
|
71
|
-
an absent goal and in perpetual mode.
|
|
72
|
-
edit BOTH or the `build_prompt` parity fixtures diverge. `LOKI_GOAL_SCORING=0`.
|
|
68
|
+
an absent goal and in perpetual mode. `LOKI_GOAL_SCORING=0`.
|
|
73
69
|
- **Smart retry** (`loki-ts/src/runner/retry_class.ts`): exits early on a
|
|
74
70
|
positively-identified permanent failure. **Fail-safe direction is
|
|
75
71
|
load-bearing**: unrecognized failures stay TRANSIENT and retry as before; rate
|
|
@@ -95,7 +91,7 @@ Pins (exact, all sites): `@anthropic-ai/sdk` 0.124.0 -> 1.3.0 (loki-ts/package.j
|
|
|
95
91
|
| sdk 0.129.0 `between_tools` thinking | NOT ADOPTED: judge path clamps thinking by effort (sdk_invoker.ts clampThinkingForEffort); between_tools is not offered to judges |
|
|
96
92
|
| sdk 0.135.0/0.136.0 streaming fixes (unread stream close, unknown SSE events) | NOT ADOPTED: sdk_invoker does not stream |
|
|
97
93
|
| sdk 0.130.0-1.2.0 Admin API (analytics, spend limits, RBAC, plugins, webhooks, message threads, usage/cost reports), Managed Agents additions | NOT ADOPTED: no Loki feature calls these APIs |
|
|
98
|
-
| agent-sdk 0.3.302 refused structured output now an error with no payload | NOT AFFECTED:
|
|
94
|
+
| agent-sdk 0.3.302 refused structured output now an error with no payload | NOT AFFECTED: refusals are handled by sdk_stream_parser.ts refusal frames |
|
|
99
95
|
| agent-sdk 0.3.300 `thinking: disabled` runs adaptive on models that cannot disable | NOT ADOPTED: providers.ts:846 query() options pass no thinking setting |
|
|
100
96
|
| agent-sdk 0.3.302 fork subagents on by default in SDK sessions | NOT ADOPTED: accepted default, effect on Loki runs unmeasured; `CLAUDE_CODE_FORK_SUBAGENT=0` is the opt-out |
|
|
101
97
|
| agent-sdk 0.3.302 omitted `permissionMode` defaults to `default` on third-party providers | N/A: Loki always passes an explicit permissionMode |
|
|
@@ -108,16 +104,16 @@ Pins (exact, all sites): `@anthropic-ai/sdk` 0.124.0 -> 1.3.0 (loki-ts/package.j
|
|
|
108
104
|
|
|
109
105
|
## Phase 1 / RARV-C Closure Env Vars
|
|
110
106
|
|
|
111
|
-
Default-on
|
|
107
|
+
Default-on on the bash loop: `autonomy/run.sh` runs them through `loki internal phase1-hooks` (`loki-ts/src/commands/internal_phase1.ts`) after code review. Set to `0` to disable (see `CHANGELOG.md` v7.x entries and `skills/quality-gates.md`).
|
|
112
108
|
|
|
113
109
|
- `LOKI_INJECT_FINDINGS` -- inject structured per-finding records into the next-iteration prompt; persists `.loki/state/findings-<iter>.json` after aggregation.
|
|
114
110
|
- `LOKI_OVERRIDE_COUNCIL` -- enable the 3-judge override council on a BLOCK verdict. Requires `LOKI_INJECT_FINDINGS=1` (operator setting only this var alone is a no-op).
|
|
115
111
|
**The BLOCK-LIFT arm never adjudicates on the bash loop.** The Bun loop that ran it was removed; on the bash loop (`--engine legacy`) the override lands in a stub that returns `REJECT_OVERRIDE` for every record (`loki-ts/src/commands/internal_phase1.ts:215-227`). Counter-evidence is still parsed and an `override-<iter>.json` transcript is still written, so the feature looks live in the artifacts while never being able to lift a BLOCK.
|
|
116
112
|
This fail-closed direction is DELIBERATE, not a bug: on the agent-authored route the gated agent writes its own counter-evidence, so mechanical verification is forgeable. On bash the only exits from a Critical/High BLOCK are to fix the finding or to use the human-escape path (`rm .loki/PAUSE`). Documented here because the heading above says "default-on" and, for this one knob's block-lift, that is not true.
|
|
117
113
|
- `LOKI_AUTO_LEARNINGS` -- auto-write structured learnings per code_review cycle. Optional `LOKI_AUTO_LEARNINGS_EPISODE=1` also writes the learning into the episode store.
|
|
118
|
-
|
|
114
|
+
Read by `internal_phase1.ts` (`LOKI_AUTO_LEARNINGS !== "0"`), which `autonomy/run.sh` calls through `loki internal phase1-hooks`; the variable itself never appears in `run.sh`.
|
|
119
115
|
- `LOKI_HANDOFF_MD` -- write a structured handoff doc before iteration close.
|
|
120
|
-
- `LOKI_REVIEW_ADVISORY` -- default on (`0` restores blocking). architecture-strategist, maintainer-mergeability and test-coverage-auditor are mandatory to run, not to block: they still run and their findings are recorded (`advisory: true` per reviewer plus `advisory_critical` / `advisory_high` in the review `aggregate.json`, one display-only row in the Evidence Receipt), but they carry no veto. `has_blocking` ignores them; security-sentinel and the other reviewers still block. maintainer-mergeability and test-coverage-auditor are routed to haiku at every tier.
|
|
116
|
+
- `LOKI_REVIEW_ADVISORY` -- default on (`0` restores blocking). architecture-strategist, maintainer-mergeability and test-coverage-auditor are mandatory to run, not to block: they still run and their findings are recorded (`advisory: true` per reviewer plus `advisory_critical` / `advisory_high` in the review `aggregate.json`, one display-only row in the Evidence Receipt), but they carry no veto. `has_blocking` ignores them; security-sentinel and the other reviewers still block. maintainer-mergeability and test-coverage-auditor are routed to haiku at every tier. Implemented by `_is_advisory_reviewer` in `autonomy/run.sh`.
|
|
121
117
|
|
|
122
118
|
These knobs together implement the RARV-C (closure) loop: findings -> override council -> learnings -> handoff. Reference: `skills/quality-gates.md`, `CHANGELOG.md` entries from v7.x for default-on flip and override-council semantics.
|
|
123
119
|
|
|
@@ -176,7 +172,7 @@ Command shape: `bin/loki route start <input> --json`. The representative inputs
|
|
|
176
172
|
| `acme/widgets#42` (issue ref) | issue | engine10 | engine10:claude |
|
|
177
173
|
| `./api.yaml` and `./api.json` (OpenAPI/JSON spec) | prd | engine10 | engine10:claude |
|
|
178
174
|
| `./prd.md --resume` (flagged) | prd | engine10 | engine10:claude |
|
|
179
|
-
| `./prd.md --provider
|
|
175
|
+
| `./prd.md --provider opencode` (flagged, other provider) | prd | engine10 | engine10:opencode |
|
|
180
176
|
| `./prd.md --engine legacy` (legacy-mode flag) | prd | legacy | legacy-bash:claude (runs `autonomy/run.sh`) |
|
|
181
177
|
|
|
182
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
|