loki-mode 11.162.0 → 11.164.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.
Files changed (72) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/route.sh +17 -3
  4. package/bin/loki +3 -0
  5. package/dashboard/__init__.py +1 -1
  6. package/docs/CLI-REFERENCE.md +1 -1
  7. package/docs/INSTALLATION.md +1 -1
  8. package/docs/dev/architecture-reference.md +1 -0
  9. package/docs/environment-variables.md +43 -0
  10. package/loki-ts/dist/loki.js +1987 -1969
  11. package/mcp/__init__.py +1 -1
  12. package/package.json +2 -2
  13. package/packages/control-plane/dist/server.js +539 -261
  14. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  15. package/providers/model_catalog.json +12 -3
  16. package/web-app/dist/assets/{AdminPage-BizDHgWk.js → AdminPage-D_rYWYp0.js} +1 -1
  17. package/web-app/dist/assets/{Avatar-EPfQ4V79.js → Avatar-CcoGw0m5.js} +1 -1
  18. package/web-app/dist/assets/{Badge-BOcJREUY.js → Badge-Cw15TPei.js} +1 -1
  19. package/web-app/dist/assets/{Button-BL7oJ3SX.js → Button-DsX-nsCj.js} +1 -1
  20. package/web-app/dist/assets/{CockpitPage-CCjh7fQ3.js → CockpitPage-Br_dvjZI.js} +1 -1
  21. package/web-app/dist/assets/{ComparePage-D5v3QbiF.js → ComparePage-BDmDCMGY.js} +1 -1
  22. package/web-app/dist/assets/{ErrorBoundary-BPaT8HE3.js → ErrorBoundary-D9O24jrn.js} +1 -1
  23. package/web-app/dist/assets/{EvidenceReceiptPanel-DPjXfVE0.js → EvidenceReceiptPanel-Cp9ifZPt.js} +1 -1
  24. package/web-app/dist/assets/{GitHubIssuesPanel-TbALzECx.js → GitHubIssuesPanel-DqyEidYk.js} +1 -1
  25. package/web-app/dist/assets/{GitHubPRsPanel-C-L_BSIr.js → GitHubPRsPanel-CNYW59H-.js} +1 -1
  26. package/web-app/dist/assets/{HomePage-1mYJaASp.js → HomePage-DE1QosE6.js} +2 -2
  27. package/web-app/dist/assets/{LoginPage-B6idMnV-.js → LoginPage-B-c5spXO.js} +1 -1
  28. package/web-app/dist/assets/{MagicPage-DeNkeYa6.js → MagicPage-BWraqL5H.js} +1 -1
  29. package/web-app/dist/assets/{MetricsPage-Dgz1xd96.js → MetricsPage-CGOQizXV.js} +1 -1
  30. package/web-app/dist/assets/{NotFoundPage-BcpJkVEt.js → NotFoundPage-D0KVYl1V.js} +1 -1
  31. package/web-app/dist/assets/{ProjectPage-BghMVwZJ.js → ProjectPage-DgTGj__j.js} +3 -3
  32. package/web-app/dist/assets/{ProjectsPage-CYi1AWYT.js → ProjectsPage-C6Vsdip6.js} +1 -1
  33. package/web-app/dist/assets/{SettingsPage-CY2F-s-3.js → SettingsPage-1L9p6s_b.js} +1 -1
  34. package/web-app/dist/assets/{ShowcasePage-CnGVGvsv.js → ShowcasePage-Byg9F2e8.js} +1 -1
  35. package/web-app/dist/assets/{SystemSettingsPage-ZJA4D4Cr.js → SystemSettingsPage-UdZUrd9u.js} +1 -1
  36. package/web-app/dist/assets/{TeamsPage-D-ubF63c.js → TeamsPage-DWaCqosf.js} +1 -1
  37. package/web-app/dist/assets/{TemplatesPage-DU5ExG6U.js → TemplatesPage-Cgcp72UN.js} +1 -1
  38. package/web-app/dist/assets/{TerminalOutput-CxWrY53G.js → TerminalOutput-BVz50D0F.js} +1 -1
  39. package/web-app/dist/assets/{activity-B0hVt7sG.js → activity-BvipvF1O.js} +1 -1
  40. package/web-app/dist/assets/{bell-D70EABSP.js → bell-iAUxEaVR.js} +1 -1
  41. package/web-app/dist/assets/{bot-D0lhJgAo.js → bot-Dy0AAR1b.js} +1 -1
  42. package/web-app/dist/assets/{check-CvK2c4aF.js → check-viE3SIPw.js} +1 -1
  43. package/web-app/dist/assets/{chevron-left-5nepkZ1R.js → chevron-left-q56m4xfs.js} +1 -1
  44. package/web-app/dist/assets/{circle-alert-COWxxc9Q.js → circle-alert-BmY-0cE0.js} +1 -1
  45. package/web-app/dist/assets/{clock-DVruSW-w.js → clock-DENqKIQP.js} +1 -1
  46. package/web-app/dist/assets/{cloud-BLxWirmZ.js → cloud-CPMAUAuw.js} +1 -1
  47. package/web-app/dist/assets/{code-xml-DTR0iFkj.js → code-xml-BLw-S-36.js} +1 -1
  48. package/web-app/dist/assets/{database-BDk9p0n4.js → database-D4FF5k3m.js} +1 -1
  49. package/web-app/dist/assets/{dollar-sign-BZNzvnXk.js → dollar-sign-Bo6LODIL.js} +1 -1
  50. package/web-app/dist/assets/{file-code-corner-BnUFhCvL.js → file-code-corner-B_M8HXRk.js} +1 -1
  51. package/web-app/dist/assets/{file-plus-COXu7-j_.js → file-plus-CSjmuGXO.js} +1 -1
  52. package/web-app/dist/assets/{globe-lyZQ67pp.js → globe-1K3sFJ4u.js} +1 -1
  53. package/web-app/dist/assets/{hammer-DCl4Kayz.js → hammer-BiI_v50O.js} +1 -1
  54. package/web-app/dist/assets/{index-DPOae9m_.js → index-CLlpTadS.js} +3 -3
  55. package/web-app/dist/assets/{layers-jBOzzVOq.js → layers-DGA0_XFY.js} +1 -1
  56. package/web-app/dist/assets/{loader-circle-BFjr0bf_.js → loader-circle-uj-0CBdZ.js} +1 -1
  57. package/web-app/dist/assets/{lock-CY4mlLs5.js → lock-DX6XtHZP.js} +1 -1
  58. package/web-app/dist/assets/{package-eZT5xC4c.js → package-D1gxDw7b.js} +1 -1
  59. package/web-app/dist/assets/{plus-DuykLjQt.js → plus-DhtFD1zI.js} +1 -1
  60. package/web-app/dist/assets/{refresh-cw-G7q9T3RR.js → refresh-cw-BZZP6kVe.js} +1 -1
  61. package/web-app/dist/assets/{rotate-ccw-Bokg6RqC.js → rotate-ccw-XPbY4h1d.js} +1 -1
  62. package/web-app/dist/assets/{scroll-text-DOds11-k.js → scroll-text-Blqe4ma2.js} +1 -1
  63. package/web-app/dist/assets/{server-C8algKl_.js → server-DXP9qbWJ.js} +1 -1
  64. package/web-app/dist/assets/{shield-alert-BiKSiXeT.js → shield-alert-DEJ9_mWG.js} +1 -1
  65. package/web-app/dist/assets/{thumbs-up-DbgJ8_nk.js → thumbs-up-BnIztVmP.js} +1 -1
  66. package/web-app/dist/assets/{trash-2-CzORwdJm.js → trash-2-BgpBexui.js} +1 -1
  67. package/web-app/dist/assets/{trending-down-jQ86erDF.js → trending-down-BkCqHMgr.js} +1 -1
  68. package/web-app/dist/assets/{trending-up-C9JVhiBK.js → trending-up-C6Zp-6bn.js} +1 -1
  69. package/web-app/dist/assets/{upload-OV-MfCE6.js → upload-BS1Q6UYU.js} +1 -1
  70. package/web-app/dist/assets/{usePolling-C2jjhfd7.js → usePolling-Bv70waur.js} +1 -1
  71. package/web-app/dist/assets/{user-CNnDlDog.js → user-D36GKbph.js} +1 -1
  72. package/web-app/dist/index.html +1 -1
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Runs an autonomous software factory that knows what it is supposed to deliver and proves it did, with a signed receipt. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.
4
4
  ---
5
5
 
6
- # Loki Mode v11.162.0
6
+ # Loki Mode v11.164.0
7
7
 
8
8
  **Current entry points (Loki 10 engine):** `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"` run the Loki 10 engine and end with a signed receipt (`loki verify`). `loki backlog owner/repo --all` runs many issues in parallel. Guide: `docs/v10/GUIDE.md`. The skill instructions below, and `loki start`, describe the previous bash loop. PRD-file starts (`loki start ./prd.md`) and the opencode provider still run on it until FC38-SWEEP ports them; the legacy-engine command and the LOKI_ENGINE switch remain removed. Prefer `loki owner/repo#N` for issues.
9
9
 
@@ -461,4 +461,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
461
461
 
462
462
  ---
463
463
 
464
- **v11.162.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.164.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.162.0
1
+ 11.164.0
package/autonomy/route.sh CHANGED
@@ -10,7 +10,7 @@
10
10
  # Bash 3.2 compatible (no associative arrays, no ${var,,}).
11
11
 
12
12
  # Flags that take a separate value token.
13
- _ROUTE_VALUE_FLAGS=" --provider --budget --budget-limit --max-cost --max-time --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing --label "
13
+ _ROUTE_VALUE_FLAGS=" --plan-model --dev-model --test-model --review-model --advisor-model --helper-model --escalate-model --models --provider --budget --budget-limit --max-cost --max-time --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing --label "
14
14
  # Flags whose value is optional (cmd_start reads one only when it is present): --mirofish takes a URL (a token that does not
15
15
  # start with --, as _loki_start_optval_consumes). Declared here so a refused one still consumes its value. --parallel is NOT
16
16
  # here: cmd_start treats it as a plain boolean (_loki_start_flag_kind), so "--parallel 3" leaves 3 as a positional.
@@ -150,14 +150,14 @@ _route_classify() {
150
150
 
151
151
  # loki_route_resolve VERB ARGS... VERB = start | quick | bare
152
152
  # Sets: R_DECIDED R_E10 R_HARD R_ENGINE R_REASON R_INPUT_TYPE R_INPUT R_PROVIDER
153
- # R_MODEL R_NOTICE R_ERR R_EXPLAIN R_JSON R_E10_ARGS[] R_CLEAN[] R_SESSION_MODEL R_VERB
153
+ # R_MODEL R_NOTICE R_ERR R_EXPLAIN R_JSON R_E10_ARGS[] R_CLEAN[] R_SESSION_MODEL R_VERB R_ROLE_ENV[] (KEY=VALUE per-role model settings)
154
154
  # R_* are the result interface read by the sourcing caller.
155
155
  # shellcheck disable=SC2034
156
156
  loki_route_resolve() {
157
157
  local verb="$1"; shift
158
158
  R_DECIDED=0; R_E10=0; R_HARD=0; R_ENGINE=""; R_REASON=""; R_INPUT_TYPE=""; R_INPUT=""
159
159
  R_PROVIDER=""; R_MODEL=""; R_NOTICE=""; R_ERR=""; R_EXPLAIN=0; R_JSON=0; R_SESSION_MODEL=""; R_VERB=""
160
- R_FRONT=0; R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DEADLINE_S=""; R_DRY=0; R_MAXCOST=""; R_PR_ARGS=()
160
+ R_ROLE_ENV=(); R_FRONT=0; R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DEADLINE_S=""; R_DRY=0; R_MAXCOST=""; R_PR_ARGS=()
161
161
  if [ "$verb" = "start" ] && _route_pr_mode "$@"; then return 0; fi
162
162
 
163
163
  local a engine_req="" dry=0 help=0 front_flag="" legacy_flag="" session_model="" provider_flag="" max_duration="" max_time="" cap_err="" input_flag=""
@@ -199,6 +199,8 @@ loki_route_resolve() {
199
199
  --prd|--brief) input_flag="$name"; positionals+=("$val"); continue ;;
200
200
  --provider) provider_flag="$val"; passthru+=(--provider "$val"); continue ;;
201
201
  --session-model) session_model="$val"; continue ;;
202
+ # ROLE-MODELS: per-role models for engine10 (loki-ts/src/util/claude_model.ts roleSettings validates them; bin/loki exports R_ROLE_ENV)
203
+ --plan-model|--dev-model|--test-model|--review-model|--advisor-model|--helper-model|--escalate-model|--models) R_ROLE_ENV+=("$(_route_role_key "$name")=$val"); continue ;;
202
204
  --budget|--budget-limit|--max-cost) passthru+=(--max-cost "$val"); R_MAXCOST="$val"; continue ;;
203
205
  --dry-run) dry=1; continue ;;
204
206
  --json) R_JSON=1; passthru+=(--json); continue ;;
@@ -436,10 +438,22 @@ loki: this project saved provider '$R_PROVIDER' in .loki/state/provider; switch
436
438
  R_REASON="default: $R_INPUT_TYPE input runs on engine10 regardless of flag order"
437
439
  fi
438
440
  fi
441
+ if [ "$R_ENGINE" = "legacy" ] && [ "${#R_ROLE_ENV[@]}" -gt 0 ]; then
442
+ R_ERR="loki: per-role model flags (--plan-model, --dev-model, --models, ...) run only on the Loki 10 engine; drop them or the legacy request"
443
+ return 0
444
+ fi
439
445
  _route_adapter_and_diffs "$legacy_flag"
440
446
  return 0
441
447
  }
442
448
 
449
+ # ROLE-MODELS: the env var a per-role model flag sets (--plan-model -> LOKI_ROLE_PLAN, --models -> LOKI_MODELS).
450
+ _route_role_key() {
451
+ case "$1" in
452
+ --models) printf '%s' LOKI_MODELS ;;
453
+ *) local r="${1#--}"; r="${r%-model}"; printf 'LOKI_ROLE_%s' "$(printf '%s' "$r" | tr '[:lower:]' '[:upper:]')" ;;
454
+ esac
455
+ }
456
+
443
457
  # Sets R_ADAPTER and R_CAPDIFF[] from R_ENGINE / R_PROVIDER. Empty R_CAPDIFF means the
444
458
  # full Claude Code path on the Loki 10 engine. Statements mirror providers/*.sh
445
459
  # (PROVIDER_HAS_TASK_TOOL=false for every non-claude provider).
package/bin/loki CHANGED
@@ -792,6 +792,9 @@ if [ -f "$REPO_ROOT/autonomy/route.sh" ]; then
792
792
  case "$R_SESSION_MODEL" in small) R_SESSION_MODEL=fast ;; medium) R_SESSION_MODEL=development ;; high) R_SESSION_MODEL=planning ;; esac
793
793
  export LOKI_SESSION_MODEL="$R_SESSION_MODEL"
794
794
  fi
795
+ # ROLE-MODELS: --plan-model ... --models become LOKI_ROLE_<ROLE> / LOKI_MODELS for engine10 (it validates them and exits 2 on a bad one)
796
+ for _r_kv in ${R_ROLE_ENV[@]+"${R_ROLE_ENV[@]}"}; do export "${_r_kv%%=*}=${_r_kv#*=}"; done
797
+ unset _r_kv
795
798
  if [ "$R_E10" = "1" ] && [ -n "${R_E10_CAP_S:-}" ]; then export LOKI_E10_CAP_S="$R_E10_CAP_S"; fi
796
799
  if [ "$R_E10" = "1" ] && [ -n "${R_DEADLINE_S:-}" ]; then export LOKI_RUN_DEADLINE_S="$R_DEADLINE_S"; fi # --max-time
797
800
  if [ "$R_ENGINE" = "verify-pr" ]; then
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.162.0"
10
+ __version__ = "11.164.0"
11
11
 
12
12
  __all__ = ["__version__"]
@@ -1,6 +1,6 @@
1
1
  # CLI reference
2
2
 
3
- Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.162.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.164.0. Do not edit by hand.
4
4
  Hidden and legacy-only commands are omitted; see `docs/CLI-INVENTORY.md` for the full inventory.
5
5
 
6
6
  | Command | Description |
@@ -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.162.0
5
+ **Version:** v11.164.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
 
@@ -185,6 +185,7 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
185
185
  - `LOKI_E10_INTAKE_CAP_S` -- off by default since acc-148 (unset, `0` or a non-number keeps the per-command caps alone); a positive number of seconds turns the shared budget on. When on and it cuts a baseline, intake prints one line starting `loki: intake budget spent after N s` (`repo_profile.ts` intakeBudgetNote). Turned off because it had no measured accuracy benefit and cut 6 of 65 past baselines (a complete 196 s gitea suite among them), and a cut baseline is unattributable base red. (R3; `loki-ts/src/runner/repo_profile.ts` intakeCapS / baselineSuites `deadlineMs`, wired in `stages/intake.ts` and `project_model/install.ts` intakeDeps). One budget in seconds for all of intake's baseline test runs together: the root baseline, its rerun after an install, and the per-suite baselines. A run the budget cuts is recorded as cut off, and a suite with no budget left reads "baseline budget used up", as before. The dependency install keeps its own cap (INSTALL_CAP_MS) and is not counted. The failure: a suite past the 300 s per-command cap was measured twice under two names, so intake spent 600 s on two cut-off runs that excuse nothing. Of 65 recorded bench baselines, 6 took over 180 s in all; 1 of them (195.8 s root, 219.2 s suite) completed and would now be cut.
186
186
  - `LOKI_E10_MOCHA_TARGETED` -- on by default, `0` opts out (R5; `loki-ts/src/engine10/testmap.ts` mochaTargets, used by `stages/verify.ts`). When verify selects no test at all, a changed JS/TS file whose nearest package.json declares mocha (a dependency, a script, a `mocha` key, or a .mocharc file beside it) maps to its own test file: itself under the package's test/, tests/ or spec/ directory (fixtures excluded), else the file at the same path under one of them (with or without the source's first directory). At most 8, each run as `npx --no-install mocha <file>` (runner `mocha`, which runner detection never lists) through the normal test path, so base subtraction and the flaky rerun apply and a passing one covers its source. Mocha test files carry no .test or .spec suffix, so such a repo verified with no test at all.
187
187
  - `LOKI_E10_BASE_RED_SHAPE` -- on by default, `0` opts out (acc-147; `loki-ts/src/runner/repo_profile.ts` sameUnattributableRed inside attributeFullSuite, `loki-ts/src/util/check_result.ts` failureShape). The intake baseline records the output shape of a base suite that is red with no parseable failing ids (`failing_shape`). A head full suite of the same command is pre-existing only when it fails in the identical kind: the same exit code, no parseable ids, and the same shape (whole output, only durations, clock times, timestamps and hex addresses normalized). A newly broken test, a different message or count, or another exit code stays introduced. The excuse is disclosed on NOT PROVEN. Dev corpus 2026-11-13: 4 of 24 runs ended FAILED with fix rounds chasing such a suite ("the base run is not attributable").
188
+ - `LOKI_E10_BASE_UNATTRIBUTED` -- on by default, `0` opts out (`loki-ts/src/runner/repo_profile.ts` redUnattributableOnBase, `loki-ts/src/engine10/stages/verify.ts` base_unattributed, `loki-ts/src/engine10/stages/seal.ts` unattributedRed). A full-suite check that is red on head and whose base run of the same command, on this base commit, was red too with the same exit code and no parseable failing id on either side is never excused, and it holds the label at PARTIAL instead of FAILED: Loki could not tell a failure the change caused from the ones already there. A kept failure line that names a changed file takes the check out. closed-set-2 pw43305 (11.158.0): six of six seeds that pass the hidden test were FAILED on this check alone; replayed on their stored receipts and base records (seal's verdictOf with fixed other arguments, not a live run) the verdict reads PARTIAL. Fire marker: `base_unattributed` in the verify output.
188
189
  - `LOKI_E10_BACKSTOP_SEAL` -- on by default, `0` opts out (`loki-ts/src/engine10/supervisor.ts` after the first worker; `worker.ts` LOKI_E10_SEAL_ONLY; `stages/seal.ts` sealOnlyPass). A worker the backstop killed before it sealed gets one seal pass: a resumed worker runs only commit and seal, bounded by min(45 s, ceiling + 25 s - elapsed) and skipped below 10 s. The receipt is never VERIFIED and carries the time-ran-out NOT PROVEN line. `LOKI_E10_TEST_BLOCK_AFTER_SESSION_MS` is a test-only hook that blocks the worker's event loop after its implement session.
189
190
  - `LOKI_E10_SUITE_TIMEOUT_NOT_RUN` -- on by default, `0` opts out (`loki-ts/src/project_model/package_suite.ts` runPackageSuites and `loki-ts/src/engine10/stages/deep.ts` runFullSuite; `util/shell.ts` run reports `timedOut`). A full suite stopped by its timeout is not_run "timed out after N s" and runs in its own process group.
190
191
  - `LOKI_E10_LINT_UNTOUCHED` -- off by default, `1` opts in (acc-174; off because it changed no label on 150 stored bench runs and has not fired on a real run; `loki-ts/src/engine10/stages/verify.ts` tscUntouchedOnly in runLintChecks, seal lists `lint_untouched`). A failed project-wide tsc whose every diagnostic is in an untouched, unnamed file, with no compiler or linter config changed, no changed symbol in the output, and every diagnostic line also in the same tsc run on the base snapshot (tscOnBase; no base output refuses), is not blocking and is disclosed on the receipt.
@@ -72,6 +72,8 @@ interact and why hitting one is a failure rather than a success.
72
72
  | `LOKI_MODEL_API_KEY` | unset | Token for a `custom/<id>` route (optional). OpenRouter reads `OPENROUTER_API_KEY`. |
73
73
  | `LOKI_OPENCODE_MODEL` | unset | `provider/model` id passed to opencode (for example `openrouter/deepseek/deepseek-v3.2`). Also `LOKI_OPENCODE_FLAGS` and `LOKI_OPENCODE_CLI`. |
74
74
  | `LOKI_EDIT_MODEL` | unset | Model for `loki edit`. |
75
+ | `LOKI_ROLE_PLAN`, `LOKI_ROLE_DEV`, `LOKI_ROLE_TEST`, `LOKI_ROLE_REVIEW`, `LOKI_ROLE_ADVISOR`, `LOKI_ROLE_HELPER`, `LOKI_ROLE_ESCALATE` | unset | The model for one role of a Loki 10 run (`--plan-model`, `--dev-model`, ... on `loki start`). See "A model per role" below. |
76
+ | `LOKI_MODELS` | unset | All roles on one line, `plan=opus,dev=haiku,test=haiku,review=sonnet,advisor=opus` (`--models`). A `LOKI_ROLE_<ROLE>` variable wins over its entry here. |
75
77
  | `LOKI_ENGINE` | unset | `legacy` forces the previous loop; the `--engine` flag wins over it. |
76
78
  | `LOKI_SUMMARY_JSON` | unset | `1` prints the end-of-run summary as one JSON line on the previous loop. |
77
79
  | `LOKI_TIER` | `oss` | **Not a model setting.** The open-core licensing seam. Leave it unset. |
@@ -81,6 +83,47 @@ interact and why hitting one is a failure rather than a success.
81
83
  | `LOKI_REPO_BASELINE` | unset | `0` skips the intake repo profile and baseline test run. |
82
84
  | `LOKI_ALLOW_CLAUDE_SIDECALLS` | unset | `1` (exactly) lets PRD enrichment, done recognition, the council voters, the USAGE.md refresh and the quickstart intent check prompt the `claude` CLI under a non-claude provider; `loki doctor --airgap` then reports that as required egress to Anthropic. |
83
85
 
86
+ ### A model per role
87
+
88
+ A Loki 10 run (`loki start`, `loki "<task>"`) can run each kind of work on its own model:
89
+
90
+ ```bash
91
+ loki start ./prd.md --plan-model opus --dev-model haiku --test-model haiku --review-model sonnet
92
+ loki start ./prd.md --models plan=opus,dev=haiku,test=haiku,review=sonnet,advisor=opus,escalate=sonnet
93
+ ```
94
+
95
+ | Role | Flag | What runs on it |
96
+ |---|---|---|
97
+ | `plan` | `--plan-model` | the plan session |
98
+ | `dev` | `--dev-model` | implement, its retries and extra attempts, fix rounds, the patch protocol, the tournament candidates |
99
+ | `test` | `--test-model` | the Wall test author and re-author, the executable spec, the prove sessions |
100
+ | `review` | `--review-model` | the cross-review, the issue acceptance check, the pick between attempts, the conflict referee, the tournament judge |
101
+ | `advisor` | `--advisor-model` | the consult and the router advisor tool. It picks the model only and does not turn the advisor on: the consult is on with `LOKI_E10_OPUS_CONSULT=1`, the advisor tool with `LOKI_ADVISOR=1` (alone) or `LOKI_ROUTER=1` / `LOKI_ROUTER=auto` (with the router) |
102
+ | `helper` | `--helper-model` | intake checks: the already-done confirmation, project-model discovery, the open-choice vote, the ranked-remedy check |
103
+ | `escalate` | `--escalate-model` | a fix round after the same test failure repeats |
104
+
105
+ A value is `haiku`, `sonnet`, `opus`, `fable` or a model id (on `--provider opencode`, an opencode id). A role you set is exact: it is never
106
+ capped to `--model`, never downgraded, never climbed by the router, and the Wall keeps it instead of re-authoring on another model. With `--dev-model`
107
+ set, a repeated failure escalates only when `--escalate-model` names the model. A role you do not set keeps Loki's own choice, so a run with no role
108
+ behaves exactly as before. Precedence for each call: an older per-call variable (`LOKI_E10_WALL_TIER`, `LOKI_E10_ATTEMPT_MODELS`, `LOKI_E10_CONSULT_MODEL`,
109
+ `LOKI_E10_SELECT_REVIEW_MODEL`, `LOKI_E10_ISSUE_ACCEPTANCE_MODEL`, `LOKI_E10_EXEC_SPEC_MODEL`, `LOKI_E10_TOURNAMENT_MODEL`, `LOKI_E10_PRECEDENT_MODEL`,
110
+ `LOKI_E10_RANKED_REMEDY_MODEL`), then the role, then `--model` / `--session-model`, then Loki's default. When a role is set the start line names the
111
+ model per role (`models: plan opus, dev haiku, ...`; `auto` means Loki picks per call) and the receipt records the models each role started under
112
+ `models_by_role`. On the claude provider a value is `haiku`, `sonnet`, `opus`, `fable` or a model id from the catalog (`providers/model_catalog.json`, or
113
+ `LOKI_MODEL_CATALOG`), passed to the provider exactly as written; any other value (a typo such as `sonet`, another vendor's id) exits 2 with the
114
+ nearest known id. On opencode a value is passed through and opencode checks it. A bad value, a route id (`openrouter/...`: choose a route for the
115
+ whole run with `--model`), a role above `LOKI_MAX_TIER`, or any Claude role while `LOKI_MODEL_ROUTE` is set (the route serves every call; unset the
116
+ role or the route) exits 2 before any session, naming the role. On opencode, a call that only runs on the Anthropic API
117
+ (the consult, the votes, the acceptance check, the attempt pick, the tournament, the executable spec) is skipped when its role names a
118
+ non-Claude model, and the receipt's `tool_calls_skipped` names each skipped call with the reason (as it does for `LOKI_E10_PATCH`, which runs on
119
+ claude only). The legacy engine refuses the role flags.
120
+
121
+ Fable (`fable`, `claude-fable-5-2`) runs as Fable on `loki start`, through `--model fable`, `--session-model fable` or a role; earlier releases ran
122
+ Opus for a `fable` pin, and the legacy bash engine still does. Fable answers on the Claude CLI and the Agent SDK sessions. With `ANTHROPIC_API_KEY` set,
123
+ the tool-less calls go to `/v1/messages`, where Fable is not yet verified: the start line and the receipt (`fable_raw_api`) say so, and a refused or
124
+ failed Fable call prints the API's reason and is never re-run on another model. `claude-fable-5-2` is priced by the fable row of the pricing table
125
+ (the Fable 5.1 rate); its own rate is not verified.
126
+
84
127
  ### Picking a model without naming one
85
128
 
86
129
  You do not need to know any vendor's model names. Ask for a capability class