triss-coworker 0.27.0 → 0.28.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/CHANGELOG.md +35 -0
- package/README.md +48 -19
- package/bin/triss.js +7 -6
- package/docs/coder-model-management-plan.md +18 -2
- package/docs/configuration.md +20 -17
- package/docs/glm-clients.md +23 -17
- package/docs/mcp.md +11 -9
- package/docs/opencode-go-support-plan.md +145 -0
- package/docs/opencode-go.md +112 -0
- package/docs/opencode-zen.md +4 -0
- package/package.json +2 -2
- package/src/coder-models.js +201 -64
- package/src/commands/coder-models.js +18 -7
- package/src/commands/coder.js +309 -74
- package/src/commands/status.js +1 -1
- package/src/mcp/handlers.js +1 -1
- package/src/mcp/tools.js +3 -3
- package/src/opencode-catalogue.js +16 -0
- package/templates/claude-full.md +9 -5
- package/templates/claude.md +5 -1
- package/templates/codex-full.md +5 -1
- package/templates/codex.md +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.28.0] — 2026-08-06
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **OpenCode Go as a first-class coder provider.** `triss coder init`, model
|
|
15
|
+
discovery and switching, coder runs, status/MCP surfaces, help, and generated
|
|
16
|
+
agent guidance now support paid `opencode-go/*` models through the shared
|
|
17
|
+
`OPENCODE_API_KEY`. Zen and Go remain separate provider identities, and
|
|
18
|
+
`opencode-go/deepseek-v4-flash` is preferred when the authenticated Go
|
|
19
|
+
catalogue offers it.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Agent review guidance now recommends at least 16,384 output tokens for
|
|
24
|
+
full-diff reviews, including generated Triss initialization instructions.
|
|
25
|
+
- OpenCode Go setup fails closed on authentication/authorization failures,
|
|
26
|
+
invalid or authoritative-empty catalogues, and non-retryable HTTP responses.
|
|
27
|
+
An unverified built-in fallback is available only through an explicit
|
|
28
|
+
`--allow-unverified` opt-in for transport and retryable provider failures.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Model recovery retains executable commands for Z.AI, Moonshot, and Kimi for
|
|
33
|
+
Coding providers that intentionally expose no catalogue API, while rejecting
|
|
34
|
+
missing or cross-provider model pairs and never fabricating recovery commands
|
|
35
|
+
for failed catalogue verification.
|
|
36
|
+
|
|
37
|
+
## [0.27.1] — 2026-08-05
|
|
38
|
+
|
|
39
|
+
### Security
|
|
40
|
+
|
|
41
|
+
- Raise the minimum MCP SDK to 1.30.0 and refresh its Hono/Ajv transitive
|
|
42
|
+
dependencies, plus ESLint's brace expansion dependency, to patched versions.
|
|
43
|
+
A clean install now reports zero known npm audit vulnerabilities.
|
|
44
|
+
|
|
10
45
|
## [0.27.0] — 2026-08-05
|
|
11
46
|
|
|
12
47
|
### Added
|
package/README.md
CHANGED
|
@@ -237,7 +237,7 @@ The exposed tool set is **filtered by configured credentials**:
|
|
|
237
237
|
- **`triss_github_*`** when `GITHUB_TOKEN` is set (or `gh` CLI logged in).
|
|
238
238
|
- **`triss_gitlab_*`** when `GITLAB_TOKEN` is set.
|
|
239
239
|
- **`triss_coder_run` + `triss_coder_status`** when any coder provider key is
|
|
240
|
-
set — `ZHIPU_API_KEY` (Z.AI GLM), `OPENCODE_API_KEY` (OpenCode Zen),
|
|
240
|
+
set — `ZHIPU_API_KEY` (Z.AI GLM), `OPENCODE_API_KEY` (OpenCode Zen or Go),
|
|
241
241
|
`MOONSHOT_API_KEY` (Moonshot Kimi), or `KIMI_API_KEY` (Kimi for Coding)
|
|
242
242
|
(setup: `triss coder init`). `triss_coder_run` takes an optional `engine`
|
|
243
243
|
(`opencode` default, or `crush`); its timeout defaults to
|
|
@@ -271,8 +271,8 @@ and writing**.
|
|
|
271
271
|
| `triss review` | Code review on current branch or a PR (diff + linked ticket) | The agent reading the whole diff |
|
|
272
272
|
| `triss commit-msg` | Generates a commit message from staged diff | Hand-writing or copy-pasting from web LLMs |
|
|
273
273
|
| `triss usage` | Cumulative cost / token usage with per-project breakdown | Squinting at stderr after each call |
|
|
274
|
-
| `triss coder init` | Sets up a coding agent (default `opencode` engine; `--engine crush` for crush): provider key (Z.AI GLM default; `--provider opencode-zen` for free rotating
|
|
275
|
-
| `triss coder run` | Spawns the coding agent (GLM, Kimi,
|
|
274
|
+
| `triss coder init` | Sets up a coding agent (default `opencode` engine; `--engine crush` for crush): provider key (Z.AI GLM default; `--provider opencode-zen` for free rotating Zen models; `--provider opencode-go` for the paid OpenCode Go subscription; `--provider moonshot` / `kimi-for-coding` for Kimi), config, permission policy, and agent templates. Blocks (non-zero) on an unsafe existing `opencode.json` — missing deny-first bash policy (override with `--allow-unsafe-bash`) or a stale/cross-provider `small_model`. | Manually installing/configuring opencode |
|
|
275
|
+
| `triss coder run` | Spawns the coding agent (GLM, Kimi, OpenCode Zen, or OpenCode Go) and prints one JSON envelope (`--engine opencode\|crush`; `--isolate` for a disposable worktree — opencode defaults to isolate-OFF, crush defaults to isolate-ON; crush adds opt-in `--restrict`/`--no-restrict` for its CLI allowlist). **POSIX only** (macOS/Linux) — refuses to run on Windows. | Manually driving `opencode run` and parsing its ndjson stream |
|
|
276
276
|
| `triss coder clean` | Removes finished `.triss/wt` isolation worktrees (`--all` forces all) | Manually finding and deleting stale git worktrees |
|
|
277
277
|
| `triss init` | Drops a tiny (~15 line) delegation block into `CLAUDE.md` / `AGENTS.md` | Hand-writing routing rules |
|
|
278
278
|
| `triss agent-help` | Prints the full delegation cookbook on demand (the nano block points here) | A 200-line CLAUDE.md that always loads |
|
|
@@ -415,7 +415,10 @@ triss review --provider kimi # …or Kimi (pro preset = kimi-k3)
|
|
|
415
415
|
|
|
416
416
|
Defaults to the `pro` preset because review needs reasoning. Output is
|
|
417
417
|
a list of concrete issues with file:line citations — not a diff
|
|
418
|
-
summary.
|
|
418
|
+
summary. GLM 5.2 reviews should use at least `--max-tokens 16384`; the generic
|
|
419
|
+
8192-token default can be consumed by reasoning and return an empty verdict,
|
|
420
|
+
especially on large diffs. Narrow the base/scope as well when only a remediation
|
|
421
|
+
commit needs review. Cost: a 25KB diff review on `pro` runs ~$0.005-0.01 with
|
|
419
422
|
prompt caching.
|
|
420
423
|
|
|
421
424
|
Example shape:
|
|
@@ -450,8 +453,8 @@ default timeout, configurable via `--timeout <ms>`.
|
|
|
450
453
|
|
|
451
454
|
### `triss coder`
|
|
452
455
|
|
|
453
|
-
Delegates an implementation task to a cheap coding agent — GLM, Kimi,
|
|
454
|
-
OpenCode Zen models (the `opencode` engine by default; `crush` is an
|
|
456
|
+
Delegates an implementation task to a cheap coding agent — GLM, Kimi,
|
|
457
|
+
OpenCode Zen, or OpenCode Go models (the `opencode` engine by default; `crush` is an
|
|
455
458
|
alternative — see **Engines** below) instead of the primary model writing
|
|
456
459
|
the code itself.
|
|
457
460
|
|
|
@@ -465,17 +468,20 @@ triss coder clean # remove finished isolation wo
|
|
|
465
468
|
|
|
466
469
|
`triss coder init` first asks which provider to configure — **Z.AI GLM**
|
|
467
470
|
(default), **OpenCode Zen** (`--provider opencode-zen`, free rotating
|
|
468
|
-
models), **
|
|
471
|
+
models), **OpenCode Go** (`--provider opencode-go`, paid subscription),
|
|
472
|
+
**Moonshot Kimi** (`--provider moonshot`, pay-as-you-go
|
|
469
473
|
`moonshotai/*` models like `kimi-k2.7-code`), or **Kimi for Coding**
|
|
470
474
|
(`--provider kimi-for-coding`, the flat-rate subscription serving Kimi K3).
|
|
471
475
|
For Z.AI it probes which plan your key works with (subscription vs.
|
|
472
|
-
pay-as-you-go) and writes the matching model prefix;
|
|
473
|
-
`OPENCODE_API_KEY`
|
|
476
|
+
pay-as-you-go) and writes the matching model prefix; Zen and Go share
|
|
477
|
+
`OPENCODE_API_KEY` but use distinct `opencode/<id>` and `opencode-go/<id>`
|
|
478
|
+
catalogues; the two Kimi
|
|
474
479
|
providers need no probe at all — their plans use different keys
|
|
475
480
|
(`MOONSHOT_API_KEY` vs `KIMI_API_KEY`), so the choice already names the
|
|
476
481
|
endpoint. Either way it lets you pick the model interactively. See the
|
|
477
482
|
**Providers** section below and
|
|
478
|
-
[docs/opencode-zen.md](docs/opencode-zen.md)
|
|
483
|
+
[docs/opencode-zen.md](docs/opencode-zen.md) and
|
|
484
|
+
[docs/opencode-go.md](docs/opencode-go.md) for the OpenCode provider deep-dives.
|
|
479
485
|
|
|
480
486
|
Prints one JSON envelope to stdout — `files_changed`, `diff_stat`, and
|
|
481
487
|
`worktree` tell you what to review; `--isolate` runs the agent in a
|
|
@@ -503,13 +509,14 @@ each entry. Override per-run with `--restrict` / `--no-restrict` (resolution:
|
|
|
503
509
|
CLI flag > env > crush.json `permissions.run.restrict` > default OFF). For
|
|
504
510
|
Z.AI GLM, both engines share the single `ZHIPU_API_KEY` (crush ≥0.1.1 reads it
|
|
505
511
|
natively; triss also forwards it as `ZAI_API_KEY` for older binaries; see
|
|
506
|
-
**Providers** below for the opencode-only OpenCode
|
|
512
|
+
**Providers** below for the opencode-only OpenCode alternatives). See
|
|
507
513
|
`docs/crush-restrict-issues.md` for the live-verified bug facts.
|
|
508
514
|
|
|
509
515
|
**Providers** — the `opencode` engine isn't limited to Z.AI. The required
|
|
510
516
|
API key follows the model's `<provider>/` prefix: `zai-coding-plan/*` and
|
|
511
517
|
`zai/*` (GLM) use `ZHIPU_API_KEY`; `opencode/*` models — served free by
|
|
512
|
-
[OpenCode Zen](https://opencode.ai/docs/zen/) —
|
|
518
|
+
[OpenCode Zen](https://opencode.ai/docs/zen/) — and paid `opencode-go/*`
|
|
519
|
+
models use the shared `OPENCODE_API_KEY`;
|
|
513
520
|
`moonshotai/*` (and the China-mainland `moonshotai-cn/*`) Kimi models use
|
|
514
521
|
`MOONSHOT_API_KEY`; and `kimi-for-coding/*` models — the flat-rate
|
|
515
522
|
[Kimi for Coding](https://www.kimi.com/code/docs/en/) subscription, e.g.
|
|
@@ -522,6 +529,22 @@ triss coder models --provider opencode-zen # see live Zen ids
|
|
|
522
529
|
triss coder run "..." --model opencode/<current-id> # per-run override
|
|
523
530
|
```
|
|
524
531
|
|
|
532
|
+
OpenCode Go uses a separate paid catalogue and prefix despite sharing the key:
|
|
533
|
+
|
|
534
|
+
```bash
|
|
535
|
+
triss coder init --provider opencode-go
|
|
536
|
+
triss coder models --provider opencode-go
|
|
537
|
+
triss coder run "..." --model opencode-go/deepseek-v4-flash
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
A configured key does not by itself prove that the Go subscription or the
|
|
541
|
+
workspace regional-hosting opt-in is active. Triss leaves those account
|
|
542
|
+
settings untouched and reports inference-time provider errors verbatim. Go
|
|
543
|
+
init fails closed on 401/403, malformed responses, and an authoritative empty
|
|
544
|
+
catalogue. Temporary network or HTTP 408/429/500/502/503/504 failures require an explicit
|
|
545
|
+
`triss coder init --provider opencode-go --allow-unverified --global` (or
|
|
546
|
+
`--local`) before Triss will use its built-in Go fallback.
|
|
547
|
+
|
|
525
548
|
Kimi works the same way:
|
|
526
549
|
|
|
527
550
|
```bash
|
|
@@ -533,7 +556,7 @@ triss coder run "..." --model kimi-for-coding/k3
|
|
|
533
556
|
```
|
|
534
557
|
|
|
535
558
|
`triss coder run` passes the resolved model to opencode with `--model` and
|
|
536
|
-
forwards only the key that model needs — no Z.AI key is required for Zen or
|
|
559
|
+
forwards only the key that model needs — no Z.AI key is required for Zen, Go, or
|
|
537
560
|
Kimi runs. A shell-exported `TRISS_CODER_MODEL` is a runtime override of the
|
|
538
561
|
MAIN model only (it sits in the OpenCode-main precedence chain: one-run `--model`
|
|
539
562
|
→ shell `TRISS_CODER_MODEL` → project `.triss.env` → global `.env` → built-in
|
|
@@ -543,7 +566,7 @@ default), so it changes the main model for every run until unset.
|
|
|
543
566
|
`small_model` from `opencode.json`); use `--model` for a one-run main-model
|
|
544
567
|
override. The deny-first `opencode.json` bash policy applies to every provider.
|
|
545
568
|
Full details, the model catalogue, and every configuration path are in
|
|
546
|
-
[docs/opencode-zen.md](docs/opencode-zen.md).
|
|
569
|
+
[docs/opencode-zen.md](docs/opencode-zen.md) and [docs/opencode-go.md](docs/opencode-go.md).
|
|
547
570
|
|
|
548
571
|
If your Z.AI plan hits its usage limit, `triss coder run` fails fast with
|
|
549
572
|
the reset time converted to your local timezone (Z.AI reports it in
|
|
@@ -558,19 +581,19 @@ confusion is conflating them:
|
|
|
558
581
|
- **Engine** = *how* the agent is launched: `opencode` (default) or
|
|
559
582
|
`crush`. Set at `triss coder init --engine …` or per run with
|
|
560
583
|
`triss coder run --engine …`.
|
|
561
|
-
- **Provider** = *which* API serves the model: Z.AI GLM, OpenCode Zen,
|
|
584
|
+
- **Provider** = *which* API serves the model: Z.AI GLM, OpenCode Zen, OpenCode Go,
|
|
562
585
|
Moonshot Kimi, Kimi for Coding. Set at `triss coder init --provider …`.
|
|
563
586
|
|
|
564
587
|
Not every engine speaks every provider:
|
|
565
588
|
|
|
566
589
|
| Engine | Providers served |
|
|
567
590
|
| ---------- | ------------------------------------------------- |
|
|
568
|
-
| `opencode` | Z.AI GLM, OpenCode Zen, Moonshot, Kimi for Coding |
|
|
591
|
+
| `opencode` | Z.AI GLM, OpenCode Zen, OpenCode Go, Moonshot, Kimi for Coding |
|
|
569
592
|
| `crush` | Z.AI GLM (coding-plan only) |
|
|
570
593
|
|
|
571
594
|
`triss coder init` drives setup in that order — **engine, then provider,
|
|
572
595
|
then it asks for only that provider's credential** and writes the matching
|
|
573
|
-
model prefix (`opencode/<id>`, `zai-coding-plan/*`, `moonshotai/*`, or
|
|
596
|
+
model prefix (`opencode/<id>`, `opencode-go/<id>`, `zai-coding-plan/*`, `moonshotai/*`, or
|
|
574
597
|
`kimi-for-coding/*`).
|
|
575
598
|
|
|
576
599
|
**Choosing a model.** `--model` on `triss coder run` is a
|
|
@@ -596,6 +619,7 @@ machine-readable form:
|
|
|
596
619
|
triss coder models # current effective engine/provider
|
|
597
620
|
triss coder models --engine opencode # resolved provider for the OpenCode engine
|
|
598
621
|
triss coder models --provider opencode-zen # just OpenCode Zen
|
|
622
|
+
triss coder models --provider opencode-go # paid OpenCode Go catalogue
|
|
599
623
|
triss coder models --json # for scripting
|
|
600
624
|
```
|
|
601
625
|
|
|
@@ -616,7 +640,7 @@ to GLM.
|
|
|
616
640
|
|
|
617
641
|
Full flag reference, the model catalogues, key/endpoint routing, and
|
|
618
642
|
the stale-model recovery flow are in [docs/glm-clients.md](docs/glm-clients.md),
|
|
619
|
-
[docs/opencode-zen.md](docs/opencode-zen.md), and
|
|
643
|
+
[docs/opencode-zen.md](docs/opencode-zen.md), [docs/opencode-go.md](docs/opencode-go.md), and
|
|
620
644
|
[docs/configuration.md](docs/configuration.md).
|
|
621
645
|
|
|
622
646
|
## Integrations
|
|
@@ -694,12 +718,17 @@ invoking the agentic `coder` runtime:
|
|
|
694
718
|
|
|
695
719
|
```bash
|
|
696
720
|
triss ask --paths ... --question "..." --provider glm --model flash
|
|
697
|
-
triss review --provider glm --model pro
|
|
721
|
+
triss review --provider glm --model pro --max-tokens 16384
|
|
698
722
|
triss review --provider glm --model zai/glm-5.2 # pay-as-you-go endpoint
|
|
699
723
|
triss review --provider kimi # pro preset → kimi-k3
|
|
700
724
|
triss ask --paths ... --question "..." --provider kimi --model flash # kimi-k2.6
|
|
701
725
|
```
|
|
702
726
|
|
|
727
|
+
Use `--max-tokens 16384` as the minimum for GLM 5.2 code review. With the
|
|
728
|
+
generic 8192-token default, internal reasoning can exhaust the budget and leave
|
|
729
|
+
no review verdict; for a large PR, also narrow `--base` to the change that needs
|
|
730
|
+
re-review.
|
|
731
|
+
|
|
703
732
|
One-shot `ask` / `review` output is provider-shape tolerant: Triss emits the
|
|
704
733
|
assistant text whether the successful response carries OpenAI-style
|
|
705
734
|
`choices[0].message.content` or a top-level `final_text`. A present
|
package/bin/triss.js
CHANGED
|
@@ -183,7 +183,7 @@ config
|
|
|
183
183
|
.option('--standard', 'API key + one model only — skip the standard/advanced prompt')
|
|
184
184
|
.option('--advanced', 'full wizard with presets, base URL, integrations — skip the prompt')
|
|
185
185
|
.option('--coder-engine <name>', 'coder target only: coding engine to configure (opencode default, or crush). `coder init` uses --engine')
|
|
186
|
-
.option('--coder-provider <name>', 'coder target only: opencode engine provider (zai, opencode-zen, moonshot, kimi-for-coding). `coder init` uses --provider')
|
|
186
|
+
.option('--coder-provider <name>', 'coder target only: opencode engine provider (zai, opencode-zen, opencode-go, moonshot, kimi-for-coding). `coder init` uses --provider')
|
|
187
187
|
.action(wrap(runWizard));
|
|
188
188
|
|
|
189
189
|
config
|
|
@@ -238,13 +238,14 @@ coder
|
|
|
238
238
|
.option('-g, --global', 'save to the global scope (~/.config/triss/.env, ~/.config/opencode/)')
|
|
239
239
|
.option('-l, --local', 'save to the project scope (./.triss.env, ./opencode.json)')
|
|
240
240
|
.option('--engine <name>', 'coding engine to configure: opencode (default) or crush')
|
|
241
|
-
.option('--provider <name>', 'opencode engine model provider: zai (Z.AI GLM, default), opencode-zen (free rotating models
|
|
241
|
+
.option('--provider <name>', 'opencode engine model provider: zai (Z.AI GLM, default), opencode-zen (free rotating models), opencode-go (paid Go subscription), moonshot (Kimi pay-as-you-go), or kimi-for-coding (subscription)')
|
|
242
|
+
.option('--allow-unverified', 'requires explicit --provider opencode-go (alias: go): allow the built-in fallback only after a temporary network or HTTP 408/429/500/502/503/504 catalogue failure (never bypasses 401/403, empty, or invalid responses)')
|
|
242
243
|
.option('--allow-unsafe-bash', 'proceed even if an existing opencode.json has no deny-first bash policy (the agent runs with --auto)')
|
|
243
244
|
.action(wrap(runCoderInit));
|
|
244
245
|
|
|
245
246
|
coder
|
|
246
247
|
.command('run [prompt]')
|
|
247
|
-
.description('Spawn a coding agent — GLM, Kimi,
|
|
248
|
+
.description('Spawn a coding agent — GLM, Kimi, OpenCode Zen, or OpenCode Go models (opencode default, or --engine crush) — and print a JSON envelope to stdout')
|
|
248
249
|
.option('--engine <name>', 'coding engine: opencode (default) or crush')
|
|
249
250
|
.option('--session <id>', 'triss-side session slug, mapped to a real opencode session id in .triss/sessions.json')
|
|
250
251
|
.option('--continue', 'continue the most recent opencode session (maps to opencode --continue)')
|
|
@@ -273,7 +274,7 @@ coder
|
|
|
273
274
|
' • opencode: project opencode.json (local) or ~/.config/opencode/opencode.json (global)\n' +
|
|
274
275
|
' • crush: ./.crush/crush.json (local) or ~/.local/share/crush/crush.json (global)')
|
|
275
276
|
.option('--engine <name>', 'coding engine: opencode (default) or crush')
|
|
276
|
-
.option('--provider <name>', 'provider kind: zai, opencode-zen, moonshot, or kimi-for-coding')
|
|
277
|
+
.option('--provider <name>', 'provider kind: zai, opencode-zen, opencode-go, moonshot, or kimi-for-coding')
|
|
277
278
|
.option('--json', 'print the stable machine-readable state object (no secrets)')
|
|
278
279
|
.action(wrap(runCoderModels));
|
|
279
280
|
|
|
@@ -295,10 +296,10 @@ coderModel
|
|
|
295
296
|
)
|
|
296
297
|
.option('--small <model>', 'small/fast model id (omit to keep the current compatible value)')
|
|
297
298
|
.option('--engine <name>', 'coding engine: opencode (default) or crush')
|
|
298
|
-
.option('--provider <name>', 'provider kind: zai, opencode-zen, moonshot, or kimi-for-coding')
|
|
299
|
+
.option('--provider <name>', 'provider kind: zai, opencode-zen, opencode-go, moonshot, or kimi-for-coding')
|
|
299
300
|
.option('-g, --global', 'write to the global scope (OpenCode: ~/.config/opencode/opencode.json + global .env; Crush: ~/.local/share/crush/crush.json)')
|
|
300
301
|
.option('-l, --local', 'write to the project scope (OpenCode: ./opencode.json + ./.triss.env; Crush: ./.crush/crush.json)')
|
|
301
|
-
.option('--allow-unverified', '
|
|
302
|
+
.option('--allow-unverified', 'with explicit main + --small, bypass only a provider-defined transient catalogue failure (Go: transport or HTTP 408/429/500/502/503/504; Zen: timeout/http-error/parse-error; never auth or authoritative failure)')
|
|
302
303
|
.option('--allow-unsafe-bash', 'proceed even if the existing opencode.json lacks the deny-first bash policy')
|
|
303
304
|
.option('--yes', 'non-interactive confirmation: apply the planned switch (required to write; without it the plan is printed and nothing is changed)')
|
|
304
305
|
.action((mainModel, opts) => wrap(runCoderModelSet)(mainModel, opts));
|
|
@@ -131,8 +131,11 @@ State definitions are normative:
|
|
|
131
131
|
- `not verified`: the request times out, authentication fails, returns another
|
|
132
132
|
non-2xx response, or returns a payload without a parseable model list.
|
|
133
133
|
|
|
134
|
-
`--allow-unverified` may apply only to
|
|
135
|
-
|
|
134
|
+
`--allow-unverified` may apply only to a provider-defined transient/not-verified
|
|
135
|
+
state; it must never override authentication, authorization, invalid data, an
|
|
136
|
+
authoritative empty catalogue, or an authoritative `unavailable` result. For
|
|
137
|
+
OpenCode Go, the bypassable set is transport plus HTTP
|
|
138
|
+
408/429/500/502/503/504 only.
|
|
136
139
|
`not-supported` is not a failed verification: it means the provider exposes no
|
|
137
140
|
catalogue API. Once credential and local provider/plan-prefix checks pass, a
|
|
138
141
|
switch for that provider proceeds without `--allow-unverified`.
|
|
@@ -208,6 +211,19 @@ even if an environment default currently points to the same engine. This is
|
|
|
208
211
|
intentionally stricter than read-only commands and older setup flows that
|
|
209
212
|
default to OpenCode/global.
|
|
210
213
|
|
|
214
|
+
A catalogue-backed model-set recovery command may be generated only from a
|
|
215
|
+
successful, non-empty response with a verified recommended pair. Authentication
|
|
216
|
+
or authorization failures, an authoritative empty catalogue, invalid data, and
|
|
217
|
+
transient failures produce status-specific guidance only; they must never reuse
|
|
218
|
+
a current role from another provider to fabricate a repair command.
|
|
219
|
+
|
|
220
|
+
For a provider whose catalogue status is `not-supported`, recovery is not
|
|
221
|
+
catalogue-backed: it may reuse only the provider-compatible main and small roles
|
|
222
|
+
already present in the effective config/runtime state. It must not invent a
|
|
223
|
+
recommendation, cross provider prefixes, or suppress an otherwise executable
|
|
224
|
+
repair command merely because that provider intentionally exposes no catalogue
|
|
225
|
+
API.
|
|
226
|
+
|
|
211
227
|
**Help text for `coder model set`** must describe both engines and their exact configuration targets:
|
|
212
228
|
- OpenCode: `opencode.json` at project `.crush/crush.json` or global `~/.local/share/crush/crush.json`
|
|
213
229
|
- Show that OpenCode has two separate main model sources (runtime main from env pins vs config main from `opencode.json.model`)
|
package/docs/configuration.md
CHANGED
|
@@ -130,7 +130,7 @@ Removes a variable.
|
|
|
130
130
|
| `worker` | `TRISS_WORKER_API_KEY`, `TRISS_WORKER_BASE_URL`, `TRISS_WORKER_FLASH_MODEL`, `TRISS_WORKER_PRO_MODEL` | only `TRISS_WORKER_API_KEY` is required |
|
|
131
131
|
| `jira` | `ATLASSIAN_BASE_URL`, `ATLASSIAN_EMAIL`, `ATLASSIAN_API_TOKEN` | all three |
|
|
132
132
|
| `linear` | `LINEAR_API_KEY`, `LINEAR_API_URL` | only `LINEAR_API_KEY` is required |
|
|
133
|
-
| `coder` | `ZHIPU_API_KEY`, `OPENCODE_API_KEY`, `MOONSHOT_API_KEY`, `KIMI_API_KEY` (setup: `triss config wizard coder --coder-engine <engine> --coder-provider <provider>`, or `triss coder init --engine <engine> --provider <provider>`
|
|
133
|
+
| `coder` | `ZHIPU_API_KEY`, `OPENCODE_API_KEY`, `MOONSHOT_API_KEY`, `KIMI_API_KEY` (setup: `triss config wizard coder --coder-engine <engine> --coder-provider <provider>`, or `triss coder init --engine <engine> --provider <provider>`) | the **selected provider's** key — `ZHIPU_API_KEY` (`glm`), shared `OPENCODE_API_KEY` (`opencode-zen` or `opencode-go`), `MOONSHOT_API_KEY` (`moonshot`), `KIMI_API_KEY` (`kimi-for-coding`) |
|
|
134
134
|
|
|
135
135
|
When you add a new integration (see [extending.md](extending.md)), its
|
|
136
136
|
`envVars` declaration is automatically picked up — no wizard changes needed.
|
|
@@ -263,11 +263,11 @@ self-hosted endpoints).
|
|
|
263
263
|
| Variable | Required | Default | Notes |
|
|
264
264
|
| -------------------------------- | -------- | ------------------ | ------------------------------------------ |
|
|
265
265
|
| `ZHIPU_API_KEY` | yes¹ | — | Z.AI API key for `ask`/`review --provider glm` and GLM coder models — <https://z.ai/manage-apikey/apikey-list> |
|
|
266
|
-
| `OPENCODE_API_KEY` | no¹ | — | OpenCode Zen
|
|
266
|
+
| `OPENCODE_API_KEY` | no¹ | — | Shared OpenCode credential for Zen `opencode/*` and paid Go `opencode-go/*` models (opencode engine only). A key alone does not prove Go subscription, quota, or regional readiness. See [opencode-zen.md](opencode-zen.md) and [opencode-go.md](opencode-go.md). |
|
|
267
267
|
| `MOONSHOT_API_KEY` | no¹ | — | Moonshot AI (Kimi) key for `ask`/`review --provider kimi` and `moonshotai/*` coder models — <https://platform.kimi.ai/console/api-keys> |
|
|
268
268
|
| `KIMI_API_KEY` | no¹ | — | Kimi for Coding subscription key (opencode engine only) — unlocks `kimi-for-coding/*` models like `kimi-for-coding/k3` — <https://www.kimi.com/code/docs/en/> |
|
|
269
269
|
| `TRISS_KIMI_BASE_URL` | no | `https://api.moonshot.ai/v1` | Endpoint for `--provider kimi` ask/review calls — set `https://api.moonshot.cn/v1` for a China-mainland key. Trailing slashes are stripped; a blank/degenerate value falls back to the default |
|
|
270
|
-
| `TRISS_CODER_MODEL` | no | `zai-coding-plan/glm-5.2` | Resolved **main** model, passed to opencode via `--model
|
|
270
|
+
| `TRISS_CODER_MODEL` | no | `zai-coding-plan/glm-5.2` | Resolved **main** model, passed to opencode via `--model`. Go uses `opencode-go/<id>`; Zen uses `opencode/<id>`. Main and small must stay within one provider prefix. |
|
|
271
271
|
| `TRISS_CODER_SMALL_MODEL` | no | `zai-coding-plan/glm-5-turbo` | Small/fast **management/init intent** — written to `opencode.json` `small_model` by `init`/`triss coder model set`. **Not** a runtime override of an already-pinned small role (see precedence) |
|
|
272
272
|
| `TRISS_CODER_OPENCODE_VERSION` | no | `1.18.7` | Pin override for the `opencode-ai` npm install |
|
|
273
273
|
| `TRISS_CODER_ENGINE` | no | `opencode` | Coding engine: `opencode` (default) or `crush` |
|
|
@@ -321,22 +321,22 @@ preset models.
|
|
|
321
321
|
|
|
322
322
|
¹ **Credentials are provider-specific.** A run needs the one key its
|
|
323
323
|
resolved model requires: `zai-coding-plan/*` and `zai/*` (GLM) need
|
|
324
|
-
`ZHIPU_API_KEY`; `opencode/*`
|
|
325
|
-
(resolve
|
|
326
|
-
pinned
|
|
324
|
+
`ZHIPU_API_KEY`; `opencode/*` Zen and `opencode-go/*` Go models need `OPENCODE_API_KEY`
|
|
325
|
+
(resolve live ids with `triss coder models`; Zen's free tier rotates, so its
|
|
326
|
+
pinned ids can go stale); `moonshotai/*` and
|
|
327
327
|
`moonshotai-cn/*` Kimi models need `MOONSHOT_API_KEY`; `kimi-for-coding/*`
|
|
328
328
|
subscription models need `KIMI_API_KEY`. So `ZHIPU_API_KEY` is
|
|
329
329
|
"required" only in the sense that it is the default provider's key — a
|
|
330
|
-
|
|
330
|
+
Zen- or Go-only setup runs on `OPENCODE_API_KEY` alone, a Kimi-only setup on its
|
|
331
331
|
Kimi key alone. `triss coder run` forwards
|
|
332
332
|
whichever key the model needs to the engine subprocess and gates on it
|
|
333
333
|
before spawning. The `crush` engine speaks Z.AI only and always needs
|
|
334
334
|
`ZHIPU_API_KEY`. `triss status` / `triss_coder_status` show all provider
|
|
335
335
|
keys, and the coder MCP tools surface once **any** is set. Run
|
|
336
|
-
`triss coder init --provider opencode-zen` (or `--provider moonshot` /
|
|
336
|
+
`triss coder init --provider opencode-zen` / `--provider opencode-go` (or `--provider moonshot` /
|
|
337
337
|
`--provider kimi-for-coding`) to set up a non-GLM model interactively
|
|
338
338
|
(key + `opencode.json`); Zen details are in
|
|
339
|
-
[opencode-zen.md](opencode-zen.md). The two Kimi providers need no
|
|
339
|
+
[opencode-zen.md](opencode-zen.md); Go details are in [opencode-go.md](opencode-go.md). The two Kimi providers need no
|
|
340
340
|
endpoint probe: their plans use different keys, so the provider choice
|
|
341
341
|
already names the endpoint.
|
|
342
342
|
|
|
@@ -429,7 +429,7 @@ fixed order so only the right single key is prompted:
|
|
|
429
429
|
defaulting — give it `--engine` (or export `TRISS_CODER_ENGINE`) to
|
|
430
430
|
proceed unattended.
|
|
431
431
|
2. **Provider** next, *after* the engine and *before* any credential
|
|
432
|
-
prompt: `--provider` (`glm`, `opencode-zen`, `moonshot`,
|
|
432
|
+
prompt: `--provider` (`glm`, `opencode-zen`, `opencode-go`, `moonshot`,
|
|
433
433
|
`kimi-for-coding`) → the engine's default for the keys already set.
|
|
434
434
|
3. Triss then prompts for **only** that provider's key and writes the
|
|
435
435
|
matching `opencode.json`/`crush.json`.
|
|
@@ -475,13 +475,16 @@ binaries. (opencode can alternatively run OpenCode Zen `opencode/*` models on
|
|
|
475
475
|
|
|
476
476
|
**Safety escape hatches.** `--allow-unverified` lets `init` / `triss coder
|
|
477
477
|
model set` pin a model Triss cannot confirm against the live provider
|
|
478
|
-
catalogue, but only within a narrow window
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
478
|
+
catalogue, but only within a narrow window. For OpenCode Go, it accepts only
|
|
479
|
+
transport failures and HTTP 408/429/500/502/503/504; 401, 403, an empty
|
|
480
|
+
catalogue, malformed data, and every other HTTP error remain blocking. For
|
|
481
|
+
legacy Zen model management, the accepted not-verified states remain timeout,
|
|
482
|
+
HTTP error, or parse error. `model set` additionally requires explicit main and
|
|
483
|
+
small models plus the matching credential. The flag never relaxes credential
|
|
484
|
+
checks or an authoritative unavailable result.
|
|
485
|
+
On `coder init`, the flag also requires explicit `--provider opencode-go`
|
|
486
|
+
(alias: `--provider go`) and is rejected before any interactive provider
|
|
487
|
+
selection.
|
|
485
488
|
`--allow-unsafe-bash` does **not** lift or rewrite the bash policy. It
|
|
486
489
|
permits exactly one thing: **model-field repair** of an existing OpenCode
|
|
487
490
|
config that was written *without* the canonical deny-first policy, while
|
package/docs/glm-clients.md
CHANGED
|
@@ -39,7 +39,7 @@ see §3). It **drives a local agent binary** and parses the one JSON
|
|
|
39
39
|
envelope that binary prints. There are two such binaries ("engines"), both
|
|
40
40
|
behind the same adapter interface. crush is always fed `ZHIPU_API_KEY`
|
|
41
41
|
(bridged to `ZAI_API_KEY`); opencode is fed whichever key its resolved model
|
|
42
|
-
needs — `ZHIPU_API_KEY` for GLM, `OPENCODE_API_KEY` for OpenCode Zen (§3),
|
|
42
|
+
needs — `ZHIPU_API_KEY` for GLM, `OPENCODE_API_KEY` for OpenCode Zen or Go (§3),
|
|
43
43
|
`MOONSHOT_API_KEY` for `moonshotai/*` Kimi, `KIMI_API_KEY` for
|
|
44
44
|
`kimi-for-coding/*`.
|
|
45
45
|
|
|
@@ -52,8 +52,8 @@ needs — `ZHIPU_API_KEY` for GLM, `OPENCODE_API_KEY` for OpenCode Zen (§3),
|
|
|
52
52
|
| Select via | default, or `--engine opencode` | `--engine crush` / `TRISS_CODER_ENGINE=crush` |
|
|
53
53
|
| npm package | `opencode-ai` (pinned `1.18.7`) | `@phpcraftdream/crush` (pinned `0.1.6`) |
|
|
54
54
|
| Version pin env | `TRISS_CODER_OPENCODE_VERSION` | `TRISS_CODER_CRUSH_VERSION` |
|
|
55
|
-
| Key it reads | `ZHIPU_API_KEY` (native); `OPENCODE_API_KEY` for `opencode/…` Zen models; `MOONSHOT_API_KEY` for `moonshotai/…`; `KIMI_API_KEY` for `kimi-for-coding/…` | `ZAI_API_KEY` (Triss bridges from `ZHIPU_API_KEY`; crush ≥0.1.1 also reads `ZHIPU_API_KEY` natively) |
|
|
56
|
-
| Providers | Z.AI GLM (`
|
|
55
|
+
| Key it reads | `ZHIPU_API_KEY` (native); shared `OPENCODE_API_KEY` for `opencode/…` Zen and `opencode-go/…` Go models; `MOONSHOT_API_KEY` for `moonshotai/…`; `KIMI_API_KEY` for `kimi-for-coding/…` | `ZAI_API_KEY` (Triss bridges from `ZHIPU_API_KEY`; crush ≥0.1.1 also reads `ZHIPU_API_KEY` natively) |
|
|
56
|
+
| Providers | Z.AI GLM, OpenCode Zen (`opencode/…`; [opencode-zen.md](opencode-zen.md)), OpenCode Go (`opencode-go/…`; [opencode-go.md](opencode-go.md)), and Moonshot Kimi | Z.AI GLM only |
|
|
57
57
|
| Provider config | `opencode.json` with a `zai-coding-plan/…` (or `zai/…`) model prefix; Zen/Kimi models resolve via opencode's built-in `opencode` / `moonshotai` / `kimi-for-coding` providers | `crush.json` `models` block (atoms `glm5_2` / `glm5_turbo`) |
|
|
58
58
|
| Output | ndjson stream that Triss folds into one envelope | ONE JSON object at end-of-run — trivial last-line parse |
|
|
59
59
|
| Sessions | slug → real `ses_…` id mapped in `.triss/sessions.json` | native get-or-create with the caller's arbitrary id — no map |
|
|
@@ -98,22 +98,22 @@ Z.AI GLM — the default and crush's only provider — is configured from a
|
|
|
98
98
|
single secret, `ZHIPU_API_KEY` (get it at
|
|
99
99
|
<https://z.ai/manage-apikey/apikey-list>). It is the only **required** env var
|
|
100
100
|
for the coder subsystem (`CODER_MANIFEST`) when GLM is the chosen provider.
|
|
101
|
-
The `opencode` engine can also run
|
|
102
|
-
`opencode/*` models
|
|
103
|
-
|
|
101
|
+
The `opencode` engine can also run OpenCode Zen `opencode/*` and paid OpenCode
|
|
102
|
+
Go `opencode-go/*` models; both authenticate with `OPENCODE_API_KEY`, but use
|
|
103
|
+
separate catalogues and provider identities.
|
|
104
104
|
`coderModelCredential(model)` maps a resolved model's `<provider>/` prefix to
|
|
105
105
|
the key it needs, and `triss coder run` gates on exactly that key before
|
|
106
|
-
spawning — so a
|
|
106
|
+
spawning — so a Zen- or Go-only setup runs on `OPENCODE_API_KEY` alone. **Setup
|
|
107
107
|
resolves engine then provider before requesting any credential**, so a Zen /
|
|
108
|
-
Moonshot / Kimi flow is never asked for `ZHIPU_API_KEY`. See
|
|
109
|
-
[opencode-zen.md](opencode-zen.md)
|
|
110
|
-
|
|
108
|
+
Go / Moonshot / Kimi flow is never asked for `ZHIPU_API_KEY`. See
|
|
109
|
+
[opencode-zen.md](opencode-zen.md) and [opencode-go.md](opencode-go.md) for the
|
|
110
|
+
catalogues and configuration paths.
|
|
111
111
|
|
|
112
112
|
### Minimal subprocess environment
|
|
113
113
|
The engine subprocess never inherits your full environment. `buildEngineEnv()`
|
|
114
114
|
copies only `PATH`, `HOME`, `TMPDIR`, `LANG`, `LC_ALL` plus the **single**
|
|
115
115
|
provider key the resolved model needs — `ZHIPU_API_KEY` for GLM or
|
|
116
|
-
`OPENCODE_API_KEY` for an `opencode/*`
|
|
116
|
+
`OPENCODE_API_KEY` for an `opencode/*` or `opencode-go/*` model, never both, so a run only ever
|
|
117
117
|
carries the credential its own provider uses. For crush, the adapter instead
|
|
118
118
|
maps `ZHIPU_API_KEY → ZAI_API_KEY` in the spawn env (`buildCrushSpawnEnv`)
|
|
119
119
|
because crush's built-in `zai` provider historically read only `ZAI_API_KEY`.
|
|
@@ -165,12 +165,13 @@ readiness (no secrets printed), and a live **availability** per model:
|
|
|
165
165
|
model is live.
|
|
166
166
|
|
|
167
167
|
`--allow-unverified` narrows *which* `not verified` you may proceed past. It is
|
|
168
|
-
accepted **only** when
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
accepted **only** when an explicit positional main model and explicit `--small`
|
|
169
|
+
model are supplied and the provider credential is present. For OpenCode Go,
|
|
170
|
+
only `catalogue_status: transient` is bypassable: transport failures and HTTP
|
|
171
|
+
408/429/500/502/503/504. Go `unauthenticated`, `forbidden`, `empty`, `invalid`,
|
|
172
|
+
and authoritative unavailable states always block. Legacy Zen model management
|
|
173
|
+
continues to allow `timeout`, `http-error`, or `parse-error`; it never accepts
|
|
174
|
+
`unauthenticated` or authoritative `unavailable`.
|
|
174
175
|
`catalogue_status: not-supported` is different: the provider has no catalogue
|
|
175
176
|
API, so there is no remote list to bypass. After credential, provider-prefix,
|
|
176
177
|
and plan-prefix validation succeeds, the switch proceeds without
|
|
@@ -336,6 +337,11 @@ successful-response text contract accepts both OpenAI-compatible
|
|
|
336
337
|
complete final answer, not metadata: CLI must print it and MCP must return it.
|
|
337
338
|
Only a response containing neither form is considered empty.
|
|
338
339
|
|
|
340
|
+
For GLM 5.2 code review, use `triss review --provider glm --model pro
|
|
341
|
+
--max-tokens 16384` as the minimum. The generic 8192-token default can be
|
|
342
|
+
consumed by reasoning before a verdict is emitted, especially for large diffs.
|
|
343
|
+
When reviewing a focused remediation, narrow `--base` to that commit as well.
|
|
344
|
+
|
|
339
345
|
### 5.2 Engine choice
|
|
340
346
|
`--engine opencode|crush` (per call) or `TRISS_CODER_ENGINE=<name>` (default
|
|
341
347
|
for the shell/CI). `--engine` beats the env beats the built-in default
|
package/docs/mcp.md
CHANGED
|
@@ -312,11 +312,12 @@ override for self-hosted instances):
|
|
|
312
312
|
`triss_gitlab_update` `triss_gitlab_comment`
|
|
313
313
|
|
|
314
314
|
Exposed **when a provider credential is set** — `ZHIPU_API_KEY` (Z.AI GLM,
|
|
315
|
-
the default), `OPENCODE_API_KEY` (OpenCode Zen — see
|
|
316
|
-
[opencode-zen.md](opencode-zen.md)
|
|
317
|
-
pay-as-you-go), **or** `KIMI_API_KEY`
|
|
318
|
-
Setup: `triss coder init`
|
|
319
|
-
|
|
315
|
+
the default), `OPENCODE_API_KEY` (OpenCode Zen or paid OpenCode Go — see
|
|
316
|
+
[opencode-zen.md](opencode-zen.md) and [opencode-go.md](opencode-go.md)),
|
|
317
|
+
`MOONSHOT_API_KEY` (Moonshot Kimi pay-as-you-go), **or** `KIMI_API_KEY`
|
|
318
|
+
(Kimi for Coding subscription). Setup: `triss coder init`
|
|
319
|
+
(`--provider opencode-zen`, `--provider opencode-go`, `--provider moonshot`, or
|
|
320
|
+
`--provider kimi-for-coding`) or `triss config wizard coder`.
|
|
320
321
|
|
|
321
322
|
- `triss_coder_run` — delegate an implementation task to a coding
|
|
322
323
|
agent (default `opencode` engine; `engine: "crush"` selects the crush
|
|
@@ -332,10 +333,11 @@ or `--provider kimi-for-coding`) or `triss config wizard coder`.
|
|
|
332
333
|
`permissions.run` config is inert and denied bash deadlocks, so the
|
|
333
334
|
worktree is its reliable safety layer). `model` takes a `<provider>/<id>`
|
|
334
335
|
string — a Z.AI GLM (`zai-coding-plan/glm-5.2`), an OpenCode Zen model
|
|
335
|
-
(`opencode/deepseek-v4-flash-free`, needs `OPENCODE_API_KEY`),
|
|
336
|
-
(`
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
(`opencode/deepseek-v4-flash-free`, needs `OPENCODE_API_KEY`), an OpenCode
|
|
337
|
+
Go model (`opencode-go/deepseek-v4-flash`, needs `OPENCODE_API_KEY` and Go
|
|
338
|
+
entitlement), a Moonshot Kimi model (`moonshotai/kimi-k2.7-code`, needs
|
|
339
|
+
`MOONSHOT_API_KEY`), or a Kimi for Coding model (`kimi-for-coding/k3`, needs
|
|
340
|
+
`KIMI_API_KEY`); triss forwards only the key that model's provider requires.
|
|
339
341
|
- `triss_coder_status` — the default engine, each engine's version/install
|
|
340
342
|
state (`opencode` vs the pinned version, `crush` presence), which
|
|
341
343
|
`opencode.json` / `crush.json` files exist, provider key presence
|