@smart-coders-hq/opencode-model-fallback 1.0.3 → 1.0.5

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 CHANGED
@@ -75,23 +75,25 @@ Place `model-fallback.json` at either:
75
75
  "429"
76
76
  ],
77
77
  "logging": true,
78
+ "logLevel": "info",
78
79
  "logPath": "~/.local/share/opencode/logs/model-fallback.log"
79
80
  }
80
81
  ```
81
82
 
82
83
  ### All config fields
83
84
 
84
- | Field | Type | Default | Description |
85
- | ------------------------------- | -------- | ------------------------------------------------- | ------------------------------------------------------------------------ |
86
- | `enabled` | boolean | `true` | Enable/disable the plugin |
87
- | `defaults.fallbackOn` | string[] | all categories | Error categories that trigger fallback |
88
- | `defaults.cooldownMs` | number | `300000` (5 min) | How long before a rate-limited model enters cooldown. Min: 10000 |
89
- | `defaults.retryOriginalAfterMs` | number | `900000` (15 min) | How long before a cooldown model is considered healthy again. Min: 10000 |
90
- | `defaults.maxFallbackDepth` | number | `3` | Maximum number of fallbacks per session. Max: 10 |
91
- | `agents` | object | `{"*": {}}` | Per-agent fallback chains (see below) |
92
- | `patterns` | string[] | see defaults | Case-insensitive substrings to match in retry messages |
93
- | `logging` | boolean | `true` | Write structured logs to `logPath` |
94
- | `logPath` | string | `~/.local/share/opencode/logs/model-fallback.log` | Log file path (must be within `$HOME`) |
85
+ | Field | Type | Default | Description |
86
+ | ------------------------------- | -------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
87
+ | `enabled` | boolean | `true` | Enable/disable the plugin |
88
+ | `defaults.fallbackOn` | string[] | all categories | Error categories that trigger fallback |
89
+ | `defaults.cooldownMs` | number | `300000` (5 min) | How long before a rate-limited model enters cooldown. Min: 10000 |
90
+ | `defaults.retryOriginalAfterMs` | number | `900000` (15 min) | How long before a cooldown model is considered healthy again. Min: 10000 |
91
+ | `defaults.maxFallbackDepth` | number | `3` | Maximum number of fallbacks per session. Max: 10 |
92
+ | `agents` | object | `{"*": {}}` | Per-agent fallback chains (see below) |
93
+ | `patterns` | string[] | see defaults | Case-insensitive substrings to match in retry messages |
94
+ | `logging` | boolean | `true` | Write structured logs to `logPath` |
95
+ | `logLevel` | string | `"info"` | Minimum log level written to file: `"info"` suppresses debug noise, `"debug"` logs every event (useful for incident investigation) |
96
+ | `logPath` | string | `~/.local/share/opencode/logs/model-fallback.log` | Log file path (must be within `$HOME`) |
95
97
 
96
98
  ### Error categories
97
99
 
@@ -210,6 +212,8 @@ tail -f ~/.local/share/opencode/logs/model-fallback.log | jq .
210
212
 
211
213
  Key log events: `plugin.init`, `retry.detected`, `fallback.success`, `fallback.exhausted`, `health.transition`, `recovery.available`
212
214
 
215
+ To see the full event stream (including `event.received` and `retry.nomatch`), set `"logLevel": "debug"` in your config and restart OpenCode.
216
+
213
217
  ## Release automation
214
218
 
215
219
  - Uses **Conventional Commits** + `semantic-release` for automated versioning/changelog/release notes
@@ -223,7 +227,7 @@ Key log events: `plugin.init`, `retry.detected`, `fallback.success`, `fallback.e
223
227
  ```bash
224
228
  bun install
225
229
  bun run lint # lint checks
226
- bun test # 101 tests
230
+ bun test # 137 tests across 11 files
227
231
  bunx tsc --noEmit # type check
228
232
  bun run build # build to dist/
229
233
  ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { createPlugin } from "./src/plugin.js";
2
1
  export type { Plugin } from "@opencode-ai/plugin";
2
+ export { createPlugin } from "./src/plugin.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}