@kenkaiiii/gg-agent 5.87.1 → 5.87.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/dist/index.cjs CHANGED
@@ -786,9 +786,10 @@ async function* agentLoop(messages, options) {
786
786
  const STREAM_HARD_TIMEOUT_MS = 9e4;
787
787
  const STREAM_OUTPUT_HARD_TIMEOUT_MS = 3e5;
788
788
  const STREAM_THINKING_IDLE_TIMEOUT_MS = 6e5;
789
- const STREAM_THINKING_HARD_TIMEOUT_MS = 9e5;
789
+ const STREAM_THINKING_HARD_TIMEOUT_MS = 18e5;
790
790
  const NON_STREAMING_HARD_TIMEOUT_MS = 3e5;
791
- const nonStreamingHardTimeoutMs = options.thinking != null ? STREAM_THINKING_HARD_TIMEOUT_MS : NON_STREAMING_HARD_TIMEOUT_MS;
791
+ const NON_STREAMING_THINKING_HARD_TIMEOUT_MS = 9e5;
792
+ const nonStreamingHardTimeoutMs = options.thinking != null ? NON_STREAMING_THINKING_HARD_TIMEOUT_MS : NON_STREAMING_HARD_TIMEOUT_MS;
792
793
  const VISIBLE_STALL_AFTER_MS = 6e4;
793
794
  const usesSilentReasoningBudget = options.provider === "sakana" || options.provider === "xai" || options.provider === "openai" && options.thinking != null;
794
795
  const localBackend = isLocalBackendUrl(options.baseUrl);
@@ -1010,6 +1011,11 @@ async function* agentLoop(messages, options) {
1010
1011
  defaultHeaders: options.defaultHeaders,
1011
1012
  providerOptions: options.providerOptions,
1012
1013
  fetch: options.fetch,
1014
+ // Raw bytes (incl. SSE pings) prove the connection is alive during
1015
+ // silent thinking; only re-arm an armed timer, never mid-yield.
1016
+ onTransportActivity: () => {
1017
+ if (idleTimer && !streamController.signal.aborted) resetIdleTimer();
1018
+ },
1013
1019
  // Flip to non-streaming fallback after repeated stream stalls.
1014
1020
  ...useNonStreamingFallback ? { streaming: false } : {}
1015
1021
  })