loki-mode 11.120.1 → 11.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/issue-to-pr/action.yml +1 -1
- package/README.md +3 -2
- package/SKILL.md +16 -19
- package/VERSION +1 -1
- package/agents/custom_agents.py +1 -1
- package/api/openapi.yaml +3 -7
- package/api/routes/health.ts +5 -10
- package/api/routes/sessions.ts +12 -3
- package/api/server.js +6 -2
- package/api/services/cli-bridge.ts +1 -1
- package/api/types/api.ts +3 -5
- package/assets/welcome/welcome.html +1 -1
- package/autonomy/completion-council.sh +0 -52
- package/autonomy/context-tracker.py +10 -25
- package/autonomy/council-v2.sh +0 -28
- package/autonomy/grill.sh +3 -25
- package/autonomy/lib/chat.sh +3 -6
- package/autonomy/lib/claude-flags.sh +1 -1
- package/autonomy/lib/cost-summary.py +2 -2
- package/autonomy/lib/done-recognition.sh +1 -1
- package/autonomy/lib/efficiency_cost.py +1 -1
- package/autonomy/lib/effort_estimator.py +0 -4
- package/autonomy/lib/help-core.sh +6 -4
- package/autonomy/lib/iteration_attribution.py +1 -1
- package/autonomy/lib/mcp-config.sh +7 -34
- package/autonomy/lib/os_sandbox.py +2 -5
- package/autonomy/lib/outcome_ledger.py +1 -1
- package/autonomy/lib/project-graph.sh +1 -1
- package/autonomy/lib/setup-requirements.json +1 -4
- package/autonomy/lib/skill-link-heal.sh +1 -1
- package/autonomy/lib/telemetry-schema.json +3 -3
- package/autonomy/lib/wiki_llm.py +1 -4
- package/autonomy/loki +95 -335
- package/autonomy/migration-agents.sh +1 -1
- package/autonomy/prd-checklist.sh +1 -1
- package/autonomy/provider-offer.sh +7 -11
- package/autonomy/quickstart.sh +3 -11
- package/autonomy/route.sh +6 -6
- package/autonomy/run.sh +51 -291
- package/autonomy/sandbox.sh +8 -39
- package/autonomy/setup-wizard.sh +5 -5
- package/bin/loki +34 -25
- package/completions/_loki +4 -4
- package/completions/loki.bash +2 -4
- package/dashboard/__init__.py +1 -1
- package/dashboard/api_start.py +36 -6
- package/dashboard/build_supervisor.py +1 -5
- package/dashboard/server.py +18 -26
- package/docs/ARCHITECTURE.md +9 -10
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/COMPARE-OPENCODE.md +7 -6
- package/docs/COMPONENTS.md +5 -8
- package/docs/DOCKER.md +11 -10
- package/docs/INSTALLATION.md +5 -8
- package/docs/OPEN-CORE-BOUNDARY.md +1 -1
- package/docs/PRIVACY.md +2 -2
- package/docs/QUICKSTART.md +2 -2
- package/docs/TOOLS.md +3 -3
- package/docs/air-gapped.md +3 -3
- package/docs/alternative-installations.md +20 -10
- package/docs/cost-controls.md +0 -3
- package/docs/dev/architecture-reference.md +1 -1
- package/docs/dev/project-structure.md +1 -4
- package/docs/environment-variables.md +8 -10
- package/docs/exit-codes.md +5 -5
- package/docs/network-security.md +3 -6
- package/docs/v10/GUIDE.md +45 -34
- package/integrations/openclaw/README.md +1 -1
- package/integrations/openclaw/SKILL.md +3 -3
- package/learning/emit.sh +1 -1
- package/loki-ts/data/child-env.json +0 -8
- package/loki-ts/dist/cockpit.js +1 -1
- package/loki-ts/dist/loki.js +1339 -1345
- package/magic/core/debate.py +4 -11
- package/magic/core/generator.py +5 -18
- package/mcp/__init__.py +1 -1
- package/mcp/server.py +1 -1
- package/package.json +2 -3
- package/packages/control-plane/dist/ask-tools-server.js +1 -3
- package/packages/control-plane/dist/server.js +171 -395
- package/packages/control-plane/src/ask/invoke.ts +5 -13
- package/packages/control-plane/src/ask/parse.ts +3 -25
- package/packages/control-plane/src/ask/worker.ts +1 -2
- package/packages/control-plane/src/db/fixture-cleanup.ts +1 -1
- package/packages/control-plane/src/server/routes/ask.ts +3 -2
- package/packages/control-plane/src/server/routes/cost_ledger.ts +0 -1
- package/packages/control-plane/src/server/routes/providers.ts +4 -9
- package/packages/control-plane/src/server/spawn.ts +8 -4
- package/packages/control-plane/ui/dist/assets/{index-C4nb1aRV.js → index-Dy80VLtj.js} +22 -22
- package/packages/control-plane/ui/dist/index.html +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/loader.sh +23 -4
- package/providers/model_catalog.json +2 -104
- package/providers/models.sh +10 -11
- package/providers/opencode.sh +3 -6
- package/references/quality-control.md +1 -1
- package/schemas/loki-yaml.schema.json +1 -1
- package/skills/model-selection.md +26 -55
- package/skills/providers.md +54 -221
- package/skills/quality-gates.md +3 -3
- package/skills/troubleshooting.md +1 -1
- package/src/integrations/github/action-handler.js +2 -4
- package/src/protocols/tools/start-project.js +1 -1
- package/tools/index-codebase.py +1 -2
- package/tools/preflight.sh +2 -2
- package/tools/probe-model-catalog.py +1 -13
- package/tools/regen-state-machine-refs.py +1 -2
- package/tools/token-guard.py +1 -1
- package/web-app/dist/assets/{AdminPage-CSwrd2UA.js → AdminPage-BfxkhFXl.js} +1 -1
- package/web-app/dist/assets/{Avatar-B6SmKtXt.js → Avatar-xV4rK0ps.js} +1 -1
- package/web-app/dist/assets/{Badge-CR4U3l95.js → Badge-Ds_E82Ka.js} +1 -1
- package/web-app/dist/assets/{Button-DmcHmlo6.js → Button-BXAwY0ni.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-CR_GmqRg.js → CockpitPage-y3R9sk_M.js} +1 -1
- package/web-app/dist/assets/ComparePage-BGbCno4C.js +1 -0
- package/web-app/dist/assets/{ErrorBoundary-23WE8Kb8.js → ErrorBoundary-DGqkzHdy.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-dFODI74J.js → EvidenceReceiptPanel-Bj57TWoJ.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-CudHcPXf.js → GitHubIssuesPanel-CVbtUCRI.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-0WcASaRW.js → GitHubPRsPanel-DuNxI0k8.js} +1 -1
- package/web-app/dist/assets/{HomePage-CQL8xADH.js → HomePage-DogFuRvt.js} +2 -2
- package/web-app/dist/assets/{LoginPage-BRfdWXgI.js → LoginPage-U-r-YNKC.js} +1 -1
- package/web-app/dist/assets/{MagicPage-CaaPZyuJ.js → MagicPage-C5iDqK4d.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-BjQ0sz0F.js → MetricsPage-COVYOGfr.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-BNnrwX96.js → NotFoundPage-CZii6Z0s.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-pDqfWbBG.js → ProjectPage-QwOZzVqj.js} +25 -25
- package/web-app/dist/assets/{ProjectsPage-CiHCZYVm.js → ProjectsPage-BcxVfXVW.js} +1 -1
- package/web-app/dist/assets/SettingsPage-CBY9JiAE.js +10 -0
- package/web-app/dist/assets/{ShowcasePage-BCa643R5.js → ShowcasePage-D1YPQOp7.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-DcpAC9Lg.js +1 -0
- package/web-app/dist/assets/{TeamsPage-CG-DqMjn.js → TeamsPage-BTiJPkD4.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-CO_kXHRt.js → TemplatesPage-LUa3bH-A.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-C_iYHB-7.js → TerminalOutput-BM8LH-RG.js} +1 -1
- package/web-app/dist/assets/{activity-Cp6ZIiZc.js → activity-mZHuLoR5.js} +1 -1
- package/web-app/dist/assets/{bell-BZf6hsa9.js → bell-BR_y_nMB.js} +1 -1
- package/web-app/dist/assets/{bot-CGmNbYLx.js → bot-Ct3caGMX.js} +1 -1
- package/web-app/dist/assets/{check-CMDDpUDY.js → check-DuQpq9PN.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DTtdfTHr.js → chevron-left-CWSfVWba.js} +1 -1
- package/web-app/dist/assets/{circle-alert-Ch6h3j52.js → circle-alert-C7TCj9Jm.js} +1 -1
- package/web-app/dist/assets/{clock-Ce1nf2ai.js → clock-BFsj3bRT.js} +1 -1
- package/web-app/dist/assets/{cloud-p2TFekpg.js → cloud-78sYPXff.js} +1 -1
- package/web-app/dist/assets/{code-xml-Kyu4vmM1.js → code-xml-DuwBCDz-.js} +1 -1
- package/web-app/dist/assets/{database-B4HrqS9b.js → database-CwRTYKVV.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-Cw-uyKAg.js → dollar-sign-COXAsjgd.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-C8N3vuAd.js → file-code-corner-A8LPVBBy.js} +1 -1
- package/web-app/dist/assets/{file-plus-Ddd367Rd.js → file-plus-D9IXE7YW.js} +1 -1
- package/web-app/dist/assets/{globe-BW_Nzcek.js → globe-Ce6xgdLR.js} +1 -1
- package/web-app/dist/assets/{hammer-rS0zwOgP.js → hammer-Dtq836Al.js} +1 -1
- package/web-app/dist/assets/{index-BFtUVrg2.js → index-uce16-nn.js} +16 -16
- package/web-app/dist/assets/{layers-ChTtsWHz.js → layers-BOQdqOXk.js} +1 -1
- package/web-app/dist/assets/{loader-circle-Dl2j378Y.js → loader-circle-D3y4SHAn.js} +1 -1
- package/web-app/dist/assets/{lock-H0jwxcaH.js → lock-miFONHLo.js} +1 -1
- package/web-app/dist/assets/{package-Cn0OyUWi.js → package-ckZFIHTG.js} +1 -1
- package/web-app/dist/assets/{plus-c4Cn8Hg_.js → plus-COJKSbOp.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-CvtIp31h.js → refresh-cw-rPt-Oa4a.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CACNVELf.js → rotate-ccw-Dy50K31A.js} +1 -1
- package/web-app/dist/assets/{scroll-text-wcpAN4zz.js → scroll-text-CbczPkkS.js} +1 -1
- package/web-app/dist/assets/{server-C8tiYYoH.js → server-HkfTEf2O.js} +1 -1
- package/web-app/dist/assets/{shield-alert-D2EqAn5F.js → shield-alert-DjKF0yba.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-DoxGQgUE.js → thumbs-up-aObjUDQm.js} +1 -1
- package/web-app/dist/assets/{trash-2-HbLfFoN4.js → trash-2-CQfI6Z-c.js} +1 -1
- package/web-app/dist/assets/{trending-down-Djd4tkxi.js → trending-down-CP7J5aPV.js} +1 -1
- package/web-app/dist/assets/{trending-up-B9Nco_QQ.js → trending-up-CTJHoPnm.js} +1 -1
- package/web-app/dist/assets/{upload-Bu_bR4UG.js → upload-i1zoXd2k.js} +1 -1
- package/web-app/dist/assets/{usePolling-D6jTTEO8.js → usePolling-CZG-IV1Y.js} +1 -1
- package/web-app/dist/assets/{user-3vyW2Iwk.js → user-CJwbwmPE.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/web-app/server.py +26 -14
- package/autonomy/lib/codex-usage.py +0 -174
- package/providers/aider.sh +0 -191
- package/providers/cline.sh +0 -176
- package/providers/codex.sh +0 -408
- package/web-app/dist/assets/ComparePage-DH9gwrob.js +0 -1
- package/web-app/dist/assets/SettingsPage-B-1-R56L.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-BUHVmvMB.js +0 -1
package/README.md
CHANGED
|
@@ -123,10 +123,11 @@ Core verbs: [docs/CLI-CORE-VERBS.md](docs/CLI-CORE-VERBS.md). Every command (gen
|
|
|
123
123
|
|
|
124
124
|
### Models, providers and local models
|
|
125
125
|
|
|
126
|
-
Claude Code is the default Tier-1 provider. `--provider
|
|
126
|
+
Two providers are supported. Claude Code is the default Tier-1 provider (the `claude` CLI, or, with only `ANTHROPIC_API_KEY`, the Anthropic Agent SDK). `--provider opencode` (or `LOKI_PROVIDER=opencode`) runs opencode, which reaches any model, including OpenRouter: export `OPENROUTER_API_KEY` and pass `--model openrouter/<vendor>/<model>`; the Loki 10 engine enforces the wall-clock limit and a post-iteration guard scan there. codex, cline, aider and gemini were removed and exit 2 with a one-line migration message. To keep the Claude harness on OpenRouter or a local model, set `LOKI_MODEL_ROUTE=<kind>/<id>` (kinds: `openrouter`, `ollama`, `lmstudio`, `llamacpp`, `vllm`, `custom`) before `loki start`; `loki models --local` finds local runtimes and prints ready-to-paste values.
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md
|
|
130
|
+
OPENROUTER_API_KEY=sk-or-... loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 prd.md
|
|
130
131
|
```
|
|
131
132
|
|
|
132
133
|
## Control Plane
|
|
@@ -156,7 +157,7 @@ Optional:
|
|
|
156
157
|
|
|
157
158
|
- Python 3.8+ (`python3`): deep scans, Python repos and group runs use it. `loki "<goal>"` runs without it.
|
|
158
159
|
- `jq`: `loki status` and the bash fallback CLI use it.
|
|
159
|
-
-
|
|
160
|
+
- opencode (`--provider opencode`) for any model, including OpenRouter. Ollama or an OpenRouter key for model routes.
|
|
160
161
|
- Bun 1.3+ (`bun`) on your PATH (the npm package also bundles it).
|
|
161
162
|
- Docker, to run Loki from the published image.
|
|
162
163
|
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Runs an autonomous software factory that knows what it is supposed to deliver and proves it did, with a signed receipt. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v11.
|
|
6
|
+
# Loki Mode v11.121.0
|
|
7
7
|
|
|
8
8
|
**Current entry points (Loki 10 engine):** `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"` run the Loki 10 engine and end with a signed receipt (`loki verify`). `loki backlog owner/repo --all` runs many issues in parallel. Guide: `docs/v10/GUIDE.md`. The skill instructions below, and `loki start`, describe the previous bash loop. PRD-file starts (`loki start ./prd.md`) and the opencode provider still run on it until FC38-SWEEP ports them; the legacy-engine command and the LOKI_ENGINE switch remain removed. Prefer `loki owner/repo#N` for issues.
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ description: Runs an autonomous software factory that knows what it is supposed
|
|
|
15
15
|
|
|
16
16
|
**Evidence Receipt (verify it yourself).** Every run writes a receipt to `.loki/proofs/<run_id>/` (opt out with `LOKI_PROOF=0`) that separates deterministic FACTS (git diff with base/head SHAs and a `diff_sha256`, the test command + exit code, the build command + exit code, each gate verdict) from AI ASSESSMENTS (the council verdict, labeled judgment not proof). The headline is computed only from the facts: VERIFIED (tests ran a real command and exited 0, diff non-empty, nothing skipped), VERIFIED WITH GAPS (each gap listed by name), or NOT VERIFIED (a check ran and failed). Inspect and re-check with `loki proof list|show <id>|verify <id>` (aliased `loki receipt`); `loki proof verify` re-hashes the receipt (tamper) and re-derives the diff from the recorded base SHA against the live repo (drift), exiting 0 clean / 1 tamper-or-drift / 2 could not check (64 usage, 66 unknown id; see `docs/exit-codes.md`). This is honesty-of-done, not a claim that the code is bug-free.
|
|
17
17
|
|
|
18
|
-
**
|
|
18
|
+
**Providers:** Claude Code (full), the Anthropic Agent SDK path for API-key users (still `--provider claude`), and opencode (any model, including OpenRouter). codex, cline, aider and gemini were removed and exit 2 with a migration line. See `skills/providers.md`. **Legacy track (v8.0.0):** the Anthropic Agent SDK route (see below), spec-mode expansion for OpenAPI/GraphQL/Postman contracts, the runtime-boot and secret-leak evidence axes, and `loki steer` / `loki why` for mid-run control. Earlier tracks: LSP grounding as a first-class agent tool (v7.7.x) and Phase 1 RARV-C closure (real provider judges, gate-failure flock, synthetic PRD e2e, status `--json`).
|
|
19
19
|
|
|
20
20
|
**Runtime migration:** Bash-to-Bun migration. `bin/loki` is the router: the commands in its Bun-route `case` (read-only ones such as `version`, `status`, `stats`, `doctor`, `provider`, `memory`, plus stateful ones such as `rollback`, `trust`, `proof`/`receipt`, `control`, `answer`) run through `loki-ts/src/cli.ts` on Bun; the rest, and some flag forms (for example `doctor --airgap`, `trust detail`), run on Bash (`autonomy/loki`). `start` and `quick` are routed by `autonomy/route.sh` to the Loki 10 engine; the Bash loop runs only on `--engine legacy`. Read `bin/loki` and `cli.ts` for the exact set rather than trusting a list here. Rollback: `LOKI_LEGACY_BASH=1`. See `docs/architecture/ADR-001-runtime-migration.md`.
|
|
21
21
|
|
|
@@ -113,17 +113,17 @@ These rules guide autonomous operation. Test results and code quality always tak
|
|
|
113
113
|
|
|
114
114
|
**Default since v5.3.0 (reaffirmed in v7.5.13):** Haiku disabled for quality. Use `--allow-haiku` or `LOKI_ALLOW_HAIKU=true` to enable.
|
|
115
115
|
|
|
116
|
-
| Task Type | Tier | Claude (default) | Claude (--allow-haiku) |
|
|
117
|
-
|
|
118
|
-
| Spec analysis, architecture, system design | **planning** | opus | opus |
|
|
119
|
-
| Feature implementation, complex bugs | **development** | opus | sonnet |
|
|
120
|
-
| Code review (planned: 3 parallel reviewers) | **development** | opus | sonnet |
|
|
121
|
-
| Integration tests, E2E, deployment | **development** | opus | sonnet |
|
|
122
|
-
| Unit tests, linting, docs, simple fixes | **fast** | sonnet | haiku |
|
|
116
|
+
| Task Type | Tier | Claude (default) | Claude (--allow-haiku) |
|
|
117
|
+
|-----------|------|------------------|------------------------|
|
|
118
|
+
| Spec analysis, architecture, system design | **planning** | opus | opus |
|
|
119
|
+
| Feature implementation, complex bugs | **development** | opus | sonnet |
|
|
120
|
+
| Code review (planned: 3 parallel reviewers) | **development** | opus | sonnet |
|
|
121
|
+
| Integration tests, E2E, deployment | **development** | opus | sonnet |
|
|
122
|
+
| Unit tests, linting, docs, simple fixes | **fast** | sonnet | haiku |
|
|
123
123
|
|
|
124
124
|
**Parallelization rule (Claude only):** Launch independent tasks in parallel.
|
|
125
125
|
|
|
126
|
-
**
|
|
126
|
+
**opencode:** one `provider/model` for every tier (`LOKI_OPENCODE_MODEL`), no parallel agents or Task tool, MCP supported. Runs the RARV cycle sequentially. See `skills/model-selection.md`.
|
|
127
127
|
|
|
128
128
|
**Git worktree parallelism:** For true parallel feature development, use `--parallel` flag with run.sh. See `skills/parallel-workflows.md`.
|
|
129
129
|
|
|
@@ -200,7 +200,7 @@ Pick modules from this table, one hop from here. Each module over 100 lines open
|
|
|
200
200
|
| Artifacts, reports | [artifacts.md](skills/artifacts.md) |
|
|
201
201
|
| Parallel features, git worktrees, 50+ agents | [parallel-workflows.md](skills/parallel-workflows.md) |
|
|
202
202
|
| GitHub issues, PRs, syncing | [github-integration.md](skills/github-integration.md) |
|
|
203
|
-
|
|
|
203
|
+
| Providers (Claude, Agent SDK, opencode/OpenRouter) | [providers.md](skills/providers.md) |
|
|
204
204
|
| OpenSpec delta context, brownfield changes | [openspec-integration.md](skills/openspec-integration.md) |
|
|
205
205
|
| MiroFish validation, `--mirofish` | [mirofish-integration.md](skills/mirofish-integration.md) |
|
|
206
206
|
| Writing documentation, `loki docs` | [documentation.md](skills/documentation.md) |
|
|
@@ -252,9 +252,7 @@ loki start --issue 123 # Explicit issue mode (overrides de
|
|
|
252
252
|
|
|
253
253
|
# With provider selection (supports .md and .json PRDs)
|
|
254
254
|
loki start --provider claude ./prd.md # Default, full features
|
|
255
|
-
loki start --provider
|
|
256
|
-
loki start --provider cline ./prd.md # Cline CLI, degraded mode
|
|
257
|
-
loki start --provider aider ./prd.md # Aider (18+ providers), degraded mode
|
|
255
|
+
loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 ./prd.md # opencode via OpenRouter (OPENROUTER_API_KEY)
|
|
258
256
|
|
|
259
257
|
# Parallel and auto-merge (legacy loop only; the default engine refuses these flags)
|
|
260
258
|
loki start ./prd.md --parallel --engine legacy
|
|
@@ -275,10 +273,9 @@ loki docker --image IMG start prd.md # override the image
|
|
|
275
273
|
|
|
276
274
|
**Provider capabilities:**
|
|
277
275
|
- **Claude**: Opus 4.6, 1M context (beta), 128K output, adaptive thinking, agent teams, full features (Task tool, parallel agents, MCP)
|
|
278
|
-
- **
|
|
279
|
-
- **
|
|
280
|
-
- **
|
|
281
|
-
- **Google Gemini CLI**: DEPRECATED starting v7.5.18 (upstream deprecated; runtime removed)
|
|
276
|
+
- **Claude via the Agent SDK**: same provider, for `ANTHROPIC_API_KEY` users without a CLI login
|
|
277
|
+
- **opencode**: 75+ model providers including OpenRouter (`openrouter/<vendor>/<model>`), MCP support, sequential only (no Task tool)
|
|
278
|
+
- **Removed**: codex, cline, aider, gemini (selecting one exits 2 naming claude and opencode)
|
|
282
279
|
|
|
283
280
|
---
|
|
284
281
|
|
|
@@ -464,4 +461,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
|
|
|
464
461
|
|
|
465
462
|
---
|
|
466
463
|
|
|
467
|
-
**v11.
|
|
464
|
+
**v11.121.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.121.0
|
package/agents/custom_agents.py
CHANGED
|
@@ -14,7 +14,7 @@ PERMISSIONS = ("plan", "edit", "full")
|
|
|
14
14
|
KEYS = ("name", "description", "model", "provider", "tools", "deny", "permission", "role")
|
|
15
15
|
LIST_KEYS = ("tools", "deny")
|
|
16
16
|
NAME_RE = re.compile(r"^[a-z0-9][a-z0-9_-]{0,63}$")
|
|
17
|
-
PROVIDERS = ("claude", "
|
|
17
|
+
PROVIDERS = ("claude", "opencode")
|
|
18
18
|
# Tools a plan-permission agent must not use when exported to Claude Code.
|
|
19
19
|
PLAN_DENY = ["Edit", "Write", "NotebookEdit", "Bash"]
|
|
20
20
|
|
package/api/openapi.yaml
CHANGED
|
@@ -704,7 +704,7 @@ components:
|
|
|
704
704
|
nullable: true
|
|
705
705
|
provider:
|
|
706
706
|
type: string
|
|
707
|
-
enum: [claude,
|
|
707
|
+
enum: [claude, opencode]
|
|
708
708
|
status:
|
|
709
709
|
type: string
|
|
710
710
|
enum: [starting, running, paused, stopping, stopped, failed, completed]
|
|
@@ -770,7 +770,7 @@ components:
|
|
|
770
770
|
description: Path to PRD file
|
|
771
771
|
provider:
|
|
772
772
|
type: string
|
|
773
|
-
enum: [claude,
|
|
773
|
+
enum: [claude, opencode]
|
|
774
774
|
default: claude
|
|
775
775
|
options:
|
|
776
776
|
type: object
|
|
@@ -835,11 +835,7 @@ components:
|
|
|
835
835
|
properties:
|
|
836
836
|
claude:
|
|
837
837
|
type: boolean
|
|
838
|
-
|
|
839
|
-
type: boolean
|
|
840
|
-
cline:
|
|
841
|
-
type: boolean
|
|
842
|
-
aider:
|
|
838
|
+
opencode:
|
|
843
839
|
type: boolean
|
|
844
840
|
activeSession:
|
|
845
841
|
type: string
|
package/api/routes/health.ts
CHANGED
|
@@ -152,9 +152,7 @@ export async function detailedStatus(_req: Request): Promise<Response> {
|
|
|
152
152
|
*/
|
|
153
153
|
async function checkProviders(): Promise<{
|
|
154
154
|
claude: boolean;
|
|
155
|
-
|
|
156
|
-
cline: boolean;
|
|
157
|
-
aider: boolean;
|
|
155
|
+
opencode: boolean;
|
|
158
156
|
}> {
|
|
159
157
|
const checkCommand = async (cmd: string): Promise<boolean> => {
|
|
160
158
|
try {
|
|
@@ -170,16 +168,13 @@ async function checkProviders(): Promise<{
|
|
|
170
168
|
}
|
|
171
169
|
};
|
|
172
170
|
|
|
173
|
-
//
|
|
174
|
-
|
|
175
|
-
const [claude, codex, cline, aider] = await Promise.all([
|
|
171
|
+
// The supported set (providers/loader.sh SUPPORTED_PROVIDERS).
|
|
172
|
+
const [claude, opencode] = await Promise.all([
|
|
176
173
|
checkCommand("claude"),
|
|
177
|
-
checkCommand("
|
|
178
|
-
checkCommand("cline"),
|
|
179
|
-
checkCommand("aider"),
|
|
174
|
+
checkCommand("opencode"),
|
|
180
175
|
]);
|
|
181
176
|
|
|
182
|
-
return { claude,
|
|
177
|
+
return { claude, opencode };
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
/**
|
package/api/routes/sessions.ts
CHANGED
|
@@ -23,6 +23,13 @@ import {
|
|
|
23
23
|
successResponse,
|
|
24
24
|
} from "../middleware/error.ts";
|
|
25
25
|
|
|
26
|
+
// Restated from loki-ts/src/runner/types.ts (VALID_PROVIDERS, REMOVED_PROVIDERS, removedProviderMessage);
|
|
27
|
+
// api/ ships without loki-ts/src, so it cannot import them. Keep the message byte-identical.
|
|
28
|
+
const SUPPORTED_PROVIDERS: string[] = ["claude", "opencode"];
|
|
29
|
+
const REMOVED_PROVIDERS: string[] = ["codex", "cline", "aider", "gemini"];
|
|
30
|
+
const removedProviderMessage = (provider: string): string =>
|
|
31
|
+
`loki: provider '${provider}' is no longer supported. Supported providers: claude (Claude Code CLI, or an Anthropic API key through the Agent SDK) and opencode (any model, including OpenRouter via OPENROUTER_API_KEY). Switch with --provider claude or --provider opencode, or unset LOKI_PROVIDER.`;
|
|
32
|
+
|
|
26
33
|
/**
|
|
27
34
|
* POST /api/sessions - Start a new session
|
|
28
35
|
*/
|
|
@@ -38,9 +45,11 @@ export async function startSession(req: Request): Promise<Response> {
|
|
|
38
45
|
|
|
39
46
|
// Validate provider
|
|
40
47
|
const provider = data.provider || "claude";
|
|
41
|
-
if (!
|
|
48
|
+
if (!SUPPORTED_PROVIDERS.includes(provider)) {
|
|
42
49
|
throw new LokiApiError(
|
|
43
|
-
|
|
50
|
+
REMOVED_PROVIDERS.includes(provider)
|
|
51
|
+
? removedProviderMessage(provider)
|
|
52
|
+
: `Invalid provider: ${provider}. Must be one of: ${SUPPORTED_PROVIDERS.join(", ")}`,
|
|
44
53
|
ErrorCodes.VALIDATION_ERROR
|
|
45
54
|
);
|
|
46
55
|
}
|
|
@@ -51,7 +60,7 @@ export async function startSession(req: Request): Promise<Response> {
|
|
|
51
60
|
"provider",
|
|
52
61
|
provider,
|
|
53
62
|
{
|
|
54
|
-
alternativesRejected:
|
|
63
|
+
alternativesRejected: SUPPORTED_PROVIDERS.filter((p) => p !== provider),
|
|
55
64
|
context: {
|
|
56
65
|
hasPrd: !!data.prdPath,
|
|
57
66
|
options: data.options,
|
package/api/server.js
CHANGED
|
@@ -38,7 +38,11 @@ const DEFAULT_HOST = '127.0.0.1';
|
|
|
38
38
|
const PROJECT_DIR = process.env.LOKI_PROJECT_DIR || process.cwd();
|
|
39
39
|
|
|
40
40
|
// Security constants
|
|
41
|
-
const VALID_PROVIDERS = ['claude', '
|
|
41
|
+
const VALID_PROVIDERS = ['claude', 'opencode'];
|
|
42
|
+
// Restated from loki-ts/src/runner/types.ts (REMOVED_PROVIDERS, removedProviderMessage); keep byte-identical.
|
|
43
|
+
const REMOVED_PROVIDERS = ['codex', 'cline', 'aider', 'gemini'];
|
|
44
|
+
const removedProviderMessage = (provider) =>
|
|
45
|
+
`loki: provider '${provider}' is no longer supported. Supported providers: claude (Claude Code CLI, or an Anthropic API key through the Agent SDK) and opencode (any model, including OpenRouter via OPENROUTER_API_KEY). Switch with --provider claude or --provider opencode, or unset LOKI_PROVIDER.`;
|
|
42
46
|
const MAX_BODY_SIZE = 1024 * 1024; // 1MB limit
|
|
43
47
|
const MAX_LOG_LINES = 1000;
|
|
44
48
|
const LOKI_DIR = path.join(PROJECT_DIR, '.loki');
|
|
@@ -233,7 +237,7 @@ class ProcessManager {
|
|
|
233
237
|
|
|
234
238
|
// Validate provider (security: prevent command injection)
|
|
235
239
|
if (!VALID_PROVIDERS.includes(provider)) {
|
|
236
|
-
throw new Error(`Invalid provider: ${provider}. Must be one of: ${VALID_PROVIDERS.join(', ')}`);
|
|
240
|
+
throw new Error(REMOVED_PROVIDERS.includes(provider) ? removedProviderMessage(provider) : `Invalid provider: ${provider}. Must be one of: ${VALID_PROVIDERS.join(', ')}`);
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
// Validate PRD path (security: prevent path traversal)
|
|
@@ -48,7 +48,7 @@ class CLIBridge {
|
|
|
48
48
|
*/
|
|
49
49
|
async startSession(
|
|
50
50
|
prdPath?: string,
|
|
51
|
-
provider: "claude" | "
|
|
51
|
+
provider: "claude" | "opencode" = "claude",
|
|
52
52
|
options: { dryRun?: boolean; verbose?: boolean } = {}
|
|
53
53
|
): Promise<Session> {
|
|
54
54
|
const sessionId = `session_${Date.now()}_${crypto.randomUUID().slice(0, 8)}`;
|
package/api/types/api.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export interface Session {
|
|
9
9
|
id: string;
|
|
10
10
|
prdPath: string | null;
|
|
11
|
-
provider: "claude" | "
|
|
11
|
+
provider: "claude" | "opencode";
|
|
12
12
|
status: SessionStatus;
|
|
13
13
|
startedAt: string;
|
|
14
14
|
updatedAt: string;
|
|
@@ -62,7 +62,7 @@ export type TaskStatus =
|
|
|
62
62
|
// API Request/Response types
|
|
63
63
|
export interface StartSessionRequest {
|
|
64
64
|
prdPath?: string;
|
|
65
|
-
provider?: "claude" | "
|
|
65
|
+
provider?: "claude" | "opencode";
|
|
66
66
|
options?: {
|
|
67
67
|
dryRun?: boolean;
|
|
68
68
|
verbose?: boolean;
|
|
@@ -115,9 +115,7 @@ export interface HealthResponse {
|
|
|
115
115
|
uptime: number;
|
|
116
116
|
providers: {
|
|
117
117
|
claude: boolean;
|
|
118
|
-
|
|
119
|
-
cline: boolean;
|
|
120
|
-
aider: boolean;
|
|
118
|
+
opencode: boolean;
|
|
121
119
|
};
|
|
122
120
|
activeSession: string | null;
|
|
123
121
|
}
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
<div class="card">
|
|
166
166
|
<span class="tag">Yours to run</span>
|
|
167
167
|
<h3>Provider-agnostic and private</h3>
|
|
168
|
-
<p>Runs on Claude
|
|
168
|
+
<p>Runs on Claude Code or opencode (any model, including OpenRouter). Your keys, your infrastructure, no vendor lock-in.</p>
|
|
169
169
|
</div>
|
|
170
170
|
</div>
|
|
171
171
|
|
|
@@ -3121,10 +3121,6 @@ council_member_review() {
|
|
|
3121
3121
|
command -v claude >/dev/null 2>&1 || { log_error "Claude CLI not found"; return 1; }
|
|
3122
3122
|
fi
|
|
3123
3123
|
;;
|
|
3124
|
-
codex) command -v codex >/dev/null 2>&1 || { log_error "Codex CLI not found"; return 1; } ;;
|
|
3125
|
-
gemini) command -v gemini >/dev/null 2>&1 || { log_error "Gemini CLI not found"; return 1; } ;;
|
|
3126
|
-
cline) command -v cline >/dev/null 2>&1 || { log_error "Cline CLI not found"; return 1; } ;;
|
|
3127
|
-
aider) command -v aider >/dev/null 2>&1 || { log_error "Aider not found"; return 1; } ;;
|
|
3128
3124
|
esac
|
|
3129
3125
|
|
|
3130
3126
|
local evidence
|
|
@@ -3308,30 +3304,6 @@ ISSUES: CRITICAL:description (optional, one per line per issue)"
|
|
|
3308
3304
|
_provider_rc=$?
|
|
3309
3305
|
fi
|
|
3310
3306
|
;;
|
|
3311
|
-
codex)
|
|
3312
|
-
if command -v codex &>/dev/null; then
|
|
3313
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" codex exec --sandbox workspace-write "$prompt" 2>/dev/null)
|
|
3314
|
-
_provider_rc=$?
|
|
3315
|
-
fi
|
|
3316
|
-
;;
|
|
3317
|
-
gemini)
|
|
3318
|
-
if command -v gemini &>/dev/null; then
|
|
3319
|
-
verdict=$(echo "$prompt" | timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" gemini 2>/dev/null)
|
|
3320
|
-
_provider_rc=$?
|
|
3321
|
-
fi
|
|
3322
|
-
;;
|
|
3323
|
-
cline)
|
|
3324
|
-
if command -v cline &>/dev/null; then
|
|
3325
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" cline -y "$prompt" 2>/dev/null)
|
|
3326
|
-
_provider_rc=$?
|
|
3327
|
-
fi
|
|
3328
|
-
;;
|
|
3329
|
-
aider)
|
|
3330
|
-
if command -v aider &>/dev/null; then
|
|
3331
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" aider --message "$prompt" --yes-always --no-auto-commits --no-git 2>/dev/null)
|
|
3332
|
-
_provider_rc=$?
|
|
3333
|
-
fi
|
|
3334
|
-
;;
|
|
3335
3307
|
*)
|
|
3336
3308
|
# v8.2.0 TIMEOUT SEAM. Any provider exposing provider_invoke_argv can
|
|
3337
3309
|
# cast a real council vote instead of falling straight to the
|
|
@@ -3402,10 +3374,6 @@ council_devils_advocate() {
|
|
|
3402
3374
|
command -v claude >/dev/null 2>&1 || { log_error "Claude CLI not found"; return 1; }
|
|
3403
3375
|
fi
|
|
3404
3376
|
;;
|
|
3405
|
-
codex) command -v codex >/dev/null 2>&1 || { log_error "Codex CLI not found"; return 1; } ;;
|
|
3406
|
-
gemini) command -v gemini >/dev/null 2>&1 || { log_error "Gemini CLI not found"; return 1; } ;;
|
|
3407
|
-
cline) command -v cline >/dev/null 2>&1 || { log_error "Cline CLI not found"; return 1; } ;;
|
|
3408
|
-
aider) command -v aider >/dev/null 2>&1 || { log_error "Aider not found"; return 1; } ;;
|
|
3409
3377
|
esac
|
|
3410
3378
|
|
|
3411
3379
|
local evidence
|
|
@@ -3506,26 +3474,6 @@ REASON: one-line justification citing path:line evidence"
|
|
|
3506
3474
|
verdict=$(echo "$prompt" | timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" env "SHELL=$_co_shell" CAVEMAN_DEFAULT_MODE=off claude "${_co_argv[@]}" -p 2>/dev/null)
|
|
3507
3475
|
fi
|
|
3508
3476
|
;;
|
|
3509
|
-
codex)
|
|
3510
|
-
if command -v codex &>/dev/null; then
|
|
3511
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" codex exec --sandbox workspace-write "$prompt" 2>/dev/null)
|
|
3512
|
-
fi
|
|
3513
|
-
;;
|
|
3514
|
-
gemini)
|
|
3515
|
-
if command -v gemini &>/dev/null; then
|
|
3516
|
-
verdict=$(echo "$prompt" | timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" gemini 2>/dev/null)
|
|
3517
|
-
fi
|
|
3518
|
-
;;
|
|
3519
|
-
cline)
|
|
3520
|
-
if command -v cline &>/dev/null; then
|
|
3521
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" cline -y "$prompt" 2>/dev/null)
|
|
3522
|
-
fi
|
|
3523
|
-
;;
|
|
3524
|
-
aider)
|
|
3525
|
-
if command -v aider &>/dev/null; then
|
|
3526
|
-
verdict=$(timeout "${LOKI_COUNCIL_REVIEW_TIMEOUT:-600}" aider --message "$prompt" --yes-always --no-auto-commits --no-git 2>/dev/null)
|
|
3527
|
-
fi
|
|
3528
|
-
;;
|
|
3529
3477
|
*)
|
|
3530
3478
|
# v8.2.0 TIMEOUT SEAM (contrarian / devil's-advocate vote). Same
|
|
3531
3479
|
# rationale as the member vote: a real argv keeps the `timeout`
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
Parses provider session files to extract token usage data
|
|
5
5
|
and writes tracking information to .loki/context/tracking.json.
|
|
6
6
|
|
|
7
|
-
Provider-agnostic: supports Claude
|
|
7
|
+
Provider-agnostic: supports the Claude Code and opencode CLIs.
|
|
8
8
|
- Claude: parses session JSONL from ~/.claude/projects/
|
|
9
|
-
-
|
|
9
|
+
- opencode: accepts token data via --tokens-input/--tokens-output CLI args
|
|
10
10
|
- All providers: can accept --session-file to specify session file directly
|
|
11
11
|
|
|
12
12
|
Called by run.sh after each RARV iteration.
|
|
13
13
|
|
|
14
14
|
Usage:
|
|
15
15
|
python3 context-tracker.py --iteration N --loki-dir .loki [--window-size N] [--model ID]
|
|
16
|
-
python3 context-tracker.py --iteration N --loki-dir .loki --provider
|
|
16
|
+
python3 context-tracker.py --iteration N --loki-dir .loki --provider opencode \
|
|
17
17
|
--tokens-input 5000 --tokens-output 2000
|
|
18
18
|
python3 context-tracker.py --iteration N --loki-dir .loki --session-file /path/to/session.jsonl
|
|
19
19
|
"""
|
|
@@ -28,7 +28,7 @@ from pathlib import Path
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
# Default pricing (USD per million tokens) - provider-specific overrides below
|
|
31
|
-
# NOTE (fable): this table is keyed by PROVIDER (claude
|
|
31
|
+
# NOTE (fable): this table is keyed by PROVIDER (claude), not by
|
|
32
32
|
# model, so it cannot price Fable distinctly from Opus/Sonnet under "claude".
|
|
33
33
|
# It is intentionally NOT refactored for the fable change: this table is an
|
|
34
34
|
# ESTIMATE-ONLY fallback for context-window projections. The authoritative
|
|
@@ -43,26 +43,11 @@ PRICING_BY_PROVIDER = {
|
|
|
43
43
|
"cache_read": 0.10,
|
|
44
44
|
"cache_creation": 2.5,
|
|
45
45
|
},
|
|
46
|
-
"codex": {
|
|
47
|
-
"input": 2.0,
|
|
48
|
-
"output": 8.0,
|
|
49
|
-
"cache_read": 0.0,
|
|
50
|
-
"cache_creation": 0.0,
|
|
51
|
-
},
|
|
52
|
-
"gemini": {
|
|
53
|
-
"input": 1.25,
|
|
54
|
-
"output": 5.0,
|
|
55
|
-
"cache_read": 0.0,
|
|
56
|
-
"cache_creation": 0.0,
|
|
57
|
-
},
|
|
58
46
|
}
|
|
59
47
|
|
|
60
48
|
# Last-resort window for providers whose models carry no context_window in
|
|
61
49
|
# providers/model_catalog.json (the catalog owns Claude model capacity).
|
|
62
|
-
FALLBACK_WINDOW_SIZES = {
|
|
63
|
-
"codex": 200000,
|
|
64
|
-
"gemini": 1000000,
|
|
65
|
-
}
|
|
50
|
+
FALLBACK_WINDOW_SIZES = {}
|
|
66
51
|
DEFAULT_WINDOW_SIZE = 200000
|
|
67
52
|
CATALOG_PATH = Path(__file__).resolve().parent.parent / "providers" / "model_catalog.json"
|
|
68
53
|
|
|
@@ -116,7 +101,7 @@ def find_session_file(provider, session_file_arg=None):
|
|
|
116
101
|
"""Find the most recently modified session file for the given provider.
|
|
117
102
|
|
|
118
103
|
Args:
|
|
119
|
-
provider: 'claude'
|
|
104
|
+
provider: 'claude' or 'opencode'
|
|
120
105
|
session_file_arg: explicit path from --session-file flag
|
|
121
106
|
|
|
122
107
|
Returns:
|
|
@@ -141,7 +126,7 @@ def find_session_file(provider, session_file_arg=None):
|
|
|
141
126
|
jsonl_files = sorted(session_dir.glob("*.jsonl"), key=lambda p: p.stat().st_mtime, reverse=True)
|
|
142
127
|
return jsonl_files[0] if jsonl_files else None
|
|
143
128
|
|
|
144
|
-
# For
|
|
129
|
+
# For opencode, no standard session file location yet
|
|
145
130
|
# They rely on --tokens-input/--tokens-output args instead
|
|
146
131
|
return None
|
|
147
132
|
|
|
@@ -249,7 +234,7 @@ def update_tracking(loki_dir, iteration, window_size, provider="claude", model=N
|
|
|
249
234
|
iteration: Current RARV iteration number
|
|
250
235
|
window_size: Context window size in tokens (0 = resolve from the catalog)
|
|
251
236
|
model: Run model id used to look up the window (default: model seen in the session)
|
|
252
|
-
provider: Provider name (claude,
|
|
237
|
+
provider: Provider name (claude, opencode)
|
|
253
238
|
session_file: Explicit path to session file (optional)
|
|
254
239
|
direct_tokens: Dict with input/output token counts for non-Claude providers
|
|
255
240
|
"""
|
|
@@ -403,8 +388,8 @@ def main():
|
|
|
403
388
|
parser.add_argument("--loki-dir", default=".loki", help="Path to .loki directory")
|
|
404
389
|
parser.add_argument("--window-size", type=int, default=0,
|
|
405
390
|
help="Context window size in tokens (0 = auto-detect from provider)")
|
|
406
|
-
parser.add_argument("--provider", default="claude", choices=["claude", "
|
|
407
|
-
help="LLM provider (claude,
|
|
391
|
+
parser.add_argument("--provider", default="claude", choices=["claude", "opencode"],
|
|
392
|
+
help="LLM provider (claude, opencode)")
|
|
408
393
|
parser.add_argument("--model", default=None,
|
|
409
394
|
help="Run model id for the catalog window lookup (default: model seen in the session)")
|
|
410
395
|
parser.add_argument("--session-file", default=None,
|
package/autonomy/council-v2.sh
CHANGED
|
@@ -494,34 +494,6 @@ except Exception:
|
|
|
494
494
|
result='{"verdict":"INCONCLUSIVE","justification":"reviewer CLI unavailable (no verdict obtained; NOT a rejection)","issues":[]}'
|
|
495
495
|
fi
|
|
496
496
|
;;
|
|
497
|
-
codex)
|
|
498
|
-
if command -v codex &>/dev/null; then
|
|
499
|
-
result=$(codex exec -q "$full_prompt" 2>/dev/null || echo '{"verdict":"INCONCLUSIVE","justification":"review execution failed (no verdict obtained; NOT a rejection)","issues":[]}')
|
|
500
|
-
else
|
|
501
|
-
result='{"verdict":"INCONCLUSIVE","justification":"reviewer CLI unavailable (no verdict obtained; NOT a rejection)","issues":[]}'
|
|
502
|
-
fi
|
|
503
|
-
;;
|
|
504
|
-
gemini)
|
|
505
|
-
if command -v gemini &>/dev/null; then
|
|
506
|
-
result=$(echo "$full_prompt" | gemini 2>/dev/null || echo '{"verdict":"INCONCLUSIVE","justification":"review execution failed (no verdict obtained; NOT a rejection)","issues":[]}')
|
|
507
|
-
else
|
|
508
|
-
result='{"verdict":"INCONCLUSIVE","justification":"reviewer CLI unavailable (no verdict obtained; NOT a rejection)","issues":[]}'
|
|
509
|
-
fi
|
|
510
|
-
;;
|
|
511
|
-
cline)
|
|
512
|
-
if command -v cline &>/dev/null; then
|
|
513
|
-
result=$(cline -y "$full_prompt" 2>/dev/null || echo '{"verdict":"INCONCLUSIVE","justification":"review execution failed (no verdict obtained; NOT a rejection)","issues":[]}')
|
|
514
|
-
else
|
|
515
|
-
result='{"verdict":"INCONCLUSIVE","justification":"reviewer CLI unavailable (no verdict obtained; NOT a rejection)","issues":[]}'
|
|
516
|
-
fi
|
|
517
|
-
;;
|
|
518
|
-
aider)
|
|
519
|
-
if command -v aider &>/dev/null; then
|
|
520
|
-
result=$(aider --message "$full_prompt" --yes-always --no-auto-commits --no-git 2>/dev/null || echo '{"verdict":"INCONCLUSIVE","justification":"review execution failed (no verdict obtained; NOT a rejection)","issues":[]}')
|
|
521
|
-
else
|
|
522
|
-
result='{"verdict":"INCONCLUSIVE","justification":"reviewer CLI unavailable (no verdict obtained; NOT a rejection)","issues":[]}'
|
|
523
|
-
fi
|
|
524
|
-
;;
|
|
525
497
|
*)
|
|
526
498
|
# v8.2.0 TIMEOUT SEAM. A provider exposing provider_invoke_argv gets
|
|
527
499
|
# a real reviewer instead of an automatic INCONCLUSIVE. The argv is a
|
package/autonomy/grill.sh
CHANGED
|
@@ -151,12 +151,6 @@ grill_check_provider() {
|
|
|
151
151
|
return $GRILL_EXIT_ERROR
|
|
152
152
|
fi
|
|
153
153
|
;;
|
|
154
|
-
codex)
|
|
155
|
-
if ! command -v codex >/dev/null 2>&1; then
|
|
156
|
-
_grill_err "Codex CLI not found."
|
|
157
|
-
return $GRILL_EXIT_ERROR
|
|
158
|
-
fi
|
|
159
|
-
;;
|
|
160
154
|
*)
|
|
161
155
|
# v8.2.0: capability, not identity. Must stay in lockstep with the
|
|
162
156
|
# matching arm in grill_invoke_provider -- this gate runs FIRST, so
|
|
@@ -164,7 +158,7 @@ grill_check_provider() {
|
|
|
164
158
|
if type provider_invoke_argv >/dev/null 2>&1; then
|
|
165
159
|
return 0
|
|
166
160
|
fi
|
|
167
|
-
_grill_err "grill currently supports the claude
|
|
161
|
+
_grill_err "grill currently supports the claude provider (got: $provider)"
|
|
168
162
|
return $GRILL_EXIT_ERROR
|
|
169
163
|
;;
|
|
170
164
|
esac
|
|
@@ -299,22 +293,6 @@ sys.stdout.write(str(d.get("result", "")) if isinstance(d, dict) else raw)' 2>/d
|
|
|
299
293
|
printf '%s\n' "$out"
|
|
300
294
|
return 0
|
|
301
295
|
;;
|
|
302
|
-
codex)
|
|
303
|
-
if ! command -v codex >/dev/null 2>&1; then
|
|
304
|
-
_grill_err "Codex CLI not found."
|
|
305
|
-
return $GRILL_EXIT_ERROR
|
|
306
|
-
fi
|
|
307
|
-
local out
|
|
308
|
-
local _cx_extra=()
|
|
309
|
-
[ "$role" = "check_author" ] && _cx_extra=(--skip-git-repo-check)
|
|
310
|
-
out="$(printf '%s' "$prompt" | _grill_with_timeout "${LOKI_GRILL_TIMEOUT:-180}" codex exec --sandbox workspace-write ${_cx_extra[@]+"${_cx_extra[@]}"} - 2>/dev/null)"
|
|
311
|
-
if [ -z "$out" ]; then
|
|
312
|
-
_grill_err "provider returned no output"
|
|
313
|
-
return $GRILL_EXIT_ERROR
|
|
314
|
-
fi
|
|
315
|
-
printf '%s\n' "$out"
|
|
316
|
-
return 0
|
|
317
|
-
;;
|
|
318
296
|
*)
|
|
319
297
|
# v8.2.0 TIMEOUT SEAM. Previously any other provider was a hard
|
|
320
298
|
# error. A provider exposing provider_invoke_argv builds a REAL argv
|
|
@@ -342,7 +320,7 @@ sys.stdout.write(str(d.get("result", "")) if isinstance(d, dict) else raw)' 2>/d
|
|
|
342
320
|
printf '%s\n' "$out"
|
|
343
321
|
return 0
|
|
344
322
|
fi
|
|
345
|
-
_grill_err "grill currently supports the claude
|
|
323
|
+
_grill_err "grill currently supports the claude provider (got: $provider)"
|
|
346
324
|
return $GRILL_EXIT_ERROR
|
|
347
325
|
;;
|
|
348
326
|
esac
|
|
@@ -377,7 +355,7 @@ OPTIONS:
|
|
|
377
355
|
-h, --help Show this help.
|
|
378
356
|
|
|
379
357
|
ENVIRONMENT:
|
|
380
|
-
LOKI_PROVIDER Provider to use (claude default;
|
|
358
|
+
LOKI_PROVIDER Provider to use (claude default; opencode via provider_invoke_argv).
|
|
381
359
|
LOKI_GRILL_MODEL Claude model for the interrogation (default: sonnet).
|
|
382
360
|
LOKI_GRILL_TIMEOUT Per-invocation timeout in seconds (default: 180).
|
|
383
361
|
|
package/autonomy/lib/chat.sh
CHANGED
|
@@ -58,7 +58,7 @@ Loki chat commands:
|
|
|
58
58
|
/verify [path] [--max-age 7d] loki verify (a receipt path, group receipt, or age limit)
|
|
59
59
|
/receipt loki receipt
|
|
60
60
|
/model <id> set model for this session
|
|
61
|
-
/provider <name> switch provider (claude,
|
|
61
|
+
/provider <name> switch provider (claude, opencode)
|
|
62
62
|
/cost loki cost
|
|
63
63
|
/merge <args> loki merge (pr <pr>, watch <pr> to repair red CI, run, list)
|
|
64
64
|
/diff git diff --stat plus diff
|
|
@@ -346,10 +346,7 @@ _chat_send() {
|
|
|
346
346
|
source "${_LOKI_SCRIPT_DIR:-.}/../providers/loader.sh" 2>/dev/null || exit 1
|
|
347
347
|
load_provider "$_CHAT_PROVIDER" >/dev/null 2>&1 || { _chat_load_fail "$_CHAT_PROVIDER"; exit 1; }
|
|
348
348
|
case "$_CHAT_PROVIDER" in
|
|
349
|
-
codex) codex exec --sandbox read-only --skip-git-repo-check "$prompt" < /dev/null ;;
|
|
350
349
|
opencode) opencode run --agent plan --model "$PROVIDER_MODEL_DEVELOPMENT" "$prompt" < /dev/null ;;
|
|
351
|
-
aider) aider --message "$prompt" --yes-always --no-auto-commits --dry-run --model "$AIDER_DEFAULT_MODEL" < /dev/null 2>&1 ;;
|
|
352
|
-
cline) cline --plan "$prompt" < /dev/null ;;
|
|
353
350
|
*) provider_invoke "$prompt" ;;
|
|
354
351
|
esac
|
|
355
352
|
) || rc=$?
|
|
@@ -554,8 +551,8 @@ Question: $line" || true
|
|
|
554
551
|
if [ -n "$rest" ]; then _CHAT_MODEL="$rest"; echo "model: $rest"; else echo "model: ${_CHAT_MODEL:-default}"; fi ;;
|
|
555
552
|
/provider)
|
|
556
553
|
case "$rest" in
|
|
557
|
-
claude|
|
|
558
|
-
*) echo "usage: /provider claude|
|
|
554
|
+
claude|opencode) _CHAT_PROVIDER="$rest"; _CHAT_STARTED=0; echo "provider: $rest" ;;
|
|
555
|
+
*) echo "usage: /provider claude|opencode (now: $_CHAT_PROVIDER)" ;;
|
|
559
556
|
esac ;;
|
|
560
557
|
*)
|
|
561
558
|
local _sg; _sg="$(_chat_suggest "$cmd")"
|
|
@@ -527,7 +527,7 @@ loki_ultrareview_enabled() {
|
|
|
527
527
|
# fan out into many background subagents. They are triggered by the `ultracode`
|
|
528
528
|
# keyword in a prompt and fire under `claude -p` (verified empirically: a headless
|
|
529
529
|
# workflow returned "The workflow finished"). They are:
|
|
530
|
-
# - Claude-PROVIDER-ONLY (no
|
|
530
|
+
# - Claude-PROVIDER-ONLY (no opencode equivalent),
|
|
531
531
|
# - require claude CLI >= 2.1.154,
|
|
532
532
|
# - cost meaningfully MORE than a normal run (a trivial workflow observed at
|
|
533
533
|
# ~$0.71 vs ~$0.01 for a plain read; there is NO price API so we never quote
|