opencode-pollinations-plugin 5.4.11 → 5.4.12

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.
@@ -61,8 +61,15 @@ function readConfigFromDisk() {
61
61
  catch (e) {
62
62
  logConfig(`Error loading config: ${e}`);
63
63
  }
64
- // 2. Auth Store (Priority)
65
- if (!keyFound) {
64
+ // 2. Auth Store (Fallback ONLY if config.json didn't exist or we are in a clear state)
65
+ // If config.json exists, it is the source of truth. We shouldn't resurrect old keys from auth.json
66
+ // UNLESS config.json is "empty" (just created default).
67
+ // But how to know?
68
+ // New logic: If Custom Config was loaded (fs.exists(CONFIG_FILE)), we trust it.
69
+ // We only check Auth Store if NO custom config exists OR if custom config is explicitly "manual" and we want to auto-discover?
70
+ // User complaint: "Old key comes back".
71
+ // Fix: If config.json exists, we DO NOT check auth.json.
72
+ if (!fs.existsSync(CONFIG_FILE) && !keyFound) {
66
73
  try {
67
74
  if (fs.existsSync(AUTH_FILE)) {
68
75
  const raw = fs.readFileSync(AUTH_FILE, 'utf-8');
@@ -93,7 +93,7 @@ export async function generatePollinationsConfig(forceApiKey) {
93
93
  // 2. ENTERPRISE UNIVERSE
94
94
  if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
95
95
  try {
96
- const enterListRaw = await fetchJson('https://gen.pollinations.ai/text/models', {
96
+ const enterListRaw = await fetchJson('https://gen.pollinations.ai/models', {
97
97
  'Authorization': `Bearer ${effectiveKey}`
98
98
  });
99
99
  const enterList = Array.isArray(enterListRaw) ? enterListRaw : (enterListRaw.data || []);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations AI (V5.1)",
4
- "version": "5.4.11",
4
+ "version": "5.4.12",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {