saros-proxy 0.7.1 → 0.7.2
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/README.md +61 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Manage multiple OpenCode-Go API keys behind a single endpoint. When one key gets
|
|
|
24
24
|
- [Configuration Reference](#configuration-reference)
|
|
25
25
|
- [Usage Examples](#usage-examples)
|
|
26
26
|
- [OpenCode Integration](#opencode-integration)
|
|
27
|
+
- [Multi-Harness Integration (pi & oh-my-pi)](#multi-harness-integration-pi--oh-my-pi)
|
|
27
28
|
- [Troubleshooting](#troubleshooting)
|
|
28
29
|
- [Development](#development)
|
|
29
30
|
- [Security](#security)
|
|
@@ -399,9 +400,15 @@ saros-proxy status
|
|
|
399
400
|
# Stop it
|
|
400
401
|
saros-proxy stop
|
|
401
402
|
|
|
402
|
-
# Sync models
|
|
403
|
+
# Sync bundled models to all enabled harnesses
|
|
403
404
|
saros-proxy sync-models
|
|
404
405
|
|
|
406
|
+
# Set which harnesses get model sync (omp|ohmypi, pi, oc|opencode)
|
|
407
|
+
saros-proxy configharness omp pi oc
|
|
408
|
+
|
|
409
|
+
# List the current harness selection
|
|
410
|
+
saros-proxy configharness
|
|
411
|
+
|
|
405
412
|
# Probe model capabilities (liveness, reasoning, tool calling)
|
|
406
413
|
saros-proxy probe [model-id]
|
|
407
414
|
|
|
@@ -418,17 +425,23 @@ saros-proxy autostart uninstall [--method vbs|registry|auto]
|
|
|
418
425
|
saros-proxy autostart status [--method vbs|registry|auto]
|
|
419
426
|
```
|
|
420
427
|
|
|
421
|
-
The `start` command automatically syncs model definitions to
|
|
428
|
+
The `start` command automatically syncs model definitions to all enabled harnesses (see [Multi-Harness Integration](#multi-harness-integration-pi--oh-my-pi)).
|
|
422
429
|
|
|
423
430
|
### Model Sync Commands
|
|
424
431
|
|
|
425
|
-
Saros keeps your
|
|
432
|
+
Saros keeps your harness configs in sync with the upstream API. Which harnesses are synced is opt-in via the harness selection (see [Multi-Harness Integration](#multi-harness-integration-pi--oh-my-pi)).
|
|
426
433
|
|
|
427
434
|
```bash
|
|
428
|
-
#
|
|
435
|
+
# List which harnesses are enabled for model sync
|
|
436
|
+
saros-proxy configharness
|
|
437
|
+
|
|
438
|
+
# Enable sync for oh-my-pi, pi, and OpenCode (replaces the selection)
|
|
439
|
+
saros-proxy configharness omp pi oc
|
|
440
|
+
|
|
441
|
+
# Sync bundled models to all enabled harnesses
|
|
429
442
|
saros-proxy sync-models
|
|
430
443
|
|
|
431
|
-
# Sync
|
|
444
|
+
# Sync the live model list from upstream into all enabled harnesses
|
|
432
445
|
saros-proxy sync-upstream
|
|
433
446
|
|
|
434
447
|
# Probe model capabilities
|
|
@@ -438,8 +451,9 @@ saros-proxy probe [model-id]
|
|
|
438
451
|
saros-proxy probe
|
|
439
452
|
```
|
|
440
453
|
|
|
441
|
-
`sync-models` writes the bundled model definitions to
|
|
442
|
-
`sync-upstream` fetches the live model list from upstream and
|
|
454
|
+
`sync-models` writes the bundled model definitions to each enabled harness's provider config.
|
|
455
|
+
`sync-upstream` fetches the live model list from upstream and writes it to each enabled harness, with metadata from models.dev.
|
|
456
|
+
Both only touch `providers["saros-proxy"].models` in the target configs and skip harnesses whose config file does not exist.
|
|
443
457
|
`probe` tests each model's liveness, reasoning, and tool-calling capabilities via the proxy.
|
|
444
458
|
|
|
445
459
|
**Daemon config path:** By default the daemon looks for `config.yaml` at:
|
|
@@ -518,6 +532,41 @@ Select the proxy provider in OpenCode's model picker, or set it as default:
|
|
|
518
532
|
|
|
519
533
|
---
|
|
520
534
|
|
|
535
|
+
## Multi-Harness Integration (pi & oh-my-pi)
|
|
536
|
+
|
|
537
|
+
Besides OpenCode, Saros can keep its provider + model config in sync for the `pi` and `oh-my-pi` (`omp`) harnesses. Both belong to the pi-coding-agent family but use different config files:
|
|
538
|
+
|
|
539
|
+
| Harness | Config file | Format |
|
|
540
|
+
|---|---|---|
|
|
541
|
+
| OpenCode | `~/.config/opencode/opencode.json[.jsonc]` | JSON/JSONC |
|
|
542
|
+
| pi | `~/.pi/agent/models.json` | JSON |
|
|
543
|
+
| oh-my-pi (`omp`) | `~/.omp/agent/models.yml` | YAML |
|
|
544
|
+
|
|
545
|
+
Sync is opt-in per harness, configured with the `configharness` command. The selection is stored in `~/.config/saros/harnesses.json`:
|
|
546
|
+
|
|
547
|
+
```bash
|
|
548
|
+
# Enable sync for omp + pi + opencode (replaces the previous selection)
|
|
549
|
+
saros-proxy configharness omp pi oc
|
|
550
|
+
|
|
551
|
+
# See the current selection
|
|
552
|
+
saros-proxy configharness
|
|
553
|
+
|
|
554
|
+
# Accepted names: omp | ohmypi, pi, oc | opencode
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
Behavior:
|
|
558
|
+
|
|
559
|
+
- If `harnesses.json` does not exist, only OpenCode is synced (the default).
|
|
560
|
+
- An explicit empty selection (`{"harnesses":[]}`) disables sync entirely.
|
|
561
|
+
- Sync never creates a harness config: harnesses whose config file is missing are skipped.
|
|
562
|
+
- Only `providers["saros-proxy"].models` is replaced; all other providers, fields, and settings are preserved, and a `<file>.backup` is created before the first write.
|
|
563
|
+
|
|
564
|
+
The model list written to each harness comes from the live upstream catalog enriched with models.dev metadata (falling back to bundled models when offline), so pi/omp stay current alongside OpenCode.
|
|
565
|
+
|
|
566
|
+
> **Why a static model list?** Both harnesses use a static `models` list on purpose. `pi` has no `/v1/models` discovery for custom providers, and `oh-my-pi`'s discovery cannot recover reasoning/context/output metadata for OpenCode-Go model IDs — dynamic discovery would silently break thinking-level (`:max`/`:high`) role configs in `~/.omp/agent/config.yml`.
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
521
570
|
## Troubleshooting
|
|
522
571
|
|
|
523
572
|
### Check proxy health
|
|
@@ -605,11 +654,15 @@ src/
|
|
|
605
654
|
constants.ts — All defaults and configuration values
|
|
606
655
|
logger.ts — Structured logging with Pino + key masking
|
|
607
656
|
models-fetcher.ts — Upstream model list fetching + caching
|
|
608
|
-
models-sync.ts — Auto-sync models from upstream to opencode
|
|
657
|
+
models-sync.ts — Auto-sync models from upstream to opencode config
|
|
609
658
|
cli/
|
|
610
659
|
setup.ts — Interactive setup wizard
|
|
611
660
|
daemon.ts — Background process management
|
|
612
661
|
opencode-config.ts — opencode.json read/write/sync
|
|
662
|
+
harness-models.ts — Canonical model map + pi/omp shape transform
|
|
663
|
+
harness-sync.ts — Harness selection settings + multi-harness sync
|
|
664
|
+
omp-config.ts — oh-my-pi models.yml read/write/sync
|
|
665
|
+
pi-config.ts — pi models.json read/write/sync
|
|
613
666
|
autostart.ts — Windows/Linux autostart install/uninstall
|
|
614
667
|
ui.ts — CLI UI abstraction (@clack/prompts wrapper)
|
|
615
668
|
help.ts — Help text
|