refactor: simplify UI labels, optimize agent timeline wrapping, silence proxy errors

This commit is contained in:
lohit-bruno
2026-03-04 01:09:52 +05:30
parent 8b08ba1ee9
commit 594fc30f9f
3 changed files with 6 additions and 13 deletions

View File

@@ -110,10 +110,9 @@ const Cache = () => {
</div>
<div className="mt-6">
<button type="button" className="btn btn-sm btn-secondary" onClick={handleResetCache}>
Reset Cache
<button type="button" className="purge-button" onClick={handleResetCache}>
Clear
</button>
<div className="text-xs mt-1 opacity-70">Destroys all cached agents and their connections.</div>
</div>
</form>
</StyledWrapper>

View File

@@ -496,10 +496,7 @@ const runSingleRequest = async function (
throw new Error('Invalid system https_proxy');
}
}
} catch (error) {
// Log system proxy detection errors but continue without proxy
console.warn('Failed to configure system proxy:', error.message);
}
} catch (error) {}
}
if (!request.httpAgent && !request.httpsAgent) {

View File

@@ -188,12 +188,9 @@ function getOrCreateAgentInternal<TOptions extends HttpAgentOptions>(
return agent;
}
// Wrap the agent class with timeline support (cached)
const AgentClass = getTimelineClass(BaseAgentClass);
const agent = proxyUri
? new AgentClass({ ...options, proxy: proxyUri }, timeline || undefined)
: new AgentClass(options, timeline || undefined);
const AgentClass = timeline ? getTimelineClass(BaseAgentClass) : BaseAgentClass;
const agentOptions = proxyUri ? { ...options, proxy: proxyUri } : options;
const agent = new AgentClass(agentOptions, timeline ?? undefined);
if (!disableCache) {
// Evict oldest entry if cache is full (LRU eviction)