vg-coder-cli 2.0.60 → 2.0.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "2.0.60",
3
+ "version": "2.0.61",
4
4
  "description": "🚀 CLI tool to analyze projects, concatenate source files, count tokens, and export HTML with syntax highlighting and copy functionality",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -199,7 +199,7 @@ function throwIfRateLimited(stage = '') {
199
199
  }
200
200
 
201
201
  // Đọc model ID thật từ AI Studio sidebar — bắt được redirect AI Studio làm khi
202
- // account thiếu access tới preview model (vd request gemini-3-pro-preview, run
202
+ // account thiếu access tới preview model (vd request gemini-3.1-pro-preview, run
203
203
  // thật trên gemini-3-flash-preview). URL param không reliable vì AI Studio
204
204
  // không update URL khi fallback. Sidebar `<ms-model-selector>` mới là source-
205
205
  // of-truth.
@@ -256,6 +256,18 @@ async function handleTaskExecute(payload) {
256
256
  }
257
257
  await new Promise(r => setTimeout(r, 600)); // settle after navigation
258
258
 
259
+ // 1b. Pre-flight model check: AI Studio có thể fallback sang paid agent
260
+ // (vd "deep-research-preview-04-2026") khi pin model không có access.
261
+ // Submit task lên Deep Research → rate limit ngay (paid quota), URL không
262
+ // có ?model= để recycle pin lại → loop fail. Fail-fast nếu detect agent
263
+ // không phải gemini.
264
+ const preFlightModel = await readActualModel();
265
+ if (preFlightModel && !/^gemini[-.]/i.test(preFlightModel)) {
266
+ const e = new Error(`Worker tab loaded non-Gemini model: ${preFlightModel}. Pin model unavailable for this account.`);
267
+ e.code = 'model_unavailable';
268
+ throw e;
269
+ }
270
+
259
271
  if (cancelFlags.has(taskId)) {
260
272
  cancelFlags.delete(taskId);
261
273
  console.log(`[TaskWorker] ${taskId} canceled before send — skipping`);