Browse Source

fix: address review comments on variant handling and docs priority

- Add clarifying comment in index.ts about variant not being forwarded
  to the secondary model API (providerID/modelID only)
- Fix outdated priority list in docs/webfetch.md to show webfetch.model first
adikpb 3 weeks ago
parent
commit
e210816fa3
2 changed files with 7 additions and 3 deletions
  1. 4 3
      docs/webfetch.md
  2. 3 0
      src/index.ts

+ 4 - 3
docs/webfetch.md

@@ -94,9 +94,10 @@ questions like "summarize this page" or "extract the code examples" in one step.
 
 **Which model is used** (in priority order):
 
-1. `small_model` from the OpenCode configuration (`opencode.json` / `opencode.jsonc`)
-2. The configured `explorer` agent model
-3. The configured `librarian` agent model
+1. `webfetch.model` (dedicated — highest priority, supports array for fallback)
+2. `small_model` from the OpenCode configuration (`opencode.json` / `opencode.jsonc`)
+3. The configured `explorer` agent model
+4. The configured `librarian` agent model
 
 The secondary model is called only when all of these are true:
 - A `prompt` parameter is provided

+ 3 - 0
src/index.ts

@@ -293,6 +293,9 @@ const OhMyOpenCodeLite: Plugin = async (ctx) => {
         : [webfetchModel];
       const ids: string[] = [];
       for (const entry of entries) {
+        // Object form { id, variant? } is accepted for schema consistency
+        // with agent model config. Variant is not forwarded — the secondary
+        // model API uses providerID/modelID only.
         const id = typeof entry === 'string' ? entry : entry.id;
         if (id) ids.push(id);
       }