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.
Files changed (173) hide show
  1. package/.github/actions/issue-to-pr/action.yml +1 -1
  2. package/README.md +3 -2
  3. package/SKILL.md +16 -19
  4. package/VERSION +1 -1
  5. package/agents/custom_agents.py +1 -1
  6. package/api/openapi.yaml +3 -7
  7. package/api/routes/health.ts +5 -10
  8. package/api/routes/sessions.ts +12 -3
  9. package/api/server.js +6 -2
  10. package/api/services/cli-bridge.ts +1 -1
  11. package/api/types/api.ts +3 -5
  12. package/assets/welcome/welcome.html +1 -1
  13. package/autonomy/completion-council.sh +0 -52
  14. package/autonomy/context-tracker.py +10 -25
  15. package/autonomy/council-v2.sh +0 -28
  16. package/autonomy/grill.sh +3 -25
  17. package/autonomy/lib/chat.sh +3 -6
  18. package/autonomy/lib/claude-flags.sh +1 -1
  19. package/autonomy/lib/cost-summary.py +2 -2
  20. package/autonomy/lib/done-recognition.sh +1 -1
  21. package/autonomy/lib/efficiency_cost.py +1 -1
  22. package/autonomy/lib/effort_estimator.py +0 -4
  23. package/autonomy/lib/help-core.sh +6 -4
  24. package/autonomy/lib/iteration_attribution.py +1 -1
  25. package/autonomy/lib/mcp-config.sh +7 -34
  26. package/autonomy/lib/os_sandbox.py +2 -5
  27. package/autonomy/lib/outcome_ledger.py +1 -1
  28. package/autonomy/lib/project-graph.sh +1 -1
  29. package/autonomy/lib/setup-requirements.json +1 -4
  30. package/autonomy/lib/skill-link-heal.sh +1 -1
  31. package/autonomy/lib/telemetry-schema.json +3 -3
  32. package/autonomy/lib/wiki_llm.py +1 -4
  33. package/autonomy/loki +95 -335
  34. package/autonomy/migration-agents.sh +1 -1
  35. package/autonomy/prd-checklist.sh +1 -1
  36. package/autonomy/provider-offer.sh +7 -11
  37. package/autonomy/quickstart.sh +3 -11
  38. package/autonomy/route.sh +6 -6
  39. package/autonomy/run.sh +51 -291
  40. package/autonomy/sandbox.sh +8 -39
  41. package/autonomy/setup-wizard.sh +5 -5
  42. package/bin/loki +34 -25
  43. package/completions/_loki +4 -4
  44. package/completions/loki.bash +2 -4
  45. package/dashboard/__init__.py +1 -1
  46. package/dashboard/api_start.py +36 -6
  47. package/dashboard/build_supervisor.py +1 -5
  48. package/dashboard/server.py +18 -26
  49. package/docs/ARCHITECTURE.md +9 -10
  50. package/docs/CLI-REFERENCE.md +1 -1
  51. package/docs/COMPARE-OPENCODE.md +7 -6
  52. package/docs/COMPONENTS.md +5 -8
  53. package/docs/DOCKER.md +11 -10
  54. package/docs/INSTALLATION.md +5 -8
  55. package/docs/OPEN-CORE-BOUNDARY.md +1 -1
  56. package/docs/PRIVACY.md +2 -2
  57. package/docs/QUICKSTART.md +2 -2
  58. package/docs/TOOLS.md +3 -3
  59. package/docs/air-gapped.md +3 -3
  60. package/docs/alternative-installations.md +20 -10
  61. package/docs/cost-controls.md +0 -3
  62. package/docs/dev/architecture-reference.md +1 -1
  63. package/docs/dev/project-structure.md +1 -4
  64. package/docs/environment-variables.md +8 -10
  65. package/docs/exit-codes.md +5 -5
  66. package/docs/network-security.md +3 -6
  67. package/docs/v10/GUIDE.md +45 -34
  68. package/integrations/openclaw/README.md +1 -1
  69. package/integrations/openclaw/SKILL.md +3 -3
  70. package/learning/emit.sh +1 -1
  71. package/loki-ts/data/child-env.json +0 -8
  72. package/loki-ts/dist/cockpit.js +1 -1
  73. package/loki-ts/dist/loki.js +1339 -1345
  74. package/magic/core/debate.py +4 -11
  75. package/magic/core/generator.py +5 -18
  76. package/mcp/__init__.py +1 -1
  77. package/mcp/server.py +1 -1
  78. package/package.json +2 -3
  79. package/packages/control-plane/dist/ask-tools-server.js +1 -3
  80. package/packages/control-plane/dist/server.js +171 -395
  81. package/packages/control-plane/src/ask/invoke.ts +5 -13
  82. package/packages/control-plane/src/ask/parse.ts +3 -25
  83. package/packages/control-plane/src/ask/worker.ts +1 -2
  84. package/packages/control-plane/src/db/fixture-cleanup.ts +1 -1
  85. package/packages/control-plane/src/server/routes/ask.ts +3 -2
  86. package/packages/control-plane/src/server/routes/cost_ledger.ts +0 -1
  87. package/packages/control-plane/src/server/routes/providers.ts +4 -9
  88. package/packages/control-plane/src/server/spawn.ts +8 -4
  89. package/packages/control-plane/ui/dist/assets/{index-C4nb1aRV.js → index-Dy80VLtj.js} +22 -22
  90. package/packages/control-plane/ui/dist/index.html +1 -1
  91. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  92. package/providers/loader.sh +23 -4
  93. package/providers/model_catalog.json +2 -104
  94. package/providers/models.sh +10 -11
  95. package/providers/opencode.sh +3 -6
  96. package/references/quality-control.md +1 -1
  97. package/schemas/loki-yaml.schema.json +1 -1
  98. package/skills/model-selection.md +26 -55
  99. package/skills/providers.md +54 -221
  100. package/skills/quality-gates.md +3 -3
  101. package/skills/troubleshooting.md +1 -1
  102. package/src/integrations/github/action-handler.js +2 -4
  103. package/src/protocols/tools/start-project.js +1 -1
  104. package/tools/index-codebase.py +1 -2
  105. package/tools/preflight.sh +2 -2
  106. package/tools/probe-model-catalog.py +1 -13
  107. package/tools/regen-state-machine-refs.py +1 -2
  108. package/tools/token-guard.py +1 -1
  109. package/web-app/dist/assets/{AdminPage-CSwrd2UA.js → AdminPage-BfxkhFXl.js} +1 -1
  110. package/web-app/dist/assets/{Avatar-B6SmKtXt.js → Avatar-xV4rK0ps.js} +1 -1
  111. package/web-app/dist/assets/{Badge-CR4U3l95.js → Badge-Ds_E82Ka.js} +1 -1
  112. package/web-app/dist/assets/{Button-DmcHmlo6.js → Button-BXAwY0ni.js} +1 -1
  113. package/web-app/dist/assets/{CockpitPage-CR_GmqRg.js → CockpitPage-y3R9sk_M.js} +1 -1
  114. package/web-app/dist/assets/ComparePage-BGbCno4C.js +1 -0
  115. package/web-app/dist/assets/{ErrorBoundary-23WE8Kb8.js → ErrorBoundary-DGqkzHdy.js} +1 -1
  116. package/web-app/dist/assets/{EvidenceReceiptPanel-dFODI74J.js → EvidenceReceiptPanel-Bj57TWoJ.js} +1 -1
  117. package/web-app/dist/assets/{GitHubIssuesPanel-CudHcPXf.js → GitHubIssuesPanel-CVbtUCRI.js} +1 -1
  118. package/web-app/dist/assets/{GitHubPRsPanel-0WcASaRW.js → GitHubPRsPanel-DuNxI0k8.js} +1 -1
  119. package/web-app/dist/assets/{HomePage-CQL8xADH.js → HomePage-DogFuRvt.js} +2 -2
  120. package/web-app/dist/assets/{LoginPage-BRfdWXgI.js → LoginPage-U-r-YNKC.js} +1 -1
  121. package/web-app/dist/assets/{MagicPage-CaaPZyuJ.js → MagicPage-C5iDqK4d.js} +1 -1
  122. package/web-app/dist/assets/{MetricsPage-BjQ0sz0F.js → MetricsPage-COVYOGfr.js} +1 -1
  123. package/web-app/dist/assets/{NotFoundPage-BNnrwX96.js → NotFoundPage-CZii6Z0s.js} +1 -1
  124. package/web-app/dist/assets/{ProjectPage-pDqfWbBG.js → ProjectPage-QwOZzVqj.js} +25 -25
  125. package/web-app/dist/assets/{ProjectsPage-CiHCZYVm.js → ProjectsPage-BcxVfXVW.js} +1 -1
  126. package/web-app/dist/assets/SettingsPage-CBY9JiAE.js +10 -0
  127. package/web-app/dist/assets/{ShowcasePage-BCa643R5.js → ShowcasePage-D1YPQOp7.js} +1 -1
  128. package/web-app/dist/assets/SystemSettingsPage-DcpAC9Lg.js +1 -0
  129. package/web-app/dist/assets/{TeamsPage-CG-DqMjn.js → TeamsPage-BTiJPkD4.js} +1 -1
  130. package/web-app/dist/assets/{TemplatesPage-CO_kXHRt.js → TemplatesPage-LUa3bH-A.js} +1 -1
  131. package/web-app/dist/assets/{TerminalOutput-C_iYHB-7.js → TerminalOutput-BM8LH-RG.js} +1 -1
  132. package/web-app/dist/assets/{activity-Cp6ZIiZc.js → activity-mZHuLoR5.js} +1 -1
  133. package/web-app/dist/assets/{bell-BZf6hsa9.js → bell-BR_y_nMB.js} +1 -1
  134. package/web-app/dist/assets/{bot-CGmNbYLx.js → bot-Ct3caGMX.js} +1 -1
  135. package/web-app/dist/assets/{check-CMDDpUDY.js → check-DuQpq9PN.js} +1 -1
  136. package/web-app/dist/assets/{chevron-left-DTtdfTHr.js → chevron-left-CWSfVWba.js} +1 -1
  137. package/web-app/dist/assets/{circle-alert-Ch6h3j52.js → circle-alert-C7TCj9Jm.js} +1 -1
  138. package/web-app/dist/assets/{clock-Ce1nf2ai.js → clock-BFsj3bRT.js} +1 -1
  139. package/web-app/dist/assets/{cloud-p2TFekpg.js → cloud-78sYPXff.js} +1 -1
  140. package/web-app/dist/assets/{code-xml-Kyu4vmM1.js → code-xml-DuwBCDz-.js} +1 -1
  141. package/web-app/dist/assets/{database-B4HrqS9b.js → database-CwRTYKVV.js} +1 -1
  142. package/web-app/dist/assets/{dollar-sign-Cw-uyKAg.js → dollar-sign-COXAsjgd.js} +1 -1
  143. package/web-app/dist/assets/{file-code-corner-C8N3vuAd.js → file-code-corner-A8LPVBBy.js} +1 -1
  144. package/web-app/dist/assets/{file-plus-Ddd367Rd.js → file-plus-D9IXE7YW.js} +1 -1
  145. package/web-app/dist/assets/{globe-BW_Nzcek.js → globe-Ce6xgdLR.js} +1 -1
  146. package/web-app/dist/assets/{hammer-rS0zwOgP.js → hammer-Dtq836Al.js} +1 -1
  147. package/web-app/dist/assets/{index-BFtUVrg2.js → index-uce16-nn.js} +16 -16
  148. package/web-app/dist/assets/{layers-ChTtsWHz.js → layers-BOQdqOXk.js} +1 -1
  149. package/web-app/dist/assets/{loader-circle-Dl2j378Y.js → loader-circle-D3y4SHAn.js} +1 -1
  150. package/web-app/dist/assets/{lock-H0jwxcaH.js → lock-miFONHLo.js} +1 -1
  151. package/web-app/dist/assets/{package-Cn0OyUWi.js → package-ckZFIHTG.js} +1 -1
  152. package/web-app/dist/assets/{plus-c4Cn8Hg_.js → plus-COJKSbOp.js} +1 -1
  153. package/web-app/dist/assets/{refresh-cw-CvtIp31h.js → refresh-cw-rPt-Oa4a.js} +1 -1
  154. package/web-app/dist/assets/{rotate-ccw-CACNVELf.js → rotate-ccw-Dy50K31A.js} +1 -1
  155. package/web-app/dist/assets/{scroll-text-wcpAN4zz.js → scroll-text-CbczPkkS.js} +1 -1
  156. package/web-app/dist/assets/{server-C8tiYYoH.js → server-HkfTEf2O.js} +1 -1
  157. package/web-app/dist/assets/{shield-alert-D2EqAn5F.js → shield-alert-DjKF0yba.js} +1 -1
  158. package/web-app/dist/assets/{thumbs-up-DoxGQgUE.js → thumbs-up-aObjUDQm.js} +1 -1
  159. package/web-app/dist/assets/{trash-2-HbLfFoN4.js → trash-2-CQfI6Z-c.js} +1 -1
  160. package/web-app/dist/assets/{trending-down-Djd4tkxi.js → trending-down-CP7J5aPV.js} +1 -1
  161. package/web-app/dist/assets/{trending-up-B9Nco_QQ.js → trending-up-CTJHoPnm.js} +1 -1
  162. package/web-app/dist/assets/{upload-Bu_bR4UG.js → upload-i1zoXd2k.js} +1 -1
  163. package/web-app/dist/assets/{usePolling-D6jTTEO8.js → usePolling-CZG-IV1Y.js} +1 -1
  164. package/web-app/dist/assets/{user-3vyW2Iwk.js → user-CJwbwmPE.js} +1 -1
  165. package/web-app/dist/index.html +1 -1
  166. package/web-app/server.py +26 -14
  167. package/autonomy/lib/codex-usage.py +0 -174
  168. package/providers/aider.sh +0 -191
  169. package/providers/cline.sh +0 -176
  170. package/providers/codex.sh +0 -408
  171. package/web-app/dist/assets/ComparePage-DH9gwrob.js +0 -1
  172. package/web-app/dist/assets/SettingsPage-B-1-R56L.js +0 -10
  173. package/web-app/dist/assets/SystemSettingsPage-BUHVmvMB.js +0 -1
package/autonomy/loki CHANGED
@@ -319,7 +319,7 @@ LOKI_DIR="${LOKI_DIR:-.loki}"
319
319
  export LOKI_DIR
320
320
 
321
321
  # v7.7.34: launch the autonomous runner as a SESSION/PROCESS-GROUP LEADER so the
322
- # whole tree (orchestrator + the claude/codex/aider agent pipeline + monitors)
322
+ # whole tree (orchestrator + the claude/opencode agent pipeline + monitors)
323
323
  # shares one process group and can be killed atomically with `kill -- -PGID`.
324
324
  # Without this, stopping the orchestrator pid orphans the agent child (it
325
325
  # reparents to init and keeps editing files), which is the "dashboard says
@@ -1930,7 +1930,7 @@ show_help_all() {
1930
1930
  echo "list with 'loki help aliases'."
1931
1931
  echo ""
1932
1932
  echo "Options for 'start':"
1933
- echo " --provider NAME AI provider: claude (default), codex, cline, aider, opencode"
1933
+ echo " --provider NAME AI provider: claude (default) or opencode"
1934
1934
  echo " (model route: set LOKI_MODEL_ROUTE, e.g. ollama/qwen3-coder; there is no --model flag)"
1935
1935
  echo " --simple Force simple complexity tier (3 phases)"
1936
1936
  echo " --complex Force complex complexity tier (8 phases)"
@@ -1981,21 +1981,20 @@ show_help_all() {
1981
1981
  echo ""
1982
1982
  echo " # Providers + model routing"
1983
1983
  echo " loki provider list # Show available providers, including opencode"
1984
- echo " loki provider set codex # Switch active provider"
1984
+ echo " loki provider set opencode # Switch active provider"
1985
1985
  echo " # Cheap / open models (DeepSeek, GLM, MiniMax, Kimi) via OpenRouter:"
1986
- echo " loki provider set aider # aider + cline reach any OpenRouter model"
1987
1986
  echo " export OPENROUTER_API_KEY=sk-or-..."
1988
- echo " loki start ./prd.md # defaults to deepseek-v3.2 (open weights)"
1989
- echo " # Pick a specific model:"
1990
- echo " export LOKI_AIDER_MODEL=openrouter/z-ai/glm-4.6"
1987
+ echo " loki start ./prd.md --provider opencode --model openrouter/deepseek/deepseek-v3.2"
1988
+ echo " # Or pin it for every run:"
1989
+ echo " export LOKI_OPENCODE_MODEL=openrouter/z-ai/glm-4.6"
1991
1990
  echo ""
1992
1991
  echo " # Anthropic-PROTOCOL gateways (LiteLLM, Bedrock proxies, self-hosted):"
1993
1992
  echo " export ANTHROPIC_BASE_URL=https://your-gateway/v1 \\\\"
1994
1993
  echo " LOKI_MODEL_OVERRIDE=<model-id-your-gateway-serves>"
1995
1994
  echo " # NOTE: this routes Claude Code itself, so the endpoint must speak the"
1996
1995
  echo " # Anthropic /v1/messages API. OpenRouter does NOT -- it serves"
1997
- echo " # only the OpenAI-shaped /v1/chat/completions. Use the aider or"
1998
- echo " # cline route above for OpenRouter."
1996
+ echo " # only the OpenAI-shaped /v1/chat/completions. Use the opencode"
1997
+ echo " # route above for OpenRouter."
1999
1998
  echo ""
2000
1999
  echo " # Cross-project context (Phase F)"
2001
2000
  echo " # Drop .loki/app.json with {schema_version:1,app_id:myapp,members:[ui,api]}"
@@ -2628,7 +2627,7 @@ _loki_start_handoff() {
2628
2627
  _loki_start_flag_kind() {
2629
2628
  _LOKI_START_FLAG_KIND=""
2630
2629
  case "${1%%=*}" in
2631
- --provider|--brief|--budget|--cost|--prd|--issue|--isolation|--aider-model|--aider-flags|--cline-model|--compliance|--max-duration|--log-level|--bmad-project|--openspec|--mirofish-rounds|--mirofish-timeout|--output|--config|--vars|--env-file|--remote|--attempts|--mirofish-docker) _LOKI_START_FLAG_KIND=value ;;
2630
+ --provider|--brief|--budget|--cost|--prd|--issue|--isolation|--compliance|--max-duration|--log-level|--bmad-project|--openspec|--mirofish-rounds|--mirofish-timeout|--output|--config|--vars|--env-file|--remote|--attempts|--mirofish-docker) _LOKI_START_FLAG_KIND=value ;;
2632
2631
  --mirofish) _LOKI_START_FLAG_KIND=optional ;;
2633
2632
  --parallel|--allow-haiku|--haiku|--regen-prd|--regenerate-prd|--regen|--fresh-prd|--bg|--background|--simple|--complex|--github|--no-dashboard|--api|--sandbox|--skip-memory|--yes|-y|--quiet|--mirofish-bg|--no-mirofish|--no-plan|--fast|--repo-fast|--full|--repo-full|--dry-run|--no-start|--worktree|-w|--pr|--prepare-pr|--ship|--detach|-d|--help|-h|--resume|--) _LOKI_START_FLAG_KIND=bool ;;
2634
2633
  *) return 1 ;;
@@ -2972,7 +2971,7 @@ cmd_start() {
2972
2971
  echo " building locally; polls until the job finishes."
2973
2972
  echo " Token from LOKI_REMOTE_TOKEN / LOKI_REMOTE_TOKEN_FILE"
2974
2973
  echo " (never an argument). Env: LOKI_REMOTE_URL."
2975
- echo " --provider NAME AI provider: claude (default), codex, cline, aider, opencode"
2974
+ echo " --provider NAME AI provider: claude (default) or opencode"
2976
2975
  echo " (model route: set LOKI_MODEL_ROUTE, for example ollama/qwen3-coder; no --model flag)"
2977
2976
  echo " --allow-haiku Enable Haiku model for the fast tier (default: disabled)"
2978
2977
  echo " --simple Force simple complexity tier (3 phases)"
@@ -3057,7 +3056,7 @@ cmd_start() {
3057
3056
  echo " loki start PROJ-456 # ISSUE mode (Jira)"
3058
3057
  echo " loki start owner/repo#789 # ISSUE mode (GitHub specific repo)"
3059
3058
  echo " loki start --issue 123 --ship # Explicit issue, full automation"
3060
- echo " loki start --provider codex # Use OpenAI Codex CLI"
3059
+ echo " loki start --provider opencode # Use opencode (any model, incl. OpenRouter)"
3061
3060
  echo " loki start --bmad-project ./my-project # Start from BMAD artifacts"
3062
3061
  echo " loki start --openspec ./openspec/changes/my-feature # From OpenSpec change"
3063
3062
  echo " loki start --yes # Skip confirmation prompt"
@@ -3097,7 +3096,7 @@ cmd_start() {
3097
3096
  args+=("--provider" "$provider")
3098
3097
  shift 2
3099
3098
  else
3100
- echo -e "${RED}--provider requires a value (claude, codex, cline, aider, opencode)${NC}"
3099
+ echo -e "${RED}--provider requires a value (claude or opencode)${NC}"
3101
3100
  exit 1
3102
3101
  fi
3103
3102
  ;;
@@ -3106,45 +3105,6 @@ cmd_start() {
3106
3105
  args+=("--provider" "$provider")
3107
3106
  shift
3108
3107
  ;;
3109
- --aider-model)
3110
- if [[ -n "${2:-}" ]]; then
3111
- export LOKI_AIDER_MODEL="$2"
3112
- shift 2
3113
- else
3114
- echo -e "${RED}--aider-model requires a value${NC}"
3115
- exit 1
3116
- fi
3117
- ;;
3118
- --aider-model=*)
3119
- export LOKI_AIDER_MODEL="${1#*=}"
3120
- shift
3121
- ;;
3122
- --aider-flags)
3123
- if [[ -n "${2:-}" ]]; then
3124
- export LOKI_AIDER_FLAGS="$2"
3125
- shift 2
3126
- else
3127
- echo -e "${RED}--aider-flags requires a value${NC}"
3128
- exit 1
3129
- fi
3130
- ;;
3131
- --aider-flags=*)
3132
- export LOKI_AIDER_FLAGS="${1#*=}"
3133
- shift
3134
- ;;
3135
- --cline-model)
3136
- if [[ -n "${2:-}" ]]; then
3137
- export LOKI_CLINE_MODEL="$2"
3138
- shift 2
3139
- else
3140
- echo -e "${RED}--cline-model requires a value${NC}"
3141
- exit 1
3142
- fi
3143
- ;;
3144
- --cline-model=*)
3145
- export LOKI_CLINE_MODEL="${1#*=}"
3146
- shift
3147
- ;;
3148
3108
  --parallel)
3149
3109
  args+=("--parallel")
3150
3110
  shift
@@ -3657,7 +3617,7 @@ cmd_start() {
3657
3617
  # is deliberately narrower than it.
3658
3618
  #
3659
3619
  # provider_offer_gate passes when ANY provider is on PATH, so `--provider
3660
- # codex` on a claude-only machine sails through it and dies much later in
3620
+ # opencode` on a claude-only machine sails through it and dies much later in
3661
3621
  # the runner. And when NOTHING is installed the gate offers to install
3662
3622
  # CLAUDE, which is a nudge toward substituting a provider the user did not
3663
3623
  # ask for. An explicit choice that cannot be honoured is an error, never a
@@ -3679,7 +3639,7 @@ cmd_start() {
3679
3639
  # Single source: SUPPORTED_PROVIDERS in providers/loader.sh.
3680
3640
  local _pf_known
3681
3641
  _pf_known="$(sed -n 's/^SUPPORTED_PROVIDERS=(\(.*\))$/\1/p' "$_LOKI_SCRIPT_DIR/../providers/loader.sh" 2>/dev/null | tr -d '"' | head -1)"
3682
- [ -n "$_pf_known" ] || _pf_known="claude codex cline aider opencode"
3642
+ [ -n "$_pf_known" ] || _pf_known="claude opencode"
3683
3643
  case " $_pf_known " in
3684
3644
  *" $_pf_explicit "*) ;;
3685
3645
  *)
@@ -3698,9 +3658,6 @@ cmd_start() {
3698
3658
  echo "Install it:" >&2
3699
3659
  case "$_pf_explicit" in
3700
3660
  claude) echo " npm install -g @anthropic-ai/claude-code" >&2 ;;
3701
- codex) echo " npm install -g @openai/codex" >&2 ;;
3702
- cline) echo " npm install -g cline" >&2 ;;
3703
- aider) echo " pip install aider-chat" >&2 ;;
3704
3661
  opencode) echo " npm install -g opencode-ai" >&2 ;;
3705
3662
  *) echo " No install command is known for '$_pf_explicit'." >&2 ;;
3706
3663
  esac
@@ -3710,7 +3667,7 @@ cmd_start() {
3710
3667
  echo "Re-run with one of those, e.g. loki start --provider ${_pf_installed%% *}" >&2
3711
3668
  else
3712
3669
  echo "No supported provider CLI is installed on this machine." >&2
3713
- echo "Supported providers: claude, codex, cline, aider, opencode" >&2
3670
+ echo "Supported providers: claude, opencode" >&2
3714
3671
  fi
3715
3672
  echo "" >&2
3716
3673
  echo "Loki will not silently run a different provider than the one you asked for." >&2
@@ -4382,7 +4339,7 @@ cmd_start() {
4382
4339
  # can drop the marker when the originating process is no longer alive
4383
4340
  # (SIGKILL / crash paths that skip our cleanup hooks).
4384
4341
  case "$provider" in
4385
- claude|codex|cline|aider|opencode)
4342
+ claude|opencode)
4386
4343
  mkdir -p "$LOKI_DIR/state" 2>/dev/null || true
4387
4344
  printf '%s:%s:%s\n' "$provider" "$(date +%s)" "$$" \
4388
4345
  > "$LOKI_DIR/state/.cli-provider.tmp" 2>/dev/null \
@@ -4401,7 +4358,7 @@ cmd_start() {
4401
4358
  --action "provider_selection" \
4402
4359
  --key "provider" \
4403
4360
  --value "$provider" \
4404
- --rejected '["'"$([ "$provider" != "claude" ] && echo "claude" || echo "codex")'", "'"$([ "$provider" != "cline" ] && echo "cline" || echo "aider")'"]' \
4361
+ --rejected "[\"$([ "$provider" != "claude" ] && echo claude || echo opencode)\"]" \
4405
4362
  --confidence 0.95
4406
4363
  fi
4407
4364
 
@@ -4617,8 +4574,8 @@ _kill_pid() {
4617
4574
  }
4618
4575
 
4619
4576
  # v7.7.34 group-kill, factored (loki-stop-F1). Reaps the orchestrator's whole
4620
- # process group via the recorded pgid so the autonomous agent (claude/codex/
4621
- # aider), which shares the orchestrator group and would otherwise reparent to
4577
+ # process group via the recorded pgid so the autonomous agent (claude/
4578
+ # opencode), which shares the orchestrator group and would otherwise reparent to
4622
4579
  # init and keep editing files, is killed atomically. This is the SAME logic the
4623
4580
  # no-arg `loki stop` path used inline; it is now shared so the by-id path
4624
4581
  # (`loki stop <session-id>`) gets identical reaping instead of skipping it.
@@ -4777,7 +4734,7 @@ cmd_stop() {
4777
4734
  # loki-stop-F1: group-kill FIRST (v7.7.34 discipline), scoped to THIS
4778
4735
  # session's recorded pgid. Without this the by-id path reaped only the
4779
4736
  # orchestrator pid (via _stop_session_by_id -> _kill_pid), leaving the
4780
- # autonomous agent (claude/codex/aider) -- which shares the
4737
+ # autonomous agent (claude/opencode) -- which shares the
4781
4738
  # orchestrator's process group -- to reparent to init and keep editing
4782
4739
  # files. That is exactly the v7.7.34 orphaned-agent bug, reopened on
4783
4740
  # the by-id path. The pgid is session-scoped: run.sh writes it next to
@@ -4877,7 +4834,7 @@ cmd_stop() {
4877
4834
  # Stop global session
4878
4835
  touch "$LOKI_DIR/STOP"
4879
4836
 
4880
- # v7.7.34: group-kill first. The autonomous agent (claude/codex/aider)
4837
+ # v7.7.34: group-kill first. The autonomous agent (claude/opencode)
4881
4838
  # shares the orchestrator's process group (the runner is launched as a
4882
4839
  # session leader), so signaling the whole group reaps the orchestrator
4883
4840
  # AND the agent child atomically. Killing only the orchestrator pid lets
@@ -6405,10 +6362,7 @@ LAST_ERROR_ACTIONS = {
6405
6362
  # every option LABELLED rather than presenting one provider's fix as the answer.
6406
6363
  PROVIDER_AUTH = {
6407
6364
  "claude": "claude auth login (or set ANTHROPIC_API_KEY)",
6408
- "codex": "codex login (or set OPENAI_API_KEY)",
6409
- "aider": "set the API key for your aider model (OPENAI_API_KEY / ANTHROPIC_API_KEY)",
6410
- "cline": "re-enter the API key in Cline's provider settings",
6411
- "opencode": "opencode auth login",
6365
+ "opencode": "opencode auth login (or set OPENROUTER_API_KEY for openrouter/<vendor>/<model>)",
6412
6366
  }
6413
6367
 
6414
6368
 
@@ -6941,18 +6895,12 @@ cmd_status() {
6941
6895
  # Show provider with capability
6942
6896
  local capability="full features"
6943
6897
  case "$current_provider" in
6944
- codex|aider)
6945
- capability="degraded mode"
6946
- ;;
6947
- cline)
6948
- capability="near-full mode"
6949
- ;;
6950
6898
  opencode)
6951
6899
  capability="model-agnostic mode"
6952
6900
  ;;
6953
6901
  esac
6954
6902
  echo -e "${CYAN}Provider:${NC} $current_provider ($capability)"
6955
- echo -e "${DIM} Switch with: loki provider set <claude|codex|cline|aider|opencode>${NC}"
6903
+ echo -e "${DIM} Switch with: loki provider set <claude|opencode>${NC}"
6956
6904
  echo ""
6957
6905
 
6958
6906
  # Show running sessions (v6.4.0 - concurrent session support)
@@ -7188,7 +7136,7 @@ def _read_cli_provider(loki_dir):
7188
7136
  return None, False
7189
7137
  prov = parts[0]
7190
7138
  ts = int(parts[1])
7191
- if prov not in ('claude', 'codex', 'cline', 'aider', 'opencode'):
7139
+ if prov not in ('claude', 'opencode'):
7192
7140
  return None, False
7193
7141
  if time.time() - ts > 86400:
7194
7142
  return None, False
@@ -7838,9 +7786,9 @@ _cmd_provider_help() {
7838
7786
  echo "Examples:"
7839
7787
  echo " loki provider show"
7840
7788
  echo " loki provider set claude"
7841
- echo " loki provider set codex"
7789
+ echo " loki provider set opencode"
7842
7790
  echo " loki provider list"
7843
- echo " loki provider info codex"
7791
+ echo " loki provider info opencode"
7844
7792
  echo " loki provider models"
7845
7793
  }
7846
7794
 
@@ -7863,12 +7811,6 @@ cmd_provider_show() {
7863
7811
  claude)
7864
7812
  echo -e "${GREEN}Status:${NC} Full features (subagents, parallel, MCP)"
7865
7813
  ;;
7866
- cline)
7867
- echo -e "${GREEN}Status:${NC} Near-full mode (subagents, MCP, 12+ providers)"
7868
- ;;
7869
- codex|aider)
7870
- echo -e "${YELLOW}Status:${NC} Degraded mode (sequential only)"
7871
- ;;
7872
7814
  opencode)
7873
7815
  echo -e "${GREEN}Status:${NC} Model-agnostic mode (75+ providers, MCP)"
7874
7816
  ;;
@@ -7890,22 +7832,22 @@ cmd_provider_set() {
7890
7832
 
7891
7833
  if [ -z "$new_provider" ]; then
7892
7834
  echo -e "${RED}Error: Provider name required${NC}"
7893
- echo "Usage: loki provider set <claude|codex|cline|aider|opencode>"
7835
+ echo "Usage: loki provider set <claude|opencode>"
7894
7836
  exit 2
7895
7837
  fi
7896
7838
 
7897
- # Validate provider
7839
+ # Validate provider. Removed providers print the one migration line
7840
+ # (providers/loader.sh owns the list and the text).
7841
+ if loki_is_removed_provider "$new_provider"; then
7842
+ loki_removed_provider_message "$new_provider" >&2
7843
+ exit 2
7844
+ fi
7898
7845
  case "$new_provider" in
7899
- gemini)
7900
- echo -e "${RED}Error: Provider 'gemini' is deprecated as of v7.5.18 and has been removed.${NC}"
7901
- echo "Active providers: claude, codex, cline, aider, opencode"
7902
- exit 1
7903
- ;;
7904
- claude|codex|cline|aider|opencode)
7846
+ claude|opencode)
7905
7847
  ;;
7906
7848
  *)
7907
7849
  echo -e "${RED}Error: Invalid provider '$new_provider'${NC}"
7908
- echo "Valid providers: claude, codex, cline, aider, opencode"
7850
+ echo "Valid providers: claude, opencode"
7909
7851
  exit 1
7910
7852
  ;;
7911
7853
  esac
@@ -7918,15 +7860,6 @@ cmd_provider_set() {
7918
7860
  claude)
7919
7861
  echo "Install: npm install -g @anthropic-ai/claude-code"
7920
7862
  ;;
7921
- codex)
7922
- echo "Install: npm install -g @openai/codex"
7923
- ;;
7924
- cline)
7925
- echo "Install: npm install -g cline"
7926
- ;;
7927
- aider)
7928
- echo "Install: pip install aider-chat"
7929
- ;;
7930
7863
  opencode)
7931
7864
  echo "Install: npm install -g opencode-ai"
7932
7865
  ;;
@@ -7957,23 +7890,11 @@ cmd_provider_list() {
7957
7890
 
7958
7891
  # Check which CLIs are installed
7959
7892
  local claude_status="${RED}not installed${NC}"
7960
- local codex_status="${RED}not installed${NC}"
7961
- local cline_status="${RED}not installed${NC}"
7962
- local aider_status="${RED}not installed${NC}"
7963
7893
  local opencode_status="${RED}not installed${NC}"
7964
7894
 
7965
7895
  if command -v claude &> /dev/null; then
7966
7896
  claude_status="${GREEN}installed${NC}"
7967
7897
  fi
7968
- if command -v codex &> /dev/null; then
7969
- codex_status="${GREEN}installed${NC}"
7970
- fi
7971
- if command -v cline &> /dev/null; then
7972
- cline_status="${GREEN}installed${NC}"
7973
- fi
7974
- if command -v aider &> /dev/null; then
7975
- aider_status="${GREEN}installed${NC}"
7976
- fi
7977
7898
  if command -v opencode &> /dev/null; then
7978
7899
  opencode_status="${GREEN}installed${NC}"
7979
7900
  fi
@@ -7983,22 +7904,6 @@ cmd_provider_list() {
7983
7904
  [ "$current" = "claude" ] && marker=" ${CYAN}(current)${NC}"
7984
7905
  echo -e " claude - Claude Code (Anthropic) $claude_status$marker"
7985
7906
 
7986
- marker=""
7987
- [ "$current" = "codex" ] && marker=" ${CYAN}(current)${NC}"
7988
- echo -e " codex - Codex CLI (OpenAI) $codex_status$marker"
7989
-
7990
- marker=""
7991
- [ "$current" = "cline" ] && marker=" ${CYAN}(current)${NC}"
7992
- echo -e " cline - Cline (multi-provider) $cline_status$marker"
7993
-
7994
- marker=""
7995
- [ "$current" = "aider" ] && marker=" ${CYAN}(current)${NC}"
7996
- echo -e " aider - Aider (terminal pair prog) $aider_status$marker"
7997
-
7998
- # opencode was absent here while auto_detect_provider() has selected it
7999
- # since v8.64.0, so `loki provider list` under-reported a provider the
8000
- # runner will happily choose -- the same drift that blocked opencode-only
8001
- # machines outright until v8.76.0.
8002
7907
  marker=""
8003
7908
  [ "$current" = "opencode" ] && marker=" ${CYAN}(current)${NC}"
8004
7909
  echo -e " opencode - opencode (multi-provider) $opencode_status$marker"
@@ -8028,46 +7933,6 @@ cmd_provider_info() {
8028
7933
  echo ""
8029
7934
  echo "Status: Full features"
8030
7935
  ;;
8031
- codex)
8032
- echo "Name: Codex CLI"
8033
- echo "Vendor: OpenAI"
8034
- echo "CLI: codex"
8035
- echo "Flag: --sandbox workspace-write"
8036
- echo ""
8037
- echo "Features:"
8038
- echo " - Autonomous mode"
8039
- echo " - Sequential only (no subagents)"
8040
- echo ""
8041
- echo "Status: Degraded mode"
8042
- ;;
8043
- cline)
8044
- echo "Name: Cline CLI (Multi-Provider)"
8045
- echo "Vendor: Cline (supports 12+ providers)"
8046
- echo "CLI: cline"
8047
- echo "Flag: -y (YOLO mode)"
8048
- echo ""
8049
- echo "Features:"
8050
- echo " - Autonomous mode"
8051
- echo " - Subagent support"
8052
- echo " - MCP server support"
8053
- echo " - 12+ model providers"
8054
- echo ""
8055
- echo "Status: Near-full mode (Tier 2)"
8056
- ;;
8057
- aider)
8058
- echo "Name: Aider (18+ Providers)"
8059
- echo "Vendor: Aider (supports 18+ providers)"
8060
- echo "CLI: aider"
8061
- echo "Flag: --yes-always"
8062
- echo ""
8063
- echo "Features:"
8064
- echo " - Autonomous mode"
8065
- echo " - 18+ model providers"
8066
- echo " - Architect mode (dual model)"
8067
- echo " - Built-in lint/test integration"
8068
- echo ""
8069
- echo "Status: Degraded mode (Tier 3)"
8070
- ;;
8071
7936
  opencode)
8072
7937
  echo "Name: opencode (75+ Providers)"
8073
7938
  echo "Vendor: opencode (model-agnostic registry)"
@@ -8077,6 +7942,7 @@ cmd_provider_info() {
8077
7942
  echo "Features:"
8078
7943
  echo " - Autonomous mode"
8079
7944
  echo " - 75+ model providers and custom endpoints"
7945
+ echo " - OpenRouter: export OPENROUTER_API_KEY, model openrouter/<vendor>/<model>"
8080
7946
  echo " - Local model support"
8081
7947
  echo " - MCP server support"
8082
7948
  echo ""
@@ -8104,7 +7970,7 @@ cmd_provider_models() {
8104
7970
 
8105
7971
  # opencode ships a provider file and a catalog entry, so omitting it here
8106
7972
  # under-reported what this command claims to show ("all providers").
8107
- local providers=("claude" "codex" "cline" "aider" "opencode")
7973
+ local providers=("claude" "opencode")
8108
7974
  for provider in "${providers[@]}"; do
8109
7975
  local provider_file="$script_dir/providers/${provider}.sh"
8110
7976
  [ -f "$provider_file" ] || continue
@@ -8126,30 +7992,11 @@ cmd_provider_models() {
8126
7992
  tier_upper=$(echo "$tier" | tr '[:lower:]' '[:upper:]')
8127
7993
  local source="default"
8128
7994
 
8129
- # Single-model providers (aider, cline) only chain through their own env var
8130
- # and LOKI_MODEL_DEVELOPMENT -- they ignore per-tier and generic tier vars
8131
- if [ "$provider" = "aider" ]; then
8132
- if [ -n "${LOKI_AIDER_MODEL+x}" ]; then
8133
- source="LOKI_AIDER_MODEL"
8134
- elif [ -n "${LOKI_MODEL_DEVELOPMENT+x}" ]; then
8135
- source="LOKI_MODEL_DEVELOPMENT"
8136
- fi
8137
- elif [ "$provider" = "cline" ]; then
8138
- if [ -n "${LOKI_CLINE_MODEL+x}" ]; then
8139
- source="LOKI_CLINE_MODEL"
8140
- elif [ -n "${LOKI_MODEL_DEVELOPMENT+x}" ]; then
8141
- source="LOKI_MODEL_DEVELOPMENT"
8142
- fi
8143
- elif [ "$provider" = "codex" ]; then
8144
- # Codex uses single LOKI_CODEX_MODEL or generic tier vars
8145
- if [ -n "${LOKI_CODEX_MODEL+x}" ]; then
8146
- source="LOKI_CODEX_MODEL"
8147
- else
8148
- local generic_var="LOKI_MODEL_${tier_upper}"
8149
- eval "local gval=\${$generic_var+x}"
8150
- if [ -n "$gval" ]; then
8151
- source="$generic_var"
8152
- fi
7995
+ if [ "$provider" = "opencode" ]; then
7996
+ # opencode takes "provider/model" ids from LOKI_OPENCODE_MODEL only
7997
+ # (the global tier vars carry Claude aliases).
7998
+ if [ -n "${LOKI_OPENCODE_MODEL+x}" ]; then
7999
+ source="LOKI_OPENCODE_MODEL"
8153
8000
  fi
8154
8001
  else
8155
8002
  # Multi-tier providers (claude): check provider-specific per-tier, then generic
@@ -8191,27 +8038,14 @@ cmd_provider_models() {
8191
8038
  esac
8192
8039
 
8193
8040
  # An EMPTY resolved model is a real, supported state, not a lookup
8194
- # failure: providers/codex.sh sets CODEX_DEFAULT_MODEL="" on purpose
8195
- # so no --model flag is passed and Codex resolves an
8196
- # account-appropriate default (a hardcoded name broke ChatGPT-account
8197
- # users outright). Say that plainly instead of printing a blank
8198
- # column. Deliberately NOT filled in from the catalog: this table
8199
- # reports what will be DISPATCHED, and the catalog id would be a
8200
- # guess this file is documented as unable to make.
8041
+ # failure: no --model flag is passed and the provider CLI resolves its
8042
+ # own default. Say that plainly instead of printing a blank column.
8201
8043
  [ -n "$value" ] || value="(provider default -- no --model sent)"
8202
8044
 
8203
8045
  printf " %-8s %-14s %-38s (source: %s)\n" \
8204
8046
  "$generic" "(${tier})" "$value" "$source"
8205
8047
  done
8206
8048
 
8207
- # Show extra info per provider
8208
- if [ "$provider" = "codex" ]; then
8209
- local effort_p effort_d effort_f
8210
- effort_p=$(bash -c "source '$provider_file' 2>/dev/null; echo \$PROVIDER_EFFORT_PLANNING")
8211
- effort_d=$(bash -c "source '$provider_file' 2>/dev/null; echo \$PROVIDER_EFFORT_DEVELOPMENT")
8212
- effort_f=$(bash -c "source '$provider_file' 2>/dev/null; echo \$PROVIDER_EFFORT_FAST")
8213
- echo " Effort: planning=$effort_p, development=$effort_d, fast=$effort_f"
8214
- fi
8215
8049
  echo ""
8216
8050
  done
8217
8051
  }
@@ -8880,7 +8714,7 @@ cmd_welcome_terminal() {
8880
8714
  echo ""
8881
8715
  echo -e " ${CYAN}Closure loop + council${NC} Every change is verified by a unanimous council."
8882
8716
  echo -e " ${CYAN}Cross-project memory${NC} Lessons compound, so agents stop repeating mistakes."
8883
- echo -e " ${CYAN}Provider-agnostic${NC} Claude, Codex, Cline, or Aider. Your keys, your infra."
8717
+ echo -e " ${CYAN}Provider-agnostic${NC} Claude Code, or any model through opencode. Your keys, your infra."
8884
8718
  echo ""
8885
8719
  echo -e " Try it now: ${BOLD}loki tour${NC} (a real sample result, no provider, no key, no spend)"
8886
8720
  echo -e " Quick start: ${BOLD}loki quickstart${NC} (from your idea) or ${BOLD}loki start ./prd.md${NC} (from a spec)"
@@ -12467,7 +12301,7 @@ cmd_run() {
12467
12301
  echo " --dry-run Preview generated PRD without starting"
12468
12302
  echo " --no-start Generate PRD but don't start execution"
12469
12303
  echo " --output FILE Save PRD to custom path"
12470
- echo " --provider NAME AI provider: claude (default), codex, cline, aider, opencode"
12304
+ echo " --provider NAME AI provider: claude (default) or opencode"
12471
12305
  echo " --parallel Enable parallel mode with git worktrees"
12472
12306
  echo " --bg, --background Run in background mode"
12473
12307
  echo " --simple Force simple complexity tier"
@@ -12499,7 +12333,7 @@ cmd_run() {
12499
12333
  echo " loki run PROJ-789 # Jira issue"
12500
12334
  echo " loki run https://gitlab.com/o/r/-/issues/42 # GitLab issue"
12501
12335
  echo " loki run 123 --dry-run # Preview PRD"
12502
- echo " loki run 123 --parallel --provider codex # Parallel mode with Codex"
12336
+ echo " loki run 123 --provider opencode # Run with opencode"
12503
12337
  echo " loki run 123 --worktree # Isolated branch"
12504
12338
  echo " loki run 123 --pr # Auto-create PR"
12505
12339
  echo " loki run 123 --ship # Full automation: PR + merge"
@@ -12543,7 +12377,7 @@ cmd_run() {
12543
12377
  # v7.7.11 (council fix): validate against canonical set; include
12544
12378
  # PID so reader can drop the marker when originating process is gone.
12545
12379
  case "$2" in
12546
- claude|codex|cline|aider|opencode)
12380
+ claude|opencode)
12547
12381
  mkdir -p "${LOKI_DIR:-.loki}/state" 2>/dev/null || true
12548
12382
  printf '%s:%s:%s\n' "$2" "$(date +%s)" "$$" \
12549
12383
  > "${LOKI_DIR:-.loki}/state/.cli-provider.tmp" 2>/dev/null \
@@ -12563,7 +12397,7 @@ cmd_run() {
12563
12397
  # UT2-13: Record CLI provider at parse time (atomic write).
12564
12398
  # v7.7.11 (council fix): validate + include PID.
12565
12399
  case "$provider_override" in
12566
- claude|codex|cline|aider|opencode)
12400
+ claude|opencode)
12567
12401
  mkdir -p "${LOKI_DIR:-.loki}/state" 2>/dev/null || true
12568
12402
  printf '%s:%s:%s\n' "$provider_override" "$(date +%s)" "$$" \
12569
12403
  > "${LOKI_DIR:-.loki}/state/.cli-provider.tmp" 2>/dev/null \
@@ -13229,7 +13063,7 @@ cmd_issue() {
13229
13063
  echo " --output FILE Save PRD to custom path (default: .loki/prd-issue-N.md)"
13230
13064
  echo ""
13231
13065
  echo "Options passed to 'start' (when --start is used):"
13232
- echo " --provider NAME AI provider: claude (default), codex, cline, aider, opencode"
13066
+ echo " --provider NAME AI provider: claude (default) or opencode"
13233
13067
  echo " --parallel Enable parallel mode with git worktrees"
13234
13068
  echo " --bg, --background Run in background mode"
13235
13069
  echo ""
@@ -14654,7 +14488,7 @@ cmd_config() {
14654
14488
  echo " model.planning Model for planning tier"
14655
14489
  echo " model.development Model for development tier"
14656
14490
  echo " model.fast Model for fast tier"
14657
- echo " provider Default AI provider: claude, codex, cline, aider, opencode"
14491
+ echo " provider Default AI provider: claude, opencode"
14658
14492
  echo " issue.provider Default issue provider: github, gitlab, jira, azure_devops"
14659
14493
  echo " blind_validation Blind validation mode: true, false (default: true)"
14660
14494
  echo " adversarial_testing Adversarial testing: true, false (default: true)"
@@ -14717,13 +14551,10 @@ cmd_config_set() {
14717
14551
  esac
14718
14552
  ;;
14719
14553
  provider)
14554
+ if loki_is_removed_provider "$value"; then loki_removed_provider_message "$value" >&2; return 2; fi
14720
14555
  case "$value" in
14721
- gemini)
14722
- echo -e "${RED}Invalid provider: 'gemini' is deprecated as of v7.5.18. Active providers: claude, codex, cline, aider, opencode${NC}"
14723
- return 1
14724
- ;;
14725
- claude|codex|cline|aider|opencode) ;;
14726
- *) echo -e "${RED}Invalid provider: $value (expected: claude, codex, cline, aider, opencode)${NC}"; return 1 ;;
14556
+ claude|opencode) ;;
14557
+ *) echo -e "${RED}Invalid provider: $value (expected: claude, opencode)${NC}"; return 1 ;;
14727
14558
  esac
14728
14559
  ;;
14729
14560
  issue.provider)
@@ -15242,7 +15073,7 @@ cmd_setup_skill() {
15242
15073
  echo "Usage: loki setup-skill [options]"
15243
15074
  echo ""
15244
15075
  echo "Installs the Loki Mode skill into each detected provider CLI's"
15245
- echo "skills directory: ~/.claude/skills/, ~/.codex/skills/, etc."
15076
+ echo "skills directory: ~/.claude/skills/."
15246
15077
  echo ""
15247
15078
  echo "Options:"
15248
15079
  echo " --claude-code Merge the Loki plugin into Claude Code settings (see --claude-code --help)"
@@ -15262,9 +15093,6 @@ cmd_setup_skill() {
15262
15093
 
15263
15094
  local skill_targets=(
15264
15095
  "$HOME/.claude/skills/loki-mode:Claude Code"
15265
- "$HOME/.codex/skills/loki-mode:Codex CLI"
15266
- "$HOME/.cline/skills/loki-mode:Cline CLI"
15267
- "$HOME/.aider/skills/loki-mode:Aider CLI"
15268
15096
  )
15269
15097
 
15270
15098
  local created=0
@@ -15699,11 +15527,7 @@ _loki_airgap_audit() {
15699
15527
  model_host="${ANTHROPIC_BASE_URL:-https://api.anthropic.com}"
15700
15528
  model_note="Claude Code inference. An in-network gateway (ANTHROPIC_BASE_URL) keeps it inside your network but is still counted as required egress here; only a local-weights provider clears it."
15701
15529
  ;;
15702
- codex)
15703
- model_host="${OPENAI_BASE_URL:-https://api.openai.com}"
15704
- model_note="Codex inference. An in-network gateway (OPENAI_BASE_URL) is still counted as required egress here; only a local-weights provider clears it."
15705
- ;;
15706
- opencode|cline|aider)
15530
+ opencode)
15707
15531
  model_host="${OPENAI_BASE_URL:-${OPENROUTER_API_KEY:+https://openrouter.ai}}"
15708
15532
  # Local ONLY on positive evidence: a model id naming a local runtime.
15709
15533
  # An unset endpoint is not that evidence -- the opencode catalog
@@ -15711,12 +15535,7 @@ _loki_airgap_audit() {
15711
15535
  # Judge only the ACTIVE provider's model variable (the one
15712
15536
  # providers/<provider>.sh reads): another provider's local model
15713
15537
  # says nothing about where this provider sends inference.
15714
- local model_var model_id
15715
- case "$provider" in
15716
- opencode) model_var="LOKI_OPENCODE_MODEL" model_id="${LOKI_OPENCODE_MODEL:-}" ;;
15717
- cline) model_var="LOKI_CLINE_MODEL" model_id="${LOKI_CLINE_MODEL:-}" ;;
15718
- aider) model_var="LOKI_AIDER_MODEL" model_id="${LOKI_AIDER_MODEL:-}" ;;
15719
- esac
15538
+ local model_var="LOKI_OPENCODE_MODEL" model_id="${LOKI_OPENCODE_MODEL:-}"
15720
15539
  # An Ollama cloud model (tag ending ":cloud" or "-cloud") runs on
15721
15540
  # ollama.com through the local daemon (docs.ollama.com/cloud), so
15722
15541
  # naming ollama is not evidence of local inference regardless of
@@ -15741,7 +15560,7 @@ _loki_airgap_audit() {
15741
15560
  if [ "$ollama_host_local" = "1" ]; then
15742
15561
  model_host="local weights"
15743
15562
  model_required="no"
15744
- model_note="Local model runtime named by $model_var=$model_id. Judged from the model id (and OLLAMA_HOST when set): the endpoint set in the opencode, cline or aider config is not read, so confirm it is on this host or inside your network."
15563
+ model_note="Local model runtime named by $model_var=$model_id. Judged from the model id (and OLLAMA_HOST when set): the endpoint set in the opencode config is not read, so confirm it is on this host or inside your network."
15745
15564
  else
15746
15565
  model_host="$OLLAMA_HOST"
15747
15566
  model_note="OLLAMA_HOST points at a remote host; inference leaves it. Unset OLLAMA_HOST or point it at loopback for zero-egress inference."
@@ -15797,7 +15616,7 @@ egress = [{
15797
15616
  "name": "model_inference",
15798
15617
  "host": os.environ["_AG_HOST"],
15799
15618
  "required": req,
15800
- "disable": "use a local-weights provider (opencode, cline or aider with a local ollama/ or lmstudio/ model id)",
15619
+ "disable": "use a local-weights provider (opencode with a local ollama/ or lmstudio/ model id)",
15801
15620
  "note": os.environ["_AG_NOTE"],
15802
15621
  }, {
15803
15622
  "name": "telemetry",
@@ -17080,7 +16899,7 @@ wow_provider_ready() {
17080
16899
  [ -e "${HOME}/.claude.json" ] || [ -d "${HOME}/.claude" ] || return 1
17081
16900
  return 0
17082
16901
  ;;
17083
- opencode|codex|cline|aider)
16902
+ opencode)
17084
16903
  command -v "$p" >/dev/null 2>&1
17085
16904
  ;;
17086
16905
  *)
@@ -17181,7 +17000,7 @@ cmd_wow() {
17181
17000
  echo " --offline Always show the offline sample"
17182
17001
  echo " --dry-run Print the plan. No model call, no spend"
17183
17002
  echo " --keep Keep the temp repo (default: removed after the receipt is printed)"
17184
- echo " --provider P claude (default) or opencode, codex, cline, aider"
17003
+ echo " --provider P claude (default) or opencode"
17185
17004
  echo " --max-cost N Hard per-run cap in USD, a positive number (default 2). budgets.per_run still applies"
17186
17005
  echo ""
17187
17006
  echo "loki tour stays the offline sample. loki tour --live is this command."
@@ -17222,8 +17041,8 @@ cmd_wow() {
17222
17041
 
17223
17042
  local use_provider="${provider:-${LOKI_PROVIDER:-claude}}"
17224
17043
  case "$use_provider" in
17225
- claude|opencode|codex|cline|aider) ;;
17226
- *) echo "loki wow: unknown provider '$use_provider' (use claude, opencode, codex, cline or aider)" >&2; return 2 ;;
17044
+ claude|opencode) ;;
17045
+ *) echo "loki wow: unknown provider '$use_provider' (use claude or opencode)" >&2; return 2 ;;
17227
17046
  esac
17228
17047
  if ! wow_provider_ready "$use_provider"; then
17229
17048
  if [ "$dry_run" = true ]; then
@@ -17356,7 +17175,7 @@ cmd_demo() {
17356
17175
  echo " loki wow # Live mini-task, or the offline sample with no key"
17357
17176
  echo " loki demo # Build todo app in temp dir"
17358
17177
  echo " loki demo --dir ~/demo-project # Build in specific directory"
17359
- echo " loki demo --provider codex # Use Codex instead of Claude"
17178
+ echo " loki demo --provider opencode # Use opencode instead of Claude"
17360
17179
  return 0
17361
17180
  fi
17362
17181
 
@@ -18241,7 +18060,7 @@ INSTRUCTIONS:
18241
18060
  echo -e "${CYAN}[AI] Analyzing $svc_name failure with ${LOKI_PROVIDER:-claude}...${NC}"
18242
18061
 
18243
18062
  # 4. LET AI FIX: Run loki quick with the AI prompt
18244
- # The AI provider (claude/codex/ollama) decides what to fix
18063
+ # The AI provider (claude/opencode) decides what to fix
18245
18064
  fix_count=$((fix_count + 1))
18246
18065
  echo -e "${CYAN}[FIX] Attempt $fix_count/$max_fixes${NC}"
18247
18066
 
@@ -18802,7 +18621,7 @@ ENDGITIGNORE
18802
18621
  # opencode here made `loki provider list` under-report a provider the
18803
18622
  # runner will happily select -- the same drift that blocked
18804
18623
  # opencode-only machines entirely until v8.76.0.
18805
- for _pcli in claude cline codex aider opencode; do
18624
+ for _pcli in claude opencode; do
18806
18625
  if command -v "$_pcli" &>/dev/null; then
18807
18626
  _has_provider=true
18808
18627
  break
@@ -18813,7 +18632,7 @@ ENDGITIGNORE
18813
18632
  echo -e "${YELLOW}Note: No AI provider CLI detected.${NC}"
18814
18633
  echo " Install at least one before running 'loki start':"
18815
18634
  echo " npm install -g @anthropic-ai/claude-code (recommended)"
18816
- echo " npm install -g @openai/codex"
18635
+ echo " npm install -g opencode-ai (any model, including OpenRouter)"
18817
18636
  echo ""
18818
18637
  echo " Then verify your setup: ${BOLD}loki doctor${NC}"
18819
18638
  fi
@@ -19800,23 +19619,11 @@ except Exception: pass
19800
19619
  fi
19801
19620
  done; } && phase_exit=0 || phase_exit=$?
19802
19621
  ;;
19803
- codex)
19804
- (cd "$codebase_path" && codex exec --sandbox workspace-write "$phase_prompt" 2>&1) || phase_exit=$?
19805
- ;;
19806
- cline)
19807
- (cd "$codebase_path" && cline -y "$phase_prompt" 2>&1) || phase_exit=$?
19808
- ;;
19809
- aider)
19810
- local aider_model="${LOKI_AIDER_MODEL:-claude-3.7-sonnet}"
19811
- local aider_flags="${LOKI_AIDER_FLAGS:-}"
19812
- # shellcheck disable=SC2086
19813
- (cd "$codebase_path" && aider --message "$phase_prompt" --yes-always --no-auto-commits --model "$aider_model" $aider_flags 2>&1) || phase_exit=$?
19814
- ;;
19815
19622
  opencode)
19816
19623
  (cd "$codebase_path" && source "$_LOKI_SCRIPT_DIR/../providers/opencode.sh" && provider_invoke "$phase_prompt" 2>&1) || phase_exit=$?
19817
19624
  ;;
19818
19625
  *)
19819
- echo -e "${RED}Error: Unknown provider '${provider_name}'. Supported: claude, codex, cline, aider, opencode${NC}"
19626
+ echo -e "${RED}Error: Unknown provider '${provider_name}'. Supported: claude, opencode${NC}"
19820
19627
  phase_exit=1
19821
19628
  ;;
19822
19629
  esac
@@ -19977,17 +19784,8 @@ except Exception: pass
19977
19784
  fi
19978
19785
  done; } && doc_exit=0 || doc_exit=$?
19979
19786
  ;;
19980
- codex)
19981
- (cd "$codebase_path" && codex exec --sandbox workspace-write "$doc_prompt" 2>&1) || doc_exit=$?
19982
- ;;
19983
- cline)
19984
- (cd "$codebase_path" && cline -y "$doc_prompt" 2>&1) || doc_exit=$?
19985
- ;;
19986
- aider)
19987
- local aider_model="${LOKI_AIDER_MODEL:-claude-3.7-sonnet}"
19988
- local aider_flags="${LOKI_AIDER_FLAGS:-}"
19989
- # shellcheck disable=SC2086
19990
- (cd "$codebase_path" && aider --message "$doc_prompt" --yes-always --no-auto-commits --model "$aider_model" $aider_flags 2>&1) || doc_exit=$?
19787
+ opencode)
19788
+ (cd "$codebase_path" && source "$_LOKI_SCRIPT_DIR/../providers/opencode.sh" && provider_invoke "$doc_prompt" 2>&1) || doc_exit=$?
19991
19789
  ;;
19992
19790
  esac
19993
19791
 
@@ -21044,25 +20842,13 @@ except Exception: pass
21044
20842
  fi
21045
20843
  done && heal_exit=0 || heal_exit=$?
21046
20844
  ;;
21047
- codex)
21048
- (cd "$codebase_path" && codex exec --sandbox workspace-write "$heal_prompt" 2>&1) || heal_exit=$?
21049
- ;;
21050
- cline)
21051
- (cd "$codebase_path" && cline -y "$heal_prompt" 2>&1) || heal_exit=$?
21052
- ;;
21053
- aider)
21054
- local aider_model="${LOKI_AIDER_MODEL:-claude-3.7-sonnet}"
21055
- local aider_flags="${LOKI_AIDER_FLAGS:-}"
21056
- # shellcheck disable=SC2086
21057
- (cd "$codebase_path" && aider --message "$heal_prompt" --yes-always --no-auto-commits --model "$aider_model" $aider_flags 2>&1) || heal_exit=$?
21058
- ;;
21059
20845
  opencode)
21060
20846
  (cd "$codebase_path" && source "$_LOKI_SCRIPT_DIR/../providers/opencode.sh" && provider_invoke "$heal_prompt" 2>&1) || heal_exit=$?
21061
20847
  ;;
21062
20848
  # BUG-HEAL-003: Unknown provider should error, not silently succeed
21063
20849
  *)
21064
20850
  echo -e "${RED}Error: Unknown provider: $provider${NC}"
21065
- echo "Supported providers: claude, codex, cline, aider, opencode"
20851
+ echo "Supported providers: claude, opencode"
21066
20852
  return 1
21067
20853
  ;;
21068
20854
  esac
@@ -21852,12 +21638,12 @@ PYEOF
21852
21638
  mkdir -p "$loki_dir/state"
21853
21639
  local current_provider
21854
21640
  current_provider=$(cat "$loki_dir/state/provider" 2>/dev/null || echo "claude")
21855
- local chain="${LOKI_FAILOVER_CHAIN:-claude,codex,cline}"
21641
+ local chain="${LOKI_FAILOVER_CHAIN:-claude,opencode}"
21856
21642
 
21857
21643
  cat > "$failover_file" << FEOF
21858
21644
  {
21859
21645
  "enabled": true,
21860
- "chain": $(printf '%s' "$chain" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read().strip().split(",")))' 2>/dev/null || echo '["claude","codex","cline"]'),
21646
+ "chain": $(printf '%s' "$chain" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read().strip().split(",")))' 2>/dev/null || echo '["claude","opencode"]'),
21861
21647
  "currentProvider": "$current_provider",
21862
21648
  "primaryProvider": "$current_provider",
21863
21649
  "lastFailover": null,
@@ -21900,7 +21686,7 @@ with open(failover_file, 'w') as f: json.dump(d, f, indent=2)
21900
21686
  local IFS=','
21901
21687
  for p in $new_chain; do
21902
21688
  case "$p" in
21903
- claude|codex|cline|aider|opencode) ;;
21689
+ claude|opencode) ;;
21904
21690
  *) echo -e "${RED}Error: invalid provider '$p' in chain${NC}"; return 1 ;;
21905
21691
  esac
21906
21692
  done
@@ -21934,9 +21720,9 @@ with open(failover_file, 'w') as f: json.dump(d, f, indent=2)
21934
21720
  source "$script_dir/../providers/loader.sh"
21935
21721
  fi
21936
21722
 
21937
- local chain_providers="claude,codex,cline"
21723
+ local chain_providers="claude,opencode"
21938
21724
  if [ -f "$failover_file" ]; then
21939
- chain_providers=$(_FAILOVER_FILE="$failover_file" python3 -c "import json, os; print(','.join(json.load(open(os.environ['_FAILOVER_FILE'])).get('chain', ['claude','codex','cline'])))" 2>/dev/null || echo "claude,codex,cline")
21725
+ chain_providers=$(_FAILOVER_FILE="$failover_file" python3 -c "import json, os; print(','.join(json.load(open(os.environ['_FAILOVER_FILE'])).get('chain', ['claude','opencode'])))" 2>/dev/null || echo "claude,opencode")
21940
21726
  fi
21941
21727
 
21942
21728
  local IFS=','
@@ -21961,8 +21747,7 @@ with open(failover_file, 'w') as f: json.dump(d, f, indent=2)
21961
21747
  local has_key=false
21962
21748
  case "$p" in
21963
21749
  claude) [ -n "${ANTHROPIC_API_KEY:-}" ] && has_key=true ;;
21964
- codex) [ -n "${OPENAI_API_KEY:-}" ] && has_key=true ;;
21965
- cline|aider) has_key=true ;; # Key check varies
21750
+ opencode) has_key=true ;; # opencode auth login or a provider key (e.g. OPENROUTER_API_KEY)
21966
21751
  esac
21967
21752
 
21968
21753
  if [ "$has_key" = "true" ]; then
@@ -22002,7 +21787,7 @@ with open(failover_file, 'w') as f: json.dump(d, f, indent=2)
22002
21787
  echo " (no args) Show failover status and health"
22003
21788
  echo " --enable Enable auto-failover"
22004
21789
  echo " --disable Disable auto-failover"
22005
- echo " --chain X,Y,Z Set failover chain (e.g., claude,codex,cline)"
21790
+ echo " --chain X,Y,Z Set failover chain (e.g., claude,opencode)"
22006
21791
  echo " --test Test all providers in chain"
22007
21792
  echo " --reset Reset failover state to defaults"
22008
21793
  echo " --help, -h Show this help"
@@ -22737,7 +22522,7 @@ if integration_count > 3 or complexity in ('complex', 'enterprise'):
22737
22522
  recommended_provider = 'Claude'
22738
22523
  provider_reason = 'Full feature support needed (subagents, parallel, MCP)'
22739
22524
  elif complexity == 'simple' and endpoint_count == 0:
22740
- recommended_provider = 'Any (Claude/Codex/Cline)'
22525
+ recommended_provider = 'Any (Claude or opencode)'
22741
22526
  provider_reason = 'Simple project works with all providers'
22742
22527
  else:
22743
22528
  recommended_provider = 'Claude'
@@ -23080,10 +22865,7 @@ try_print_provider_setup() {
23080
22865
  for p in $known; do
23081
22866
  case "$p" in
23082
22867
  claude) hint="claude auth login (or set ANTHROPIC_API_KEY)" ;;
23083
- codex) hint="codex login (or set OPENAI_API_KEY)" ;;
23084
- opencode) hint="opencode auth login" ;;
23085
- aider) hint="install aider and set OPENAI_API_KEY or ANTHROPIC_API_KEY" ;;
23086
- cline) hint="install the cline CLI and configure its API key" ;;
22868
+ opencode) hint="opencode auth login (or export OPENROUTER_API_KEY)" ;;
23087
22869
  *) hint="install the $p CLI (no login command is mapped for it)" ;;
23088
22870
  esac
23089
22871
  echo " $p: $hint"
@@ -23147,7 +22929,7 @@ cmd_try() {
23147
22929
  echo ""
23148
22930
  echo "Options:"
23149
22931
  echo " --dry-run Clone, then print the clone path, the task and an estimate. No model call, no spend"
23150
- echo " --provider P claude (default) or opencode, codex, cline, aider"
22932
+ echo " --provider P claude (default) or opencode"
23151
22933
  echo " --max-cost N Hard per-run cap in USD, a positive number (default 2)"
23152
22934
  echo " --help, -h Show this help"
23153
22935
  echo ""
@@ -23203,8 +22985,8 @@ cmd_try() {
23203
22985
  fi
23204
22986
  local use_provider="${provider:-${LOKI_PROVIDER:-claude}}"
23205
22987
  case "$use_provider" in
23206
- claude|opencode|codex|cline|aider) ;;
23207
- *) echo "loki try: unknown provider '$use_provider' (use claude, opencode, codex, cline or aider)" >&2; return 2 ;;
22988
+ claude|opencode) ;;
22989
+ *) echo "loki try: unknown provider '$use_provider' (use claude or opencode)" >&2; return 2 ;;
23208
22990
  esac
23209
22991
  if [ "$dry_run" != true ] && ! wow_provider_ready "$use_provider"; then
23210
22992
  try_print_provider_setup "$use_provider" >&2
@@ -23462,12 +23244,15 @@ main() {
23462
23244
  export LOKI_TTY_INTERACTIVE=1
23463
23245
  fi
23464
23246
 
23465
- # v7.5.18: early guard -- LOKI_PROVIDER=gemini is no longer supported.
23466
- if [ "${LOKI_PROVIDER:-}" = "gemini" ]; then
23467
- echo -e "${RED}Error: Provider 'gemini' is deprecated as of v7.5.18 and has been removed.${NC}" >&2
23468
- echo "Active providers: claude, codex, cline, aider, opencode" >&2
23469
- echo "Unset LOKI_PROVIDER or use: LOKI_PROVIDER=claude" >&2
23470
- exit 1
23247
+ # A removed provider (REMOVED_PROVIDERS, providers/loader.sh) exits 2 with the one
23248
+ # migration line. providers/loader.sh (variables and functions only) owns the
23249
+ # list and the text; sourcing it here also defines the helpers for
23250
+ # `loki provider set` and `loki config set provider`.
23251
+ # shellcheck source=/dev/null
23252
+ . "$_LOKI_SCRIPT_DIR/../providers/loader.sh"
23253
+ if loki_is_removed_provider "${LOKI_PROVIDER:-}"; then
23254
+ loki_removed_provider_message "${LOKI_PROVIDER:-}" >&2
23255
+ exit 2
23471
23256
  fi
23472
23257
 
23473
23258
  if [ $# -eq 0 ] || { [ $# -eq 1 ] && [ "$1" = "--no-open" ]; }; then
@@ -24338,7 +24123,7 @@ _run_ultracode() {
24338
24123
  fi
24339
24124
  fi
24340
24125
 
24341
- # 1. Provider gate: workflows are Claude-only. On Codex/Cline/Aider, print the
24126
+ # 1. Provider gate: workflows are Claude-only. On opencode, print the
24342
24127
  # honest message and exit CLEANLY (0) with ZERO invocation. Never break the
24343
24128
  # other providers.
24344
24129
  local _provider="${LOKI_PROVIDER:-claude}"
@@ -32894,21 +32679,8 @@ USER TASK: ${prompt}"
32894
32679
  _loki_perm_argv_for "$PWD" >/dev/null 2>&1 || true
32895
32680
  SHELL="$_LOKI_CLAUDE_SHELL" claude -p "$full_prompt" 2>&1 || agent_exit=$?
32896
32681
  ;;
32897
- codex)
32898
- codex exec --sandbox workspace-write "$full_prompt" 2>&1 || agent_exit=$?
32899
- ;;
32900
- cline)
32901
- cline -y "$full_prompt" 2>&1 || agent_exit=$?
32902
- ;;
32903
- aider)
32904
- aider --message "$full_prompt" --yes-always --no-auto-commits < /dev/null 2>&1 || agent_exit=$?
32905
- ;;
32906
32682
  opencode)
32907
- # Mirrors the working arm in the phase dispatcher (see the
32908
- # opencode case alongside aider there). opencode was listed
32909
- # as an active provider and accepted by `loki provider set`,
32910
- # but this case had no arm, so `loki agent run` printed the
32911
- # persona banner and then died with "Unknown provider".
32683
+ # Mirrors the opencode arm in the phase dispatcher.
32912
32684
  (source "$_LOKI_SCRIPT_DIR/../providers/opencode.sh" && provider_invoke "$full_prompt" 2>&1) || agent_exit=$?
32913
32685
  ;;
32914
32686
  *)
@@ -33034,9 +32806,6 @@ $diff"
33034
32806
 
33035
32807
  case "$provider" in
33036
32808
  claude) _loki_perm_argv_for "$PWD" >/dev/null 2>&1 || true; SHELL="$_LOKI_CLAUDE_SHELL" claude -p "$review_prompt" 2>&1 ;;
33037
- codex) codex exec --sandbox workspace-write "$review_prompt" 2>&1 ;;
33038
- cline) cline -y "$review_prompt" 2>&1 ;;
33039
- aider) aider --message "$review_prompt" --yes-always --no-auto-commits < /dev/null 2>&1 ;;
33040
32809
  opencode) (source "$_LOKI_SCRIPT_DIR/../providers/opencode.sh" && provider_invoke "$review_prompt" 2>&1) ;;
33041
32810
  *) echo -e "${RED}Unknown provider: $provider${NC}"; return 1 ;;
33042
32811
  esac
@@ -34813,15 +34582,6 @@ except Exception:
34813
34582
  pass' 2>/dev/null)
34814
34583
  fi
34815
34584
  ;;
34816
- codex)
34817
- result=$($t_prefix codex exec --sandbox workspace-write "$prompt" 2>/dev/null) || exit_code=$?
34818
- ;;
34819
- cline)
34820
- result=$($t_prefix cline -y "$prompt" 2>/dev/null) || exit_code=$?
34821
- ;;
34822
- aider)
34823
- result=$($t_prefix aider --message "$prompt" --yes-always --no-auto-commits < /dev/null 2>/dev/null) || exit_code=$?
34824
- ;;
34825
34585
  *)
34826
34586
  log_error "Unknown provider: $provider"
34827
34587
  return 1
@@ -39823,7 +39583,7 @@ print(json.dumps(json.load(open(os.environ['LOKI_PROOF_JSON'])), indent=2))
39823
39583
  #
39824
39584
  # The second positional accepts either a local proof id or an
39825
39585
  # explicit receipt path. That lets a Loki run use its short id while
39826
- # Codex, Claude Code, Cursor, Factory, or any other executor can hand
39586
+ # Claude Code, opencode, Cursor, or any other executor can hand
39827
39587
  # over a provider-neutral proof.json without copying it into .loki.
39828
39588
  local contract="${1:-}"
39829
39589
  local receipt_ref="${2:-}"