@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.js CHANGED
@@ -754,9 +754,10 @@ async function* agentLoop(messages, options) {
754
754
  const STREAM_HARD_TIMEOUT_MS = 9e4;
755
755
  const STREAM_OUTPUT_HARD_TIMEOUT_MS = 3e5;
756
756
  const STREAM_THINKING_IDLE_TIMEOUT_MS = 6e5;
757
- const STREAM_THINKING_HARD_TIMEOUT_MS = 9e5;
757
+ const STREAM_THINKING_HARD_TIMEOUT_MS = 18e5;
758
758
  const NON_STREAMING_HARD_TIMEOUT_MS = 3e5;
759
- const nonStreamingHardTimeoutMs = options.thinking != null ? STREAM_THINKING_HARD_TIMEOUT_MS : NON_STREAMING_HARD_TIMEOUT_MS;
759
+ const NON_STREAMING_THINKING_HARD_TIMEOUT_MS = 9e5;
760
+ const nonStreamingHardTimeoutMs = options.thinking != null ? NON_STREAMING_THINKING_HARD_TIMEOUT_MS : NON_STREAMING_HARD_TIMEOUT_MS;
760
761
  const VISIBLE_STALL_AFTER_MS = 6e4;
761
762
  const usesSilentReasoningBudget = options.provider === "sakana" || options.provider === "xai" || options.provider === "openai" && options.thinking != null;
762
763
  const localBackend = isLocalBackendUrl(options.baseUrl);
@@ -978,6 +979,11 @@ async function* agentLoop(messages, options) {
978
979
  defaultHeaders: options.defaultHeaders,
979
980
  providerOptions: options.providerOptions,
980
981
  fetch: options.fetch,
982
+ // Raw bytes (incl. SSE pings) prove the connection is alive during
983
+ // silent thinking; only re-arm an armed timer, never mid-yield.
984
+ onTransportActivity: () => {
985
+ if (idleTimer && !streamController.signal.aborted) resetIdleTimer();
986
+ },
981
987
  // Flip to non-streaming fallback after repeated stream stalls.
982
988
  ...useNonStreamingFallback ? { streaming: false } : {}
983
989
  })