MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resetStreamIdleTimer

Function resetStreamIdleTimer

src/services/api/claude.ts:1895–1928  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1893 }
1894 }
1895 function resetStreamIdleTimer(): void {
1896 clearStreamIdleTimers()
1897 if (!streamWatchdogEnabled) {
1898 return
1899 }
1900 streamIdleWarningTimer = setTimeout(
1901 warnMs => {
1902 logForDebugging(
1903 `Streaming idle warning: no chunks received for ${warnMs / 1000}s`,
1904 { level: 'warn' },
1905 )
1906 logForDiagnosticsNoPII('warn', 'cli_streaming_idle_warning')
1907 },
1908 STREAM_IDLE_WARNING_MS,
1909 STREAM_IDLE_WARNING_MS,
1910 )
1911 streamIdleTimer = setTimeout(() => {
1912 streamIdleAborted = true
1913 streamWatchdogFiredAt = performance.now()
1914 logForDebugging(
1915 `Streaming idle timeout: no chunks received for ${STREAM_IDLE_TIMEOUT_MS / 1000}s, aborting stream`,
1916 { level: 'error' },
1917 )
1918 logForDiagnosticsNoPII('error', 'cli_streaming_idle_timeout')
1919 logEvent('tengu_streaming_idle_timeout', {
1920 model:
1921 options.model as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
1922 request_id: (streamRequestId ??
1923 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
1924 timeout_ms: STREAM_IDLE_TIMEOUT_MS,
1925 })
1926 releaseStreamResources()
1927 }, STREAM_IDLE_TIMEOUT_MS)
1928 }
1929 resetStreamIdleTimer()
1930
1931 startSessionActivity('api_call')

Callers 1

queryModelFunction · 0.85

Calls 5

clearStreamIdleTimersFunction · 0.85
logForDebuggingFunction · 0.85
logForDiagnosticsNoPIIFunction · 0.85
logEventFunction · 0.85
releaseStreamResourcesFunction · 0.85

Tested by

no test coverage detected