Synced from monorepo

Synced from monorepo

Changes:
- grok-shell: send an expired external-provider credential to the sign-in flow, not a 401 loop
- pager: clickable ▲ jumps to the top of the response being read
- grok-shell: keep a large task log from making the completion message too long
- Plan viewer scrollbar: widen grab zone to the border column; fix striped thumb in Terminal.app
- pager: poll the tmux probe teardown grace instead of sleeping it
- security: vendor-compat MCP kill switch is now actually enforced when reported as on
- grok-shell: restore session eviction when a leader client disconnects
- Bump rust-toolchain to 1.93.0
- workspace: lexical-normalize permission path patterns before glob matching
- pager: reject garbage Enter in the /resume picker
- pager: show Mermaid affordances in plan mode preview
- pager: drop manage-account link from /session-info
- workspace: auto-approve read-only git queries; defer write floor to auto classifier
- Add free-form pattern editor to the "Always allow" command prompt
- grok-shell: fix /btw caching
- pager: Tab walks answers in the ask_user_question card
- External-provider auth refresh: single 7s attempt instead of 3×5s
- pager: don't resurrect finished background tasks as Running when completion arrives first
- pager: report tmux truecolor clamping in Doctor
- Fix plan viewer scrollbar click+drag hijacked by comment gutter
- pager/shell: stop double Recap after the same last turn
- sampler: preserve x-should-retry through stream collection
- pager: clear plan-mode indicator immediately when the user approves a plan
- pager: tmux does not re-read its config on reattach

Source-Revision: 64c4de99cc822b25ce9c54ab5a4f372093d0885d
This commit is contained in:
grokkybara[bot] 2026-08-03 08:17:57 +00:00
commit 780d1388ff
323 changed files with 12258 additions and 7226 deletions

View file

@ -67,6 +67,15 @@ pub struct DoctorProbeSnapshot<'a> {
pub color_level: crate::theme::color_support::ColorLevel,
}
/// Whether the caller will read the colour-passthrough fact. Only `view()`
/// reads it, and the startup path never calls `view()`, so probing there
/// spends ~116ms before first paint on a value that is dropped.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ColorPassthroughProbe {
Skip,
Run,
}
pub struct TmuxProbeFacts {
pub version: TmuxProbeResult<String>,
pub extended_keys: TmuxProbeResult<String>,
@ -74,6 +83,8 @@ pub struct TmuxProbeFacts {
pub allow_passthrough_support: TmuxProbeResult<()>,
pub allow_passthrough: TmuxProbeResult<String>,
pub control_mode: TmuxProbeResult<bool>,
/// Comma-separated `client_termfeatures` for the attached client.
pub client_features: TmuxProbeResult<String>,
}
#[derive(Clone)]
@ -108,6 +119,7 @@ pub fn collect_startup_tui<'a>(
terminal,
runtime,
Some(control_mode),
ColorPassthroughProbe::Skip,
tmux,
is_wayland,
native_tool,
@ -122,7 +134,15 @@ pub fn collect_doctor_tui<'a>(
let is_wayland = crate::host::DisplayServer::current() == crate::host::DisplayServer::Wayland;
let native_tool = xai_grok_shell::util::clipboard::native_tool_name();
DoctorProbeSnapshot {
common: collect_common(terminal, runtime, None, tmux, is_wayland, Some(native_tool)),
common: collect_common(
terminal,
runtime,
None,
ColorPassthroughProbe::Run,
tmux,
is_wayland,
Some(native_tool),
),
clipboard: ClipboardProbeFacts {
route: crate::clipboard::clipboard_route().clone(),
native_tool,
@ -181,6 +201,11 @@ fn collect_tmux_fix(
} else {
(TmuxProbeResult::Unavailable, TmuxProbeResult::Unavailable)
};
let client_features = if wants(crate::diagnostics::TMUX_TRUECOLOR_ID) {
tmux.client_features()
} else {
TmuxProbeResult::Unavailable
};
TmuxProbeFacts {
version: TmuxProbeResult::Unavailable,
extended_keys,
@ -188,6 +213,7 @@ fn collect_tmux_fix(
allow_passthrough_support,
allow_passthrough,
control_mode: TmuxProbeResult::Unavailable,
client_features,
}
}
@ -267,6 +293,7 @@ fn unavailable_tmux() -> TmuxProbeFacts {
allow_passthrough_support: TmuxProbeResult::Unavailable,
allow_passthrough: TmuxProbeResult::Unavailable,
control_mode: TmuxProbeResult::Unavailable,
client_features: TmuxProbeResult::Unavailable,
}
}
@ -287,10 +314,13 @@ fn standalone_data_control(is_wayland: bool) -> TmuxProbeResult<bool> {
}
}
// Plumbing constructor: one argument per probe input feeding the snapshot.
#[allow(clippy::too_many_arguments)]
fn collect_common<'a>(
terminal: &'a TerminalContext,
runtime: TuiProbeEvidence<'a>,
control_mode: Option<bool>,
color_probe: ColorPassthroughProbe,
tmux: &dyn TmuxOptionQuery,
is_wayland: bool,
native_tool: Option<&str>,
@ -299,7 +329,7 @@ fn collect_common<'a>(
is_wayland && xai_grok_shell::util::clipboard::wayland_data_control_supported();
ProbeSnapshot {
terminal,
tmux: collect_tmux(terminal, control_mode, tmux),
tmux: collect_tmux(terminal, control_mode, color_probe, tmux),
wayland: WaylandProbeFacts {
is_wayland,
data_control: TmuxProbeResult::Available(data_control),
@ -319,17 +349,11 @@ fn startup_native_tool(
fn collect_tmux(
terminal: &TerminalContext,
control_mode: Option<bool>,
color_probe: ColorPassthroughProbe,
tmux: &dyn TmuxOptionQuery,
) -> TmuxProbeFacts {
if !terminal.is_tmux_backed() {
return TmuxProbeFacts {
version: TmuxProbeResult::Unavailable,
extended_keys: TmuxProbeResult::Unavailable,
set_clipboard: TmuxProbeResult::Unavailable,
allow_passthrough_support: TmuxProbeResult::Unavailable,
allow_passthrough: TmuxProbeResult::Unavailable,
control_mode: TmuxProbeResult::Unavailable,
};
return unavailable_tmux();
}
let allow_passthrough_support = tmux.option_support("allow-passthrough");
@ -356,6 +380,10 @@ fn collect_tmux(
control_mode: control_mode
.map(TmuxProbeResult::Available)
.unwrap_or_else(|| tmux.control_mode()),
client_features: match color_probe {
ColorPassthroughProbe::Run => tmux.client_features(),
ColorPassthroughProbe::Skip => TmuxProbeResult::Unavailable,
},
}
}
@ -395,6 +423,14 @@ mod tests {
self.calls.borrow_mut().push("control-mode".to_owned());
self.control_mode.clone()
}
fn client_features(&self) -> TmuxProbeResult<String> {
self.calls.borrow_mut().push("client-features".to_owned());
self.values
.get("client-features")
.cloned()
.unwrap_or(TmuxProbeResult::Unavailable)
}
}
fn runtime() -> TuiProbeEvidence<'static> {
@ -431,7 +467,15 @@ mod tests {
calls: RefCell::new(Vec::new()),
};
let snapshot = collect_common(&terminal, runtime(), Some(true), &fake, false, None);
let snapshot = collect_common(
&terminal,
runtime(),
Some(true),
ColorPassthroughProbe::Skip,
&fake,
false,
None,
);
assert_eq!(snapshot.tmux.control_mode, TmuxProbeResult::Available(true));
assert_eq!(
@ -462,7 +506,15 @@ mod tests {
control_mode: TmuxProbeResult::Available(true),
..empty_fake()
};
let snapshot = collect_common(&terminal, runtime(), None, &fake, false, None);
let snapshot = collect_common(
&terminal,
runtime(),
None,
ColorPassthroughProbe::Run,
&fake,
false,
None,
);
assert_eq!(snapshot.tmux.control_mode, TmuxProbeResult::Available(true));
assert_eq!(
@ -472,6 +524,7 @@ mod tests {
"extended-keys",
"set-clipboard",
"control-mode",
"client-features",
]
);
}
@ -483,7 +536,15 @@ mod tests {
control_mode: TmuxProbeResult::Error("must not run".to_owned()),
..empty_fake()
};
let snapshot = collect_common(&terminal, runtime(), None, &fake, false, None);
let snapshot = collect_common(
&terminal,
runtime(),
None,
ColorPassthroughProbe::Run,
&fake,
false,
None,
);
assert_eq!(snapshot.tmux.set_clipboard, TmuxProbeResult::Unavailable);
assert_eq!(snapshot.tmux.control_mode, TmuxProbeResult::Unavailable);