opencode/packages/plugin/src
Developer 47d6fc7382 fix: preserve full OpenCode provider cost shape in auth.loader
The normalizeProviderModelCosts function was only setting { input: 0, output: 0 }
which doesn't match the full OpenCode provider cost shape that includes cache fields.

This fix:
- Preserves existing cost fields (input, output, cache.read, cache.write) if valid
- Adds missing cache: { read: 0, write: 0 } structure when not present
- Validates provider and model objects before modification to avoid poisoning
  invalid provider metadata
- Updates ProviderModel type to include optional cache field

Fixes provider cost normalization to maintain cache field compatibility.
2026-05-09 15:28:13 -04:00
..
example-workspace.ts feat(core): expose workspace adaptors to plugins (#21927) 2026-04-13 13:33:13 -04:00
example.ts fix: prefix 32 unused parameters with underscore (#22694) 2026-04-15 21:56:23 -04:00
index.ts refactor: rename workspace adapters (#25272) 2026-05-01 07:36:52 -04:00
shell.ts re-export shell $ for plugin 2025-08-04 23:20:04 -04:00
tool.ts fix: preserve plugin tool metadata in execute result (#22827) 2026-04-16 21:38:21 -05:00
tui.ts fix: preserve full OpenCode provider cost shape in auth.loader 2026-05-09 15:28:13 -04:00