teapot-coding-agent 0.37.91 → 0.37.92
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/dist/master.js
CHANGED
|
@@ -282,32 +282,52 @@ export class Master {
|
|
|
282
282
|
this.configDirty = true;
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
285
|
+
/**
|
|
286
|
+
* ONE list of the fields `config.json` mirrors from `this.config`.
|
|
287
|
+
*
|
|
288
|
+
* This used to be ad-hoc lines, and it was wrong in two ways that both read as "the setting does not
|
|
289
|
+
* work":
|
|
290
|
+
*
|
|
291
|
+
* - `progressIntervalMs` / `progressMinChars` were written only when `raw` did not already have
|
|
292
|
+
* them (`=== undefined`), so the FIRST save persisted and every later change was dropped —
|
|
293
|
+
* reported as "progress interval (min) が機能してなくない? 少なくともconfig.jsonには書き込まれて
|
|
294
|
+
* ない";
|
|
295
|
+
* - `contextTokenBudget`, `contextWindowTokens`, `maxSpawnDepth`, `maxTurnsPerRound`, `onError`
|
|
296
|
+
* and `retryDelayMs` were never written at all, so those runtime controls could not persist
|
|
297
|
+
* either.
|
|
298
|
+
*
|
|
299
|
+
* Undefined DELETES the key rather than leaving the old value lying in the file, so clearing a
|
|
300
|
+
* control in the UI actually clears it on disk.
|
|
301
|
+
*/
|
|
302
|
+
const mirrored = [
|
|
303
|
+
"agents",
|
|
304
|
+
"providers",
|
|
305
|
+
"defaultProvider",
|
|
306
|
+
"tasks",
|
|
307
|
+
"mcpServers",
|
|
308
|
+
"sessionTitles",
|
|
309
|
+
"customThemes",
|
|
310
|
+
"password",
|
|
311
|
+
"themePrefs",
|
|
312
|
+
"resumeAfterUpdate",
|
|
313
|
+
"shortContext",
|
|
314
|
+
"pluginsDir",
|
|
315
|
+
"progressIntervalMs",
|
|
316
|
+
"progressMinChars",
|
|
317
|
+
"contextTokenBudget",
|
|
318
|
+
"contextWindowTokens",
|
|
319
|
+
"maxSpawnDepth",
|
|
320
|
+
"maxTurnsPerRound",
|
|
321
|
+
"onError",
|
|
322
|
+
"retryDelayMs",
|
|
323
|
+
];
|
|
324
|
+
for (const key of mirrored) {
|
|
325
|
+
const value = this.config[key];
|
|
326
|
+
if (value === undefined)
|
|
327
|
+
delete this.raw[key];
|
|
328
|
+
else
|
|
329
|
+
this.raw[key] = value;
|
|
330
|
+
}
|
|
311
331
|
this.writeConfigAtomic(JSON.stringify(this.raw, null, 2) + "\n");
|
|
312
332
|
}
|
|
313
333
|
deferConfigWrites = false;
|
|
@@ -421,16 +441,13 @@ export class Master {
|
|
|
421
441
|
this.config.contextWindowTokens =
|
|
422
442
|
(patch.contextWindowTokens ?? 0) > 0 ? patch.contextWindowTokens : undefined;
|
|
423
443
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
else
|
|
432
|
-
this.raw[k] = v;
|
|
433
|
-
}
|
|
444
|
+
/**
|
|
445
|
+
* No `this.raw[...] = v` loop here — `saveConfig()` owns the mirror now (see its `mirrored` list).
|
|
446
|
+
*
|
|
447
|
+
* There used to be one, covering six of these keys and not the other two, which is exactly how the
|
|
448
|
+
* runtime controls ended up in different states: `contextTokenBudget` persisted, `progressIntervalMs`
|
|
449
|
+
* did not. One owner, one rule — and it runs once, at the end, after `tasks` is updated too.
|
|
450
|
+
*/
|
|
434
451
|
if (patch.tasks) {
|
|
435
452
|
this.config.tasks = patch.tasks;
|
|
436
453
|
this.tasks = patch.tasks.map((t) => ({
|