Synced from monorepo
Synced from monorepo Changes: - Report invalid MCP server config instead of failing startup - Keep completed terminal output when the gateway connection is lost - Show a duration-only detail view for single-task task output - Don't let a stale registry turn counter hide local sessions - Raise the file-descriptor soft limit on Linux and log effective limits at startup - Stop aborting when HTTP client construction fails - Make session thread and runtime spawn failures recoverable - Fix main-prompt paste parity in the question freeform input - Fire SessionEnd hooks on /exit and headless quit - Embed the deployment-config signing public key - Repaint paste-chip background on inline panel inputs - Security: prevent acceptEdits from auto-approving agent writes into the always-trusted global hook root - Fix stacked "Worked for" markers so parks render as status and turns close with exactly one marker - Parse hooks from config files - Add a remote kill-switch for managed-config signature verification - Security: fix workspace file-reference resolution bypassing workspace filesystem confinement Source-Revision: d02693a856a54f1030695b36b91d276e96b30b23
This commit is contained in:
parent
6e38642082
commit
47348d13ec
138 changed files with 7283 additions and 5796 deletions
|
|
@ -347,13 +347,15 @@ pub fn shared_upload_client() -> reqwest::Client {
|
|||
/// `pool_max_idle_per_host(0)` + `http1_only()` so each request opens a new connection, and no
|
||||
/// connect timeout (callers bound each request with their own total timeout). The retry escape
|
||||
/// policy that reaches for this client to dodge a poisoned pool lives on `send_with_retry_escaping_pool`.
|
||||
pub(crate) fn fresh_http1_client() -> reqwest::Client {
|
||||
///
|
||||
/// Fallible: build can fail under fd/TLS pressure; the caller must not
|
||||
/// panic on error (fallback policy lives at the call site).
|
||||
pub(crate) fn fresh_http1_client() -> reqwest::Result<reqwest::Client> {
|
||||
reqwest::Client::builder()
|
||||
.http1_only()
|
||||
.pool_max_idle_per_host(0)
|
||||
.user_agent(process_user_agent_string())
|
||||
.build()
|
||||
.expect("failed to build fresh HTTP/1.1 client")
|
||||
}
|
||||
|
||||
/// Joins an error's `source()` chain into one string. A `reqwest::Error`'s `Display`
|
||||
|
|
@ -456,7 +458,18 @@ where
|
|||
// Only the final attempt of a multi-attempt run escapes onto a fresh pool-less connection; a
|
||||
// single-attempt caller keeps the pooled client (there is no prior failure to escape).
|
||||
let client = if attempt > 0 && attempt + 1 == max_attempts {
|
||||
fresh.get_or_insert_with(fresh_http1_client).clone()
|
||||
match &fresh {
|
||||
Some(c) => c.clone(),
|
||||
None => match fresh_http1_client() {
|
||||
Ok(c) => fresh.insert(c).clone(),
|
||||
// Can't escape the pool (e.g. fd exhaustion); a pooled
|
||||
// final attempt still beats aborting the process.
|
||||
Err(e) => {
|
||||
tracing::warn!(error = %e, "failed to build pool-escape client; final attempt stays on pooled client");
|
||||
pooled.clone()
|
||||
}
|
||||
},
|
||||
}
|
||||
} else {
|
||||
pooled.clone()
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue