Synced from monorepo
Synced from monorepo Changes: - Shell: accept target response id on rewind execute - Shell: stamp response id on chat user message chunks - Worktree: optional rebuild and stale git registration cleanup in auto-GC - Worktree: kind-aware auto-GC TTLs and config knobs - Worktree: macOS process CWD scan and Unix PID liveness for GC guards - Worktree: automatic throttled GC on startup (Linux age-based; non-Linux dead-only) - Pager: add `[ui].combine_queued_prompts` to batch queued follow-ups - Shell: stop overwriting user skills - Tools: read markdown in `skills/` directories untruncated - `/usage` shows per-session token and dollar usage in the TUI - Security: prompt on environment-dumping `ps` variants - Security: always-safe `kubectl` no longer runs arbitrary kubeconfig credential plugins without permission - Tools: make scheduler deletion durable - Shell: add relocation storage primitives - Shell: give side model calls their own conversation ids - Fix five workflow-runtime bugs (budget, pause, cancel, reconnect) - Security: peel `env -S` / `--split-string` operands in the Bash permission gate (managed deny/ask) - Pager: expose doctor in the TUI - Security: block unauthorized RCE via abused safe commands - Pager idle watcher cue: "1 subagent still running" instead of "watching · 1 subagent" - Security: block `rg --pre` arbitrary code execution in auto-mode - Voice: diagnose silent-mic failures (macOS permission) and add doctor/terminal-setup Voice section - App builder deployer: `allow_forking` and `show_built_with_grok` - Pager: stop stacking duplicate "Worked for" markers on parked turns - Shell: support `max` as a distinct reasoning effort tier - Tools: serialize background `/loop` fires on the whole work unit - Shell: add working-directory relocation state primitives - Proto: `ClientToolResult` and `ChatConfig` client-side tools - Shell: model providers - Chat: select App Builder product on the Build path - Shell: attach author identity to feedback when the deployment opts in - Doctor: fix for SSH wrap setup - Workflow authoring skills: create-workflow and import-claude-workflow docs - Add read-only grok doctor - Sandbox: apply Landlock without a controlling TTY - Pager: recover image paste over grok wrap on headless remotes - Pager: make actions screen-mode aware - Shell: resume sessions when the working directory moves - Pager: centralize terminal diagnostics - Workspace: gate inline shell file access - Pager: centralize terminal probes - Pager: edit minimal prompts in an external editor - Pager: standardize backgrounding on Ctrl+B - Shell: recap rides the parent turn's prompt cache - Tools: add scheduler lifecycle version clock Source-Revision: 0f4d7c91b8b2b408333f6de1e8a76cb8eaa71899
This commit is contained in:
parent
a881e6703f
commit
3af4d5d398
556 changed files with 56609 additions and 21892 deletions
|
|
@ -10,6 +10,8 @@ use std::sync::Arc;
|
|||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::scaled;
|
||||
|
||||
use agent_client_protocol::{self as acp, Agent as _};
|
||||
use tempfile::TempDir;
|
||||
use tokio_util::compat::{TokioAsyncReadCompatExt, TokioAsyncWriteCompatExt};
|
||||
|
|
@ -306,16 +308,27 @@ impl GrokStdioClient {
|
|||
self.home.as_ref().expect("test home already taken").path()
|
||||
}
|
||||
|
||||
/// Timing breadcrumb for tuning CI timeout budgets (visible with --nocapture).
|
||||
fn log_timing(what: &str, started: std::time::Instant) {
|
||||
eprintln!("[harness-timing] {what}: {:?}", started.elapsed());
|
||||
}
|
||||
|
||||
pub async fn initialize_with_timeout(&self) -> acp::InitializeResponse {
|
||||
tokio::time::timeout(Duration::from_secs(20), self.initialize())
|
||||
let started = std::time::Instant::now();
|
||||
let r = tokio::time::timeout(scaled(Duration::from_secs(20)), self.initialize())
|
||||
.await
|
||||
.unwrap_or_else(|_| panic!("initialize timed out\nstderr:\n{}", self.stderr()))
|
||||
.unwrap_or_else(|_| panic!("initialize timed out\nstderr:\n{}", self.stderr()));
|
||||
Self::log_timing("initialize", started);
|
||||
r
|
||||
}
|
||||
|
||||
pub async fn create_session_with_timeout(&self, cwd: &Path) -> acp::SessionId {
|
||||
tokio::time::timeout(Duration::from_secs(20), self.create_session(cwd))
|
||||
let started = std::time::Instant::now();
|
||||
let r = tokio::time::timeout(scaled(Duration::from_secs(20)), self.create_session(cwd))
|
||||
.await
|
||||
.unwrap_or_else(|_| panic!("session/new timed out\nstderr:\n{}", self.stderr()))
|
||||
.unwrap_or_else(|_| panic!("session/new timed out\nstderr:\n{}", self.stderr()));
|
||||
Self::log_timing("session/new", started);
|
||||
r
|
||||
}
|
||||
|
||||
pub async fn create_session_with_model_timeout(
|
||||
|
|
@ -324,7 +337,7 @@ impl GrokStdioClient {
|
|||
model_id: &str,
|
||||
) -> acp::SessionId {
|
||||
tokio::time::timeout(
|
||||
Duration::from_secs(20),
|
||||
scaled(Duration::from_secs(20)),
|
||||
self.create_session_with_model(cwd, model_id),
|
||||
)
|
||||
.await
|
||||
|
|
@ -342,7 +355,7 @@ impl GrokStdioClient {
|
|||
model_id: &str,
|
||||
) -> acp::Result<acp::SetSessionModelResponse> {
|
||||
tokio::time::timeout(
|
||||
Duration::from_secs(20),
|
||||
scaled(Duration::from_secs(20)),
|
||||
self.set_model(session_id, model_id),
|
||||
)
|
||||
.await
|
||||
|
|
@ -359,9 +372,15 @@ impl GrokStdioClient {
|
|||
session_id: &acp::SessionId,
|
||||
text: &str,
|
||||
) -> acp::Result<acp::PromptResponse> {
|
||||
tokio::time::timeout(Duration::from_secs(30), self.prompt(session_id, text))
|
||||
.await
|
||||
.unwrap_or_else(|_| panic!("prompt timed out\nstderr:\n{}", self.stderr()))
|
||||
let started = std::time::Instant::now();
|
||||
let r = tokio::time::timeout(
|
||||
scaled(Duration::from_secs(30)),
|
||||
self.prompt(session_id, text),
|
||||
)
|
||||
.await
|
||||
.unwrap_or_else(|_| panic!("prompt timed out\nstderr:\n{}", self.stderr()));
|
||||
Self::log_timing("prompt", started);
|
||||
r
|
||||
}
|
||||
|
||||
pub async fn load_session_with_timeout(
|
||||
|
|
@ -372,7 +391,7 @@ impl GrokStdioClient {
|
|||
// 60s: session/load replays history and is slower under Rosetta
|
||||
// (macos-x86_64 lifecycle CI). 20s flaked repeatedly there.
|
||||
tokio::time::timeout(
|
||||
Duration::from_secs(60),
|
||||
scaled(Duration::from_secs(60)),
|
||||
self.conn.load_session(
|
||||
acp::LoadSessionRequest::new(session_id.clone(), cwd.to_path_buf())
|
||||
.mcp_servers(vec![]),
|
||||
|
|
@ -459,7 +478,7 @@ impl RawStdioClient {
|
|||
) -> serde_json::Value {
|
||||
use tokio::io::AsyncBufReadExt as _;
|
||||
|
||||
let deadline = tokio::time::Instant::now() + timeout;
|
||||
let deadline = tokio::time::Instant::now() + scaled(timeout);
|
||||
let mut line = String::new();
|
||||
let mut skipped = 0_usize;
|
||||
let mut skipped_tail: Vec<String> = Vec::new();
|
||||
|
|
|
|||
Loading…
Reference in a new issue