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/autonomy/sandbox.sh
CHANGED
|
@@ -238,22 +238,9 @@ warn_missing_api_keys() {
|
|
|
238
238
|
log_warn "ANTHROPIC_API_KEY not set - Claude commands will fail inside container"
|
|
239
239
|
fi
|
|
240
240
|
;;
|
|
241
|
-
|
|
242
|
-
if [[ -z "${
|
|
243
|
-
|
|
244
|
-
fi
|
|
245
|
-
;;
|
|
246
|
-
gemini)
|
|
247
|
-
if [[ -z "${GOOGLE_API_KEY:-}" ]]; then
|
|
248
|
-
log_warn "GOOGLE_API_KEY not set - Gemini commands will fail inside container"
|
|
249
|
-
fi
|
|
250
|
-
;;
|
|
251
|
-
cline)
|
|
252
|
-
log_info "Cline manages its own API keys via 'cline auth' - ensure authentication is configured"
|
|
253
|
-
;;
|
|
254
|
-
aider)
|
|
255
|
-
if [[ -z "${OPENAI_API_KEY:-}" ]] && [[ -z "${ANTHROPIC_API_KEY:-}" ]]; then
|
|
256
|
-
log_warn "No API key set for Aider - set OPENAI_API_KEY or ANTHROPIC_API_KEY"
|
|
241
|
+
opencode)
|
|
242
|
+
if [[ -z "${OPENROUTER_API_KEY:-}" ]]; then
|
|
243
|
+
log_info "OPENROUTER_API_KEY not set - opencode needs a key for the provider in its model id (e.g. openrouter/<vendor>/<model>)"
|
|
257
244
|
fi
|
|
258
245
|
;;
|
|
259
246
|
esac
|
|
@@ -720,28 +707,10 @@ _desktop_deprecation_notice() {
|
|
|
720
707
|
_desktop_install_provider_cli() {
|
|
721
708
|
local sandbox_name="$1" provider="$2"
|
|
722
709
|
case "$provider" in
|
|
723
|
-
|
|
724
|
-
if ! docker sandbox exec "$sandbox_name" which
|
|
725
|
-
log_info "Installing
|
|
726
|
-
docker sandbox exec "$sandbox_name" npm install -g
|
|
727
|
-
fi
|
|
728
|
-
;;
|
|
729
|
-
gemini)
|
|
730
|
-
if ! docker sandbox exec "$sandbox_name" which gemini &>/dev/null 2>&1; then
|
|
731
|
-
log_info "Installing Gemini CLI in sandbox (one-time)..."
|
|
732
|
-
docker sandbox exec "$sandbox_name" npm install -g @google/gemini-cli 2>&1 | tail -1
|
|
733
|
-
fi
|
|
734
|
-
;;
|
|
735
|
-
cline)
|
|
736
|
-
if ! docker sandbox exec "$sandbox_name" which cline &>/dev/null 2>&1; then
|
|
737
|
-
log_info "Installing Cline CLI in sandbox (one-time)..."
|
|
738
|
-
docker sandbox exec "$sandbox_name" npm install -g cline 2>&1 | tail -1
|
|
739
|
-
fi
|
|
740
|
-
;;
|
|
741
|
-
aider)
|
|
742
|
-
if ! docker sandbox exec "$sandbox_name" which aider &>/dev/null 2>&1; then
|
|
743
|
-
log_info "Installing Aider in sandbox (one-time)..."
|
|
744
|
-
docker sandbox exec "$sandbox_name" pip install aider-chat 2>&1 | tail -1
|
|
710
|
+
opencode)
|
|
711
|
+
if ! docker sandbox exec "$sandbox_name" which opencode &>/dev/null 2>&1; then
|
|
712
|
+
log_info "Installing opencode in sandbox (one-time)..."
|
|
713
|
+
docker sandbox exec "$sandbox_name" npm install -g opencode-ai 2>&1 | tail -1
|
|
745
714
|
fi
|
|
746
715
|
;;
|
|
747
716
|
# claude is pre-installed in the sandbox template
|
|
@@ -836,7 +805,7 @@ start_docker_desktop_sandbox() {
|
|
|
836
805
|
log_info "Using existing sandbox: $DESKTOP_SANDBOX_NAME"
|
|
837
806
|
fi
|
|
838
807
|
|
|
839
|
-
# Install provider CLI if needed (
|
|
808
|
+
# Install provider CLI if needed (opencode is not pre-installed)
|
|
840
809
|
_desktop_install_provider_cli "$DESKTOP_SANDBOX_NAME" "$provider"
|
|
841
810
|
|
|
842
811
|
# Build environment variable args
|
package/autonomy/setup-wizard.sh
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
# `loki doctor` (health) remain separate entry points.
|
|
6
6
|
#
|
|
7
7
|
# REQUIRED (doctor fails without them): node >= 20, python3 >= 3.8, jq, git, curl
|
|
8
|
-
# AT LEAST ONE of: a provider CLI (claude,
|
|
8
|
+
# AT LEAST ONE of: a provider CLI (claude, opencode) or the
|
|
9
9
|
# bundled Claude Agent SDK with credentials. Claude Code is the default.
|
|
10
|
-
# OPTIONAL: bun (bundled by npm), bash >= 4,
|
|
10
|
+
# OPTIONAL: bun (bundled by npm), bash >= 4, opencode, ollama.
|
|
11
11
|
|
|
12
12
|
_lsw_ask() {
|
|
13
13
|
# _lsw_ask PROMPT DEFAULT -> echoes the answer; DEFAULT when --yes or no TTY
|
|
@@ -56,7 +56,7 @@ _lsw_help() {
|
|
|
56
56
|
echo "Usage: loki setup [--yes] [--provider NAME] [--model ROUTE] [--budget USD] [--global] [--check]"
|
|
57
57
|
echo ""
|
|
58
58
|
echo " --yes, -y Non-interactive: accept defaults, never prompt"
|
|
59
|
-
echo " --provider NAME claude (default)
|
|
59
|
+
echo " --provider NAME claude (default) or opencode"
|
|
60
60
|
echo " --model ROUTE claude (default), ollama/<model>, openrouter/<vendor>/<model>"
|
|
61
61
|
echo " --budget USD Spend cap in USD (default: none)"
|
|
62
62
|
echo " --global Write to ~/.config/loki-mode instead of .loki/config"
|
|
@@ -102,7 +102,7 @@ cmd_setup() {
|
|
|
102
102
|
echo ""
|
|
103
103
|
echo "2. Provider CLI (Claude Code is the default and the only Tier-1 provider)"
|
|
104
104
|
local p
|
|
105
|
-
for p in
|
|
105
|
+
for p in opencode; do
|
|
106
106
|
_lsw_tool "$p" OPTIONAL "$(_lsw_fix "$p" "see 'loki doctor' for the command")" || true
|
|
107
107
|
done
|
|
108
108
|
if command -v claude >/dev/null 2>&1; then
|
|
@@ -139,7 +139,7 @@ cmd_setup() {
|
|
|
139
139
|
|
|
140
140
|
echo ""
|
|
141
141
|
echo "3. Provider and model route"
|
|
142
|
-
[ -z "$provider" ] && provider="$(_lsw_ask "Provider (claude|
|
|
142
|
+
[ -z "$provider" ] && provider="$(_lsw_ask "Provider (claude|opencode)" claude)"
|
|
143
143
|
[ -z "$model" ] && model="$(_lsw_ask "Model route (claude | ollama/<model> | openrouter/<vendor>/<model>)" claude)"
|
|
144
144
|
echo ""
|
|
145
145
|
echo "4. Spend cap"
|
package/bin/loki
CHANGED
|
@@ -246,21 +246,30 @@ if [ -z "${LOKI_TELEMETRY_DISABLED:-}" ] && [ "${DO_NOT_TRACK:-}" != "1" ] && [
|
|
|
246
246
|
fi
|
|
247
247
|
fi
|
|
248
248
|
|
|
249
|
-
#
|
|
250
|
-
#
|
|
251
|
-
#
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
249
|
+
# A removed provider (REMOVED_PROVIDERS) exits 2 with one migration line,
|
|
250
|
+
# from LOKI_PROVIDER or a --provider flag, before any routing, so every command
|
|
251
|
+
# (Bun-routed and bash-routed) says the same thing. The list and the message live
|
|
252
|
+
# in providers/loader.sh (side-effect free: variables and functions only).
|
|
253
|
+
# shellcheck source=/dev/null
|
|
254
|
+
source "$REPO_ROOT/providers/loader.sh"
|
|
255
|
+
_rp_name="${LOKI_PROVIDER:-}"; _rp_next=0
|
|
256
|
+
for _rp_a in "$@"; do
|
|
257
|
+
loki_is_removed_provider "$_rp_name" && break
|
|
258
|
+
if [ "$_rp_next" = "1" ]; then _rp_name="$_rp_a"; _rp_next=0; continue; fi
|
|
259
|
+
case "$_rp_a" in
|
|
260
|
+
--provider) _rp_next=1 ;;
|
|
261
|
+
--provider=*) _rp_name="${_rp_a#--provider=}" ;;
|
|
262
|
+
esac
|
|
263
|
+
done
|
|
264
|
+
if loki_is_removed_provider "$_rp_name"; then loki_removed_provider_message "$_rp_name" >&2; exit 2; fi
|
|
265
|
+
unset _rp_next _rp_a _rp_name
|
|
258
266
|
|
|
259
267
|
# OC-MODELS: `loki start|quick ... --model <id>` (also flag-first). One place maps the flag to
|
|
260
268
|
# env before ANY engine/route decision, so engine10, the Bun start command and the legacy
|
|
261
|
-
# loop all see the same thing.
|
|
262
|
-
#
|
|
263
|
-
#
|
|
269
|
+
# loop all see the same thing. With --provider opencode every id (openrouter/<vendor>/<model>
|
|
270
|
+
# included) is opencode's own provider/model and sets LOKI_OPENCODE_MODEL. For claude, route specs
|
|
271
|
+
# (openrouter|ollama|lmstudio|llamacpp|vllm|custom/<id>) set LOKI_MODEL_ROUTE; tier names and
|
|
272
|
+
# Claude aliases become --session-model; any other id sets LOKI_MODEL_OVERRIDE.
|
|
264
273
|
case "${1:-}" in
|
|
265
274
|
start|quick|--model|--model=*)
|
|
266
275
|
_lm_has=0
|
|
@@ -280,14 +289,14 @@ case "${1:-}" in
|
|
|
280
289
|
done
|
|
281
290
|
if [ -n "$_lm_model" ]; then
|
|
282
291
|
[ -n "$_lm_prov" ] || _lm_prov="${LOKI_PROVIDER:-claude}"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
if [ "$_lm_prov" = "opencode" ]; then export LOKI_OPENCODE_MODEL="$_lm_model"
|
|
293
|
+
else
|
|
294
|
+
case "$_lm_model" in
|
|
295
|
+
openrouter/*|ollama/*|lmstudio/*|llamacpp/*|vllm/*|custom/*) export LOKI_MODEL_ROUTE="$_lm_model" ;;
|
|
296
|
+
small|medium|high|opus|sonnet|haiku) _lm_out+=(--session-model "$_lm_model") ;;
|
|
297
|
+
*) export LOKI_MODEL_OVERRIDE="$_lm_model" ;;
|
|
298
|
+
esac
|
|
299
|
+
fi
|
|
291
300
|
else
|
|
292
301
|
echo "loki: --model requires a value (for example ollama/qwen3-coder or openrouter/<id>)." >&2
|
|
293
302
|
exit 2
|
|
@@ -398,7 +407,7 @@ _loki_print_autonomy() {
|
|
|
398
407
|
# needs-bash divert, LOKI_LEGACY_BASH, and the no-Bun fallthrough. An emit down
|
|
399
408
|
# in run.sh would be bash-route-only and would report installs climbing while
|
|
400
409
|
# starts sat near zero under LOKI_SDK_MODE=full, which is exactly the blind spot
|
|
401
|
-
# this is meant to close. Placed after the
|
|
410
|
+
# this is meant to close. Placed after the removed-provider guard (that path exits) and
|
|
402
411
|
# before the LOKI_LEGACY_BASH check (which execs).
|
|
403
412
|
#
|
|
404
413
|
# `run` is the deprecated start alias and `quick` is grouped with them in the
|
|
@@ -580,8 +589,8 @@ _loki_attempts_refuse() {
|
|
|
580
589
|
exit 2
|
|
581
590
|
fi
|
|
582
591
|
case "${LOKI_PROVIDER:-claude}" in
|
|
583
|
-
claude|
|
|
584
|
-
*) echo "loki: the Loki 10 engine does not support LOKI_PROVIDER=${LOKI_PROVIDER:-}; use claude
|
|
592
|
+
claude|opencode) ;;
|
|
593
|
+
*) echo "loki: the Loki 10 engine does not support LOKI_PROVIDER=${LOKI_PROVIDER:-}; use claude or opencode." >&2; exit 2 ;;
|
|
585
594
|
esac
|
|
586
595
|
}
|
|
587
596
|
|
|
@@ -747,8 +756,8 @@ case "v10" in
|
|
|
747
756
|
;;
|
|
748
757
|
*)
|
|
749
758
|
case "${LOKI_PROVIDER:-claude}" in
|
|
750
|
-
claude|
|
|
751
|
-
*) echo "loki: provider ${LOKI_PROVIDER:-} is not supported; use one of: claude,
|
|
759
|
+
claude|opencode) ;;
|
|
760
|
+
*) echo "loki: provider ${LOKI_PROVIDER:-} is not supported; use one of: claude, opencode (LOKI_PROVIDER)." >&2; exit 2 ;;
|
|
752
761
|
esac
|
|
753
762
|
[ -n "$(_loki_bun)" ] || _loki_no_bun_exit
|
|
754
763
|
;;
|
package/completions/_loki
CHANGED
|
@@ -40,13 +40,13 @@ function _loki {
|
|
|
40
40
|
'--offline[Always show the offline sample]' \
|
|
41
41
|
'--dry-run[Print the plan, no model call]' \
|
|
42
42
|
'--keep[Keep the temp repo]' \
|
|
43
|
-
'--provider[Provider]:provider:(claude opencode
|
|
43
|
+
'--provider[Provider]:provider:(claude opencode)' \
|
|
44
44
|
'--max-cost[Hard per-run cap in USD]:usd:'
|
|
45
45
|
;;
|
|
46
46
|
try)
|
|
47
47
|
_arguments \
|
|
48
48
|
'--dry-run[Clone, print the task and estimate, no model call]' \
|
|
49
|
-
'--provider[Provider]:provider:(claude opencode
|
|
49
|
+
'--provider[Provider]:provider:(claude opencode)' \
|
|
50
50
|
'--max-cost[Hard per-run cap in USD]:usd:'
|
|
51
51
|
;;
|
|
52
52
|
control)
|
|
@@ -149,7 +149,7 @@ function _loki {
|
|
|
149
149
|
_arguments \
|
|
150
150
|
'1:verb:(start quick)' \
|
|
151
151
|
'--json[Output machine-readable JSON]' \
|
|
152
|
-
'--provider[AI provider]:provider name:(claude
|
|
152
|
+
'--provider[AI provider]:provider name:(claude opencode)' \
|
|
153
153
|
'--model[Model or route override]:model:' \
|
|
154
154
|
'--no-pr[Skip the pull request]' \
|
|
155
155
|
'--max-cost[Spend cap in USD]:amount:' \
|
|
@@ -435,7 +435,7 @@ function _loki_commands {
|
|
|
435
435
|
function _loki_start {
|
|
436
436
|
# Rule: list every flag bin/loki routes (Bun/engine10 ones such as --model, --max-cost, --spec, --no-pr too), not only cmd_start's own.
|
|
437
437
|
_arguments \
|
|
438
|
-
'--provider[AI provider]:provider name:(claude
|
|
438
|
+
'--provider[AI provider]:provider name:(claude opencode)' \
|
|
439
439
|
'--parallel[Parallel mode]' \
|
|
440
440
|
'--brief[Zero-config brief mode]:brief text:' \
|
|
441
441
|
'--worktree[Git worktree isolation]' \
|
package/completions/loki.bash
CHANGED
|
@@ -18,10 +18,8 @@ _loki_completion() {
|
|
|
18
18
|
start|quick)
|
|
19
19
|
# If the previous word was --provider, show provider names
|
|
20
20
|
if [[ "$prev" == "--provider" ]]; then
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
# SUPPORTED_PROVIDERS.
|
|
24
|
-
COMPREPLY=( $(compgen -W "claude cline codex aider opencode" -- "$cur") )
|
|
21
|
+
# Keep in sync with providers/loader.sh SUPPORTED_PROVIDERS.
|
|
22
|
+
COMPREPLY=( $(compgen -W "claude opencode" -- "$cur") )
|
|
25
23
|
return 0
|
|
26
24
|
fi
|
|
27
25
|
|
package/dashboard/__init__.py
CHANGED
package/dashboard/api_start.py
CHANGED
|
@@ -41,12 +41,42 @@ _LOKI_BIN = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file_
|
|
|
41
41
|
_REPO_RE = re.compile(r"^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$")
|
|
42
42
|
_TOKEN_RE = re.compile(r"^[A-Za-z0-9_\-]{10,255}$")
|
|
43
43
|
_KEY_RE = re.compile(r"^[A-Za-z0-9_\-.]{10,512}$")
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
# opencode reaches OpenRouter models (openrouter/<vendor>/<model>) with OPENROUTER_API_KEY.
|
|
45
|
+
_PROVIDER_KEY_ENV = {"claude": "ANTHROPIC_API_KEY", "opencode": "OPENROUTER_API_KEY"}
|
|
46
|
+
_PROVIDER_BIN = {"claude": "claude", "opencode": "opencode"}
|
|
47
|
+
_SECRET_FILES = {"github": "github", "claude_api_key": "claude_api_key", "opencode_api_key": "opencode_api_key"}
|
|
47
48
|
_lock = threading.RLock()
|
|
48
49
|
|
|
49
50
|
|
|
51
|
+
_LOADER_SH = Path(__file__).resolve().parent.parent / "providers" / "loader.sh"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _loader_text() -> str:
|
|
55
|
+
try:
|
|
56
|
+
return _LOADER_SH.read_text(encoding="utf-8")
|
|
57
|
+
except OSError:
|
|
58
|
+
return ""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _loader_array(name: str) -> tuple:
|
|
62
|
+
m = re.search(r"^" + name + r"=\((.*)\)$", _loader_text(), re.M)
|
|
63
|
+
return tuple(t.strip('"') for t in m.group(1).split()) if m else ()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def supported_providers() -> tuple:
|
|
67
|
+
"""SUPPORTED_PROVIDERS from providers/loader.sh (the runtime's own list)."""
|
|
68
|
+
return _loader_array("SUPPORTED_PROVIDERS") or ("claude", "opencode")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def removed_provider_message(name: str) -> str:
|
|
72
|
+
"""The CLI's one-line migration message for a removed provider, read from
|
|
73
|
+
loki_removed_provider_message in providers/loader.sh; "" when NAME was never removed."""
|
|
74
|
+
if name not in _loader_array("REMOVED_PROVIDERS"):
|
|
75
|
+
return ""
|
|
76
|
+
m = re.search(r'printf "(loki: provider \'%s\'[^"]*?)\\n" "\$1"', _loader_text())
|
|
77
|
+
return m.group(1).replace("%s", name) if m else f"loki: provider '{name}' is no longer supported."
|
|
78
|
+
|
|
79
|
+
|
|
50
80
|
def _pick(table: dict, key):
|
|
51
81
|
"""Return the table's own constant equal to key, so request data never reaches a sink."""
|
|
52
82
|
for const in table.values():
|
|
@@ -278,7 +308,7 @@ class RunIn(BaseModel):
|
|
|
278
308
|
@router.get("/api/onboarding/state", dependencies=_scope("read"))
|
|
279
309
|
def onboarding_state():
|
|
280
310
|
detected = []
|
|
281
|
-
for n in
|
|
311
|
+
for n in _PROVIDER_BIN:
|
|
282
312
|
v = _cli_version(n)
|
|
283
313
|
if v:
|
|
284
314
|
detected.append({"name": n, "version": v})
|
|
@@ -290,7 +320,7 @@ def onboarding_state():
|
|
|
290
320
|
@router.post("/api/onboarding/provider", dependencies=_scope("control"))
|
|
291
321
|
def set_provider(body: ProviderIn):
|
|
292
322
|
if body.provider not in _PROVIDER_KEY_ENV:
|
|
293
|
-
raise HTTPException(400, "provider must be claude or
|
|
323
|
+
raise HTTPException(400, removed_provider_message(body.provider) or "provider must be claude or opencode")
|
|
294
324
|
if body.api_key:
|
|
295
325
|
if not _KEY_RE.match(body.api_key):
|
|
296
326
|
raise HTTPException(400, "api key format not accepted")
|
|
@@ -380,7 +410,7 @@ def _child_env(token: str) -> dict:
|
|
|
380
410
|
prov = _cfg().get("provider")
|
|
381
411
|
if prov:
|
|
382
412
|
e["LOKI_PROVIDER"] = prov
|
|
383
|
-
key = _read_secret(prov + "_api_key")
|
|
413
|
+
key = _read_secret(prov + "_api_key") if prov in _PROVIDER_KEY_ENV else None
|
|
384
414
|
if key:
|
|
385
415
|
e[_PROVIDER_KEY_ENV[prov]] = key
|
|
386
416
|
return e
|
package/dashboard/api_v2.py
CHANGED
|
@@ -504,7 +504,7 @@ async def list_runs(
|
|
|
504
504
|
# These routes are real and mounted, but the SQL store behind them has
|
|
505
505
|
# NO RUNTIME WRITER: the only writers are this module and
|
|
506
506
|
# dashboard/runs.py, both API-side, while the actual run lifecycle
|
|
507
|
-
# writes to the filesystem (autonomy/run.sh,
|
|
507
|
+
# writes to the filesystem (autonomy/run.sh, autonomy/completion-council.sh,
|
|
508
508
|
# runner/checkpoint.ts). dashboard/runs.py contains zero filesystem
|
|
509
509
|
# references. So for every real `loki start` this returned [].
|
|
510
510
|
#
|
|
@@ -72,8 +72,6 @@ _SYSTEM_RUNTIME_READ_PATHS = (
|
|
|
72
72
|
_SYSTEM_CHILD_PATHS = ("/usr/bin", "/bin", "/usr/sbin", "/sbin")
|
|
73
73
|
_PROVIDER_AUTH_COMMANDS = {
|
|
74
74
|
"claude": ("claude", "auth", "status"),
|
|
75
|
-
"codex": ("codex", "login", "status"),
|
|
76
|
-
"cline": ("cline", "auth", "status"),
|
|
77
75
|
}
|
|
78
76
|
_PROVIDER_READINESS_COMMANDS = {
|
|
79
77
|
# P12-26b scoped out: fixed sandboxed printf probe that must run Bash; a restrictive
|
|
@@ -99,9 +97,7 @@ _PROVIDER_READINESS_COMMANDS = {
|
|
|
99
97
|
}
|
|
100
98
|
_PROVIDER_AUTH_ACTIONS = {
|
|
101
99
|
"claude": "Run 'claude auth login', unlock the macOS login keychain, then retry.",
|
|
102
|
-
"
|
|
103
|
-
"cline": "Run 'cline auth', then retry.",
|
|
104
|
-
"aider": "Configure a provider with a non-interactive auth status command.",
|
|
100
|
+
"opencode": "Set OPENROUTER_API_KEY (or run 'opencode auth login'), then retry.",
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
|
package/dashboard/server.py
CHANGED
|
@@ -1354,7 +1354,7 @@ else:
|
|
|
1354
1354
|
app.include_router(api_operator_router)
|
|
1355
1355
|
|
|
1356
1356
|
# D51 Phase A: first-run onboarding + backlog API and its /start page.
|
|
1357
|
-
from .api_start import router as api_start_router
|
|
1357
|
+
from .api_start import router as api_start_router, removed_provider_message, supported_providers
|
|
1358
1358
|
app.include_router(api_start_router)
|
|
1359
1359
|
from .api_runs_v1 import router as api_runs_v1_router
|
|
1360
1360
|
app.include_router(api_runs_v1_router)
|
|
@@ -1543,7 +1543,7 @@ async def agent_card() -> dict:
|
|
|
1543
1543
|
"agents": 41,
|
|
1544
1544
|
"swarms": 8,
|
|
1545
1545
|
"quality_gates": 8,
|
|
1546
|
-
"providers":
|
|
1546
|
+
"providers": list(supported_providers()),
|
|
1547
1547
|
"streaming": True,
|
|
1548
1548
|
"pushNotifications": False,
|
|
1549
1549
|
"stateTransitionHistory": True,
|
|
@@ -3241,9 +3241,7 @@ _START_MODEL_ALLOWLIST = ("haiku", "sonnet", "opus")
|
|
|
3241
3241
|
# on a non-Claude provider, and they resolve per-provider through
|
|
3242
3242
|
# providers/models.sh (loki_tier_alias): small -> fast, medium -> development,
|
|
3243
3243
|
# high -> planning. Accepting them here is what makes the start-time picker work
|
|
3244
|
-
# on
|
|
3245
|
-
# this every value a codex user could pick normalized to "" and was silently
|
|
3246
|
-
# dropped, and the run started on the provider default with no feedback.
|
|
3244
|
+
# on opencode at all -- the Claude aliases above are meaningless there.
|
|
3247
3245
|
_START_MODEL_GENERIC_TIERS = ("small", "medium", "high")
|
|
3248
3246
|
|
|
3249
3247
|
|
|
@@ -3273,8 +3271,8 @@ def _normalize_start_model(raw: str | None) -> str:
|
|
|
3273
3271
|
# into `claude --model`. They must not change.
|
|
3274
3272
|
#
|
|
3275
3273
|
# What the dashboard OFFERS is a separate question, and it was the bug: the
|
|
3276
|
-
# picker rendered those four Claude aliases on every run, so
|
|
3277
|
-
# offered Haiku/Sonnet/Opus/Fable,
|
|
3274
|
+
# picker rendered those four Claude aliases on every run, so an opencode session
|
|
3275
|
+
# was offered Haiku/Sonnet/Opus/Fable, which it does not dispatch. The offer
|
|
3278
3276
|
# set below is derived from the RUNNING session's provider plus the canonical
|
|
3279
3277
|
# providers/model_catalog.json, so the picker never names a model the active
|
|
3280
3278
|
# provider cannot run.
|
|
@@ -3360,7 +3358,7 @@ def _provider_model_offers(provider: str) -> list[dict]:
|
|
|
3360
3358
|
Every other provider is offered the generic tiers (small/medium/high), which
|
|
3361
3359
|
are provider-independent, each annotated with the concrete model id the
|
|
3362
3360
|
catalog says that provider dispatches. That is what makes the picker read
|
|
3363
|
-
"medium ->
|
|
3361
|
+
"medium -> <catalog opencode id>" on opencode and "medium -> <catalog sonnet id>" on claude
|
|
3364
3362
|
without the frontend knowing a single model id.
|
|
3365
3363
|
"""
|
|
3366
3364
|
if provider == "claude":
|
|
@@ -3993,18 +3991,18 @@ class StartBuildRequest(BaseModel):
|
|
|
3993
3991
|
def validate_provider(self) -> None:
|
|
3994
3992
|
"""Validate provider is from the supported list.
|
|
3995
3993
|
|
|
3996
|
-
|
|
3997
|
-
rejects providers the runtime rejects
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
deprecation guard.
|
|
3994
|
+
Reads providers/loader.sh SUPPORTED_PROVIDERS so the dashboard
|
|
3995
|
+
rejects providers the runtime rejects (accepting one the runtime
|
|
3996
|
+
refuses reported a false "Build started"). A removed provider gets
|
|
3997
|
+
the CLI's own migration line.
|
|
4001
3998
|
"""
|
|
4002
|
-
allowed =
|
|
3999
|
+
allowed = supported_providers()
|
|
4003
4000
|
if self.provider not in allowed:
|
|
4004
|
-
|
|
4001
|
+
msg = removed_provider_message(self.provider)
|
|
4002
|
+
raise ValueError(msg or (
|
|
4005
4003
|
f"Invalid provider: {self.provider}. "
|
|
4006
4004
|
f"Must be one of: {', '.join(allowed)}"
|
|
4007
|
-
)
|
|
4005
|
+
))
|
|
4008
4006
|
|
|
4009
4007
|
|
|
4010
4008
|
def _validate_prd_path(raw_path: str, project_dir: _Path) -> _Path:
|
|
@@ -4598,8 +4596,8 @@ async def start_build(request: Request, body: StartBuildRequest):
|
|
|
4598
4596
|
# it names a capability class, not a model, and each provider
|
|
4599
4597
|
# resolves its own latest model for that class via
|
|
4600
4598
|
# providers/models.sh. Pinning the LOKI_CLAUDE_MODEL_* triple here
|
|
4601
|
-
# would be actively wrong: those variables are inert on
|
|
4602
|
-
#
|
|
4599
|
+
# would be actively wrong: those variables are inert on opencode,
|
|
4600
|
+
# so the pin would silently do
|
|
4603
4601
|
# nothing. LOKI_SESSION_MODEL is the correct and only lever.
|
|
4604
4602
|
popen_env["LOKI_SESSION_MODEL"] = start_model
|
|
4605
4603
|
else:
|
|
@@ -5831,7 +5829,7 @@ def _find_orchestrator_pids_for_dir(project_dir: _Path) -> list[int]:
|
|
|
5831
5829
|
# 1. /loki-run-*.sh -- the orchestrator temp script.
|
|
5832
5830
|
# 2. [LOKI-AUTONOMY-AGENT] -- the sentinel Loki injects as the first line
|
|
5833
5831
|
# of the agent's --append-system-prompt (v7.7.34). This matches the
|
|
5834
|
-
#
|
|
5832
|
+
# provider AGENT process, which has no "loki-run" in its argv
|
|
5835
5833
|
# and (critically) survives as an orphan (PPID 1) when the orchestrator
|
|
5836
5834
|
# is killed -- the cause of "dashboard says stopped but it keeps
|
|
5837
5835
|
# running". An interactive provider session never carries this sentinel,
|
|
@@ -7764,8 +7762,6 @@ _DEFAULT_PRICING = {
|
|
|
7764
7762
|
# Exact ids (a lookup by recorded model string must not fall back to sonnet)
|
|
7765
7763
|
"claude-haiku-4-5": {"input": 1.00, "output": 5.00, "cache_read": 0.1, "cache_write": 1.25, "cache_write_1h": 2},
|
|
7766
7764
|
"claude-haiku-5-5": {"input": 0.10, "output": 0.50, "cache_read": 0.01, "cache_write": 0.125, "cache_write_1h": 0.2},
|
|
7767
|
-
# OpenAI Codex
|
|
7768
|
-
"gpt-5.3-codex": {"input": 1.75, "output": 14.00},
|
|
7769
7765
|
# gpt-5.6 line: sol (high) / terra (medium, default) / luna (small).
|
|
7770
7766
|
# Rates from developers.openai.com/api/docs/pricing (read 2026-10-08),
|
|
7771
7767
|
# Standard tier, short context (up to 272K). tests/test-pricing-parity.sh pins them.
|
|
@@ -8367,7 +8363,7 @@ def _compute_cost_timeline() -> dict:
|
|
|
8367
8363
|
for data in records:
|
|
8368
8364
|
# A PRESENT FILE IS NOT A MEASUREMENT. This previously flipped on
|
|
8369
8365
|
# for any parseable record, so the all-zero records a pre-v8.51.0
|
|
8370
|
-
#
|
|
8366
|
+
# non-Claude run wrote reported total_usd $0.00 with cost_recorded True
|
|
8371
8367
|
# -- the endpoint asserting the run was FREE. Same predicate as
|
|
8372
8368
|
# /api/cost so the two cost readers cannot disagree.
|
|
8373
8369
|
measured = _record_is_measured(data)
|
|
@@ -8616,7 +8612,6 @@ _PROVIDER_LABELS = {
|
|
|
8616
8612
|
"opus": "Opus 5.5",
|
|
8617
8613
|
"sonnet": "Sonnet 5.5",
|
|
8618
8614
|
"haiku": "Haiku 5.5",
|
|
8619
|
-
"gpt-5.3-codex": "GPT-5.3 Codex",
|
|
8620
8615
|
"gpt-5.6-sol": "GPT-5.6 Sol",
|
|
8621
8616
|
"gpt-5.6-terra": "GPT-5.6 Terra",
|
|
8622
8617
|
"gpt-5.6-luna": "GPT-5.6 Luna",
|
|
@@ -8637,9 +8632,6 @@ _MODEL_PROVIDERS = {
|
|
|
8637
8632
|
"opus": "claude",
|
|
8638
8633
|
"sonnet": "claude",
|
|
8639
8634
|
"haiku": "claude",
|
|
8640
|
-
"gpt-5.3-codex": "codex",
|
|
8641
|
-
"cline-default": "cline",
|
|
8642
|
-
"aider-default": "aider",
|
|
8643
8635
|
}
|
|
8644
8636
|
|
|
8645
8637
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -25,9 +25,10 @@ The system is built around a few load-bearing principles:
|
|
|
25
25
|
run-start commit, tests recorded a real command and exited zero, and no gate
|
|
26
26
|
was skipped. Every build emits an Evidence Receipt that a skeptic can
|
|
27
27
|
re-derive independently.
|
|
28
|
-
- **Provider-agnostic execution.** The same workflow runs on Claude Code
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
- **Provider-agnostic execution.** The same workflow runs on Claude Code (the
|
|
29
|
+
CLI, or the Anthropic Agent SDK with an API key) and opencode (any model,
|
|
30
|
+
including OpenRouter), with automatic failover. Feature richness degrades
|
|
31
|
+
gracefully by provider rather than failing.
|
|
31
32
|
- **Filesystem as the system bus.** Components do not share memory. They
|
|
32
33
|
communicate through `.loki/` state files (session, queue, checkpoints,
|
|
33
34
|
findings, memory), which makes the system inspectable, resumable, and
|
|
@@ -103,8 +104,8 @@ runner (`loki-ts/src/runner/`) is the default; the Bash engine
|
|
|
103
104
|
v v v v |
|
|
104
105
|
+---------------+ +-----------+ +---------+ +----------+ |
|
|
105
106
|
| Providers | | Quality | | Memory | | Events | |
|
|
106
|
-
| claude/
|
|
107
|
-
|
|
|
107
|
+
| claude/ | | Gates + | | engine | | bus |<+
|
|
108
|
+
| opencode | | Council | | (RAG, | | (py/ts/ |
|
|
108
109
|
| (failover) | | (8 gates) | | vector) | | sh) |
|
|
109
110
|
+-------+-------+ +-----------+ +----+----+ +----------+
|
|
110
111
|
| |
|
|
@@ -131,20 +132,19 @@ A representative end-to-end flow:
|
|
|
131
132
|
bash loop (`autonomy/run.sh`) runs only on `--engine legacy` or
|
|
132
133
|
`LOKI_LEGACY_BASH=1`.
|
|
133
134
|
2. **Complexity and tier.** The engine detects complexity and maps the iteration
|
|
134
|
-
to a model tier (`
|
|
135
|
-
3. **Prompt construction.** `
|
|
135
|
+
to a model tier (`run.sh:get_rarv_tier`).
|
|
136
|
+
3. **Prompt construction.** `run.sh:build_prompt` assembles
|
|
136
137
|
the iteration prompt: RARV instructions, SDLC phase, retrieved memory context
|
|
137
138
|
(`memory/retrieval.py` via the RAG injector), queued tasks, and checklist
|
|
138
139
|
status.
|
|
139
140
|
4. **Provider invocation.** The prompt is dispatched to the selected provider
|
|
140
141
|
(`providers.ts`). Claude Code runs with full features (subagents, parallel
|
|
141
|
-
worktrees, Task tool, MCP);
|
|
142
|
-
modes. Failures trigger failover to the next available provider.
|
|
142
|
+
worktrees, Task tool, MCP); opencode runs sequentially. Failures trigger failover to the next available provider.
|
|
143
143
|
5. **Reflect and verify.** Post-iteration, the engine runs checklist
|
|
144
144
|
verification (`autonomy/checklist-verify.py`), manages the app runner
|
|
145
145
|
(`autonomy/app-runner.sh`), and runs Playwright smoke tests.
|
|
146
|
-
6. **Review.** `
|
|
147
|
-
|
|
146
|
+
6. **Review.** `run.sh:run_code_review` runs the 8 gates and the blind
|
|
147
|
+
3-reviewer council (`autonomy/lib/voter-agents.sh`). Findings
|
|
148
148
|
are scored; Critical/High block. An override council can lift a BLOCK only
|
|
149
149
|
when a non-empty evidence artifact backs a trusted proof type.
|
|
150
150
|
7. **Close.** Structured findings are persisted
|
|
@@ -196,8 +196,7 @@ loki-ts/ Default Bun/TypeScript runtime
|
|
|
196
196
|
|
|
197
197
|
providers/ Provider configs (shell-sourceable)
|
|
198
198
|
claude.sh Claude Code - Tier 1 (full features)
|
|
199
|
-
|
|
200
|
-
codex.sh / aider.sh Codex / Aider - Tier 3 (degraded, sequential)
|
|
199
|
+
opencode.sh opencode - model-agnostic (OpenRouter, sequential)
|
|
201
200
|
loader.sh / models.sh Provider loader and model registry
|
|
202
201
|
model_catalog.json Model catalog (probed)
|
|
203
202
|
|
|
@@ -320,7 +319,7 @@ docker/ Container distribution (Dockerfiles, compose)
|
|
|
320
319
|
- **Model Context Protocol (MCP)** as a first-class integration surface
|
|
321
320
|
(`mcp/server.py`): tools, resources, and prompts, plus an LSP proxy for
|
|
322
321
|
code intelligence (references, definitions, symbols).
|
|
323
|
-
- **Provider CLIs** (Claude Code,
|
|
322
|
+
- **Provider CLIs** (Claude Code, opencode) and the Anthropic Agent SDK as the model
|
|
324
323
|
execution layer, abstracted behind shell-sourceable provider configs and the
|
|
325
324
|
TS providers module.
|
|
326
325
|
- **Docker / Docker Compose** for distribution and for the multi-service,
|
package/docs/CLI-REFERENCE.md
CHANGED
|
@@ -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.
|
|
3
|
+
Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.121.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 |
|
package/docs/COMPARE-OPENCODE.md
CHANGED
|
@@ -16,7 +16,7 @@ Loki can also drive opencode as a provider (`loki start --provider opencode`).
|
|
|
16
16
|
| Learning curve | `loki start` is the factory. Policy, receipt, and cost route are printed by that command. `loki help` lists the rest | Learn one TUI | Loki if you do not want a second verb |
|
|
17
17
|
| Interactive coding | `loki chat`: Plan/Build modes, slash commands, `--attach` | Full TUI with sessions and rich editing flow | opencode |
|
|
18
18
|
| Small changes | `loki edit` (one pass, diff, opt-in verify and receipt) | Prompt in the TUI or `opencode run` | Even |
|
|
19
|
-
| Provider flexibility | Claude default
|
|
19
|
+
| Provider flexibility | Claude default (CLI or Agent SDK); opencode; OpenRouter and local routes | Very wide provider catalog, first-class | opencode |
|
|
20
20
|
| Local models | `loki models --local`, `LOKI_MODEL_ROUTE=ollama/...`, lmstudio, llamacpp, vllm, custom URL | Local providers via config | Even |
|
|
21
21
|
| Multi-agent | Role agents, council review, custom agents in `.loki/agents/*.md`, the run view names the active stage | Configurable agents and subagents | Loki when you want the receipt to name who ran |
|
|
22
22
|
| Cost control | Same provider model as a raw session. Tool logs are trimmed before the next turn so a long run does not resend them. `--max-cost` and `budgets.per_run` are hard caps. `--haiku` or `--cost lean` opts the first implement onto haiku; a failed check climbs back. `--cost-first` (or `LOKI_COST_FIRST=1`, also set by `--haiku`) keeps a haiku route only when the advisor marks the risk low; a history floor, no advisor, or an explicit model override still raise it | User watches the TUI | Loki when the result has to be a check the model did not grade |
|
|
@@ -55,10 +55,11 @@ PR, then diff stat, diff, cost and time. `--verify`, `--receipt`, `--commit`
|
|
|
55
55
|
and `--dry-run` are opt-in. Claude provider only for now.
|
|
56
56
|
|
|
57
57
|
**Provider flexibility.** opencode has the broader provider catalog. Loki's
|
|
58
|
-
Tier-1 provider is Claude Code;
|
|
59
|
-
|
|
60
|
-
`
|
|
61
|
-
`BUDGET_LIMIT` kill and a post-iteration guard scan
|
|
58
|
+
Tier-1 provider is Claude Code; opencode is the optional second provider and
|
|
59
|
+
reaches OpenRouter (`--model openrouter/<vendor>/<model>` with
|
|
60
|
+
`OPENROUTER_API_KEY`). On opencode the Loki 10 engine enforces the wall-clock
|
|
61
|
+
limit, `BUDGET_LIMIT` kill and a post-iteration guard scan; cost is not
|
|
62
|
+
measured. Kill blocking is still
|
|
62
63
|
Claude-only and receipts say so (`kill blocking not enforced`).
|
|
63
64
|
|
|
64
65
|
**Local models.** `loki models --local` probes Ollama, LM Studio, llama.cpp and
|
|
@@ -91,7 +92,7 @@ that applies on every engine10 provider.
|
|
|
91
92
|
|
|
92
93
|
## Switching from Claude Code or opencode
|
|
93
94
|
|
|
94
|
-
`loki start` and `loki factory` run the Loki 10 engine for an issue reference or a multi-word task, when bun is available and the provider is claude
|
|
95
|
+
`loki start` and `loki factory` run the Loki 10 engine for an issue reference or a multi-word task, when bun is available and the provider is claude or opencode. A PRD file and a one-word argument run on it too; a host with no bun or an unsupported `LOKI_PROVIDER` exits 2 with the fix (codex, cline, aider and gemini print a one-line migration message). On the Loki 10 path, `--provider opencode` and the default Claude path are the same loop: plan, implement, verify, seal, and a pull request unless you pass `--no-pr`. The receipt is still written with `--no-pr`, and `loki verify` checks it with no network.
|
|
95
96
|
|
|
96
97
|
There is no transcript importer. A Claude Code or opencode session is not copied in. The handoff is the repository and the task. Inside one Loki run on the Claude SDK path, the plan session resumes into implement unless `LOKI_E10_FIX_RESUME=0`; other providers start implement fresh. `loki chat --attach` joins a run that is already going. `loki resume` continues a paused or interrupted run from its checkpoint.
|
|
97
98
|
|