oira666_pi-limits-wait 0.5.1 → 0.5.2

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/README.md CHANGED
@@ -81,7 +81,7 @@ Fallback behavior:
81
81
  4. If that model later becomes rate-limited too, the extension starts again from the same ordered list.
82
82
  5. Rate-limit reset times are remembered only in memory, so known-limited models are skipped until their countdown expires. This memory is cleared when Pi restarts.
83
83
 
84
- When the settings are loaded, the extension shows the full usable fallback model list. When models become rate-limited, it reports the wait in chat notifications.
84
+ The extension rereads these files before every LLM call, so changes made during a long-running task take effect on the next LLM call without restarting Pi or using `/reload`. Tool calls do not trigger a settings read. When the settings are loaded, the extension shows the full usable fallback model list. When models become rate-limited, it reports the wait in chat notifications.
85
85
 
86
86
  ## Environment variables
87
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oira666_pi-limits-wait",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Extension for PI that allows to automatically wait for limits to reset and retry the request",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/stream.ts CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  } from "./models.js";
29
29
  import { withAttemptResponseObserver } from "./response-observer.js";
30
30
  import { errorMessageWithCauses, getRetryableError, isAbortMessage, parseRetryDelayMs, retryAfterHeaderMs } from "./retry-errors.js";
31
+ import { loadFallbackSettings } from "./settings.js";
31
32
  import { state } from "./state.js";
32
33
  import type { FallbackModel, RetryableError, RuntimeStreamSimpleFn } from "./types.js";
33
34
  import { clearModelStatus, freezingEnabled, reasonLabel, waitForRetry } from "./ui.js";
@@ -173,6 +174,11 @@ export function streamWithLimitsRetry(
173
174
  ? AbortSignal.any([options.signal, ownerSignal])
174
175
  : options?.signal ?? ownerSignal;
175
176
 
177
+ // A long-running agent task can make many LLM calls between tool calls.
178
+ // Refresh here—not only in before_agent_start—so project settings edited
179
+ // during that task take effect on the next LLM call without /reload.
180
+ if (state.sharedCtx?.modelRegistry) loadFallbackSettings(state.sharedCtx);
181
+
176
182
  void (async () => {
177
183
  let committed = false;
178
184
  let finished = false;