Synced from monorepo
Synced from monorepo Changes: - Temporarily disable session share link creation in the TUI - Do not approve plan on empty Enter from the revise prompt - Expose chat product Skills via ACP available_commands_update - Return immediately from a blocking wait on an already-completed ACP task - Split headless pager module for clearer structure - Stop git worktree prune from removing user registrations on resume - Use compaction sampler tokenizer for item token counts - Opt-in extra root CAs via GROK_EXTRA_CA_BUNDLE - Cancel all session subagents when the user stops - Let the session persistence actor exit when its session ends - Make fullscreen terminal resize much cheaper on long sessions - Report honestly from kill_task when an ACP task does not exist - Hide /usage for external-auth deployments - Forward the history-load trailer’s computer_reason to the client - Remove ineffective no-op tool reminder - Declare slash-command screen-mode support in one place - Keep settings enum picker on the committed value until Enter - Reap a PTY’s full process tree - Stream tool calls from headless mode over ACP - Bridge gateway task lifecycle to ACP for chat session background tasks - Don’t warn about truncated history on a suppressed replay - Fit full-replace summarizer input and recover on context-length errors - Stop dropping agents over an unrecognized frontmatter color - Add /undo as a slash alias for /rewind - Harden sleep/wake token-refresh paths against forced re-login - Add session/list ACP method - Give each sampling backend its own conversion module - Treat an unenrolled child process as a lint error - Suppress the cancelled marker on send-now wake turns - Stop tearing down Roslyn on every edit, and read C# diagnostics Source-Revision: 2a28b4a86cfc4a4c133c35b7fc2a6a9964387c39
This commit is contained in:
parent
500129c714
commit
dd04f397b1
367 changed files with 29489 additions and 10051 deletions
|
|
@ -11,6 +11,7 @@ reqwest-middleware = { workspace = true }
|
|||
serde_json = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
xai-grok-auth = { workspace = true, features = ["middleware"] }
|
||||
xai-grok-extra-ca = { workspace = true }
|
||||
xai-grok-sampler = { path = "../xai-grok-sampler" }
|
||||
xai-grok-telemetry = { workspace = true }
|
||||
xai-grok-version = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@
|
|||
//! a fresh client per `SamplingClient`.
|
||||
//!
|
||||
//! TLS root certificates are warmed at process start via
|
||||
//! `warm_async_http_client()` (in `mvp_agent.rs`).
|
||||
//! `warm_async_http_client()` (in `mvp_agent.rs`). Optional extra roots:
|
||||
//! `GROK_EXTRA_CA_BUNDLE` via `xai_grok_extra_ca` (see env-var registry).
|
||||
|
||||
use std::sync::OnceLock;
|
||||
|
||||
|
|
@ -320,16 +321,18 @@ pub fn shared_client() -> reqwest::Client {
|
|||
CLIENT
|
||||
.get_or_init(|| {
|
||||
let _timer = startup_timer!("startup.http_client_build");
|
||||
reqwest::Client::builder()
|
||||
.connect_timeout(std::time::Duration::from_secs(30))
|
||||
.user_agent(process_user_agent_string())
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(30))
|
||||
.http2_keep_alive_interval(std::time::Duration::from_secs(20))
|
||||
.http2_keep_alive_timeout(std::time::Duration::from_secs(10))
|
||||
.http2_keep_alive_while_idle(true)
|
||||
.tcp_keepalive(std::time::Duration::from_secs(30))
|
||||
.build()
|
||||
.expect("failed to build shared HTTP client")
|
||||
xai_grok_extra_ca::with_extra_root_certificates(
|
||||
reqwest::Client::builder()
|
||||
.connect_timeout(std::time::Duration::from_secs(30))
|
||||
.user_agent(process_user_agent_string())
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(30))
|
||||
.http2_keep_alive_interval(std::time::Duration::from_secs(20))
|
||||
.http2_keep_alive_timeout(std::time::Duration::from_secs(10))
|
||||
.http2_keep_alive_while_idle(true)
|
||||
.tcp_keepalive(std::time::Duration::from_secs(30)),
|
||||
)
|
||||
.build()
|
||||
.expect("failed to build shared HTTP client")
|
||||
})
|
||||
.clone()
|
||||
}
|
||||
|
|
@ -362,19 +365,21 @@ pub fn shared_upload_client() -> reqwest::Client {
|
|||
static UPLOAD_CLIENT: OnceLock<reqwest::Client> = OnceLock::new();
|
||||
UPLOAD_CLIENT
|
||||
.get_or_init(|| {
|
||||
reqwest::Client::builder()
|
||||
// Force HTTP/1.1: batch_upload multipart bodies are silently
|
||||
// dropped when an HTTP/2 connection degrades (GOAWAY, flow-control
|
||||
// exhaustion). Because all streams share one connection, a single
|
||||
// bad connection causes every subsequent request to arrive with
|
||||
// Content-Length: 0, producing thousands of 400s until the process
|
||||
// restarts. HTTP/1.1 isolates failures to individual connections.
|
||||
.http1_only()
|
||||
.pool_max_idle_per_host(2)
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(10))
|
||||
.user_agent(process_user_agent_string())
|
||||
.build()
|
||||
.expect("failed to build shared upload HTTP client")
|
||||
xai_grok_extra_ca::with_extra_root_certificates(
|
||||
reqwest::Client::builder()
|
||||
// Force HTTP/1.1: batch_upload multipart bodies are silently
|
||||
// dropped when an HTTP/2 connection degrades (GOAWAY, flow-control
|
||||
// exhaustion). Because all streams share one connection, a single
|
||||
// bad connection causes every subsequent request to arrive with
|
||||
// Content-Length: 0, producing thousands of 400s until the process
|
||||
// restarts. HTTP/1.1 isolates failures to individual connections.
|
||||
.http1_only()
|
||||
.pool_max_idle_per_host(2)
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(10))
|
||||
.user_agent(process_user_agent_string()),
|
||||
)
|
||||
.build()
|
||||
.expect("failed to build shared upload HTTP client")
|
||||
})
|
||||
.clone()
|
||||
}
|
||||
|
|
@ -387,11 +392,13 @@ pub fn shared_upload_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()
|
||||
xai_grok_extra_ca::with_extra_root_certificates(
|
||||
reqwest::Client::builder()
|
||||
.http1_only()
|
||||
.pool_max_idle_per_host(0)
|
||||
.user_agent(process_user_agent_string()),
|
||||
)
|
||||
.build()
|
||||
}
|
||||
|
||||
/// Joins an error's `source()` chain into one string. A `reqwest::Error`'s `Display`
|
||||
|
|
@ -543,14 +550,16 @@ pub fn shared_startup_blocking_client() -> reqwest::blocking::Client {
|
|||
BLOCKING_CLIENT
|
||||
.get_or_init(|| {
|
||||
let _timer = startup_timer!("startup.http_blocking_client_build");
|
||||
reqwest::blocking::Client::builder()
|
||||
.connect_timeout(STARTUP_FETCH_TIMEOUT)
|
||||
.timeout(STARTUP_FETCH_TIMEOUT)
|
||||
.user_agent(process_user_agent_string())
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(30))
|
||||
.tcp_keepalive(std::time::Duration::from_secs(30))
|
||||
.build()
|
||||
.expect("failed to build shared blocking HTTP client")
|
||||
xai_grok_extra_ca::with_extra_root_certificates_blocking(
|
||||
reqwest::blocking::Client::builder()
|
||||
.connect_timeout(STARTUP_FETCH_TIMEOUT)
|
||||
.timeout(STARTUP_FETCH_TIMEOUT)
|
||||
.user_agent(process_user_agent_string())
|
||||
.pool_idle_timeout(std::time::Duration::from_secs(30))
|
||||
.tcp_keepalive(std::time::Duration::from_secs(30)),
|
||||
)
|
||||
.build()
|
||||
.expect("failed to build shared blocking HTTP client")
|
||||
})
|
||||
.clone()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue