Synced from monorepo

Synced from monorepo

Changes:
- Workspace server: report `/ready` as failed with dwell on hub connect failure
- Refresh OIDC token for the Grok agent in the shell
- ACP terminal output recorder
- Cross-platform provider auth commands in the shell
- Default `/resume` to Grok sessions with a hint for hidden external sessions
- Resume sessions by title with `--resume`
- Limit app-builder archive size
- Data-driven tag labels for slash commands
- Doctor fixes for tmux
- Custom provider gateways and subprocess environment policy in the shell
- `/tutorial` — opt-in onboarding tour of Grok Build
- Soft and required CLI version checks in the shell
- Privacy banner env overrides survive live settings updates
- Add remote flag to override the image-edit model
- Return profile fields from auth info even when the access token is expired
- Add edit control on queued prompt rows
- Keep fail-closed policy when clearing orphans with no team
- Setting to disable the Ctrl+Space/F8 voice shortcut
- Pass `--raw` to pw-record so Linux dictation works on older PipeWire
- Validate git URLs when adding marketplace entries
- Stop shipping stale tool-doc parameter and tool names
- Re-point dashboard attach after `/fork` only when the parent was attached
- Surface Grok Computer media-generation results as file-path chunks
- Clear web background-task tray on kill and keep the task description
- Show privacy upsell banner in agent view until acted on
- Add tools-server client callback surface
- Protect persistent global hook sources

Source-Revision: 95d84f443eddcbed6cbfd6eed22e2eafe6b3939d
This commit is contained in:
grokkybara[bot] 2026-07-23 17:12:33 +00:00
commit 69f0ba880a
286 changed files with 22939 additions and 9624 deletions

View file

@ -3,7 +3,7 @@ use std::path::Path;
use anyhow::Result;
use crate::diagnostics::{DiagnosticReport, FixPlan, FixStatus, ShellKind};
use crate::diagnostics::{DiagnosticReport, FixActivation, FixPlan, ShellKind};
mod human;
mod json;
@ -28,7 +28,7 @@ pub enum DoctorCommand {
#[derive(Clone, Debug, Eq, PartialEq, clap::Args)]
pub struct FixArgs {
/// Fix to apply. Use `ssh-wrap` or `terminal.ssh-wrap`. Omit it to list available automatic fixes.
/// Named fix to apply. Omit it to list available automatic fixes.
pub id: Option<String>,
/// Apply the displayed changes without confirmation.
#[arg(long, requires = "id")]
@ -106,11 +106,13 @@ fn run_fix(
writer: &mut impl Write,
) -> Result<()> {
let terminal = crate::terminal::standalone_terminal_context();
let report = configured_report_for_terminal(
collect_report_with(crate::diagnostics::probes::collect_standalone(&terminal)),
&terminal,
);
let Some(value) = args.id.as_deref() else {
let report = configured_report_for_terminal(
collect_report_with(crate::diagnostics::probes::collect_standalone_fix(
&terminal, None,
)),
&terminal,
);
write!(
writer,
"{}",
@ -119,6 +121,13 @@ fn run_fix(
return Ok(());
};
let id = crate::diagnostics::resolve_fix_id(value)?;
let report = configured_report_for_terminal(
collect_report_with(crate::diagnostics::probes::collect_standalone_fix(
&terminal,
Some(id),
)),
&terminal,
);
let request = crate::diagnostics::FixRequest::from_environment(id)?;
let plan = crate::diagnostics::plan_fix(request, &report, &terminal)?;
apply_fix_plan(args, stdin_is_terminal, input, writer, &terminal, plan)
@ -150,39 +159,36 @@ fn apply_fix_plan(
}
}
let shell = plan.shell;
let outcome = crate::diagnostics::apply_fix(plan)?;
let post_report = crate::diagnostics::configured_report(
collect_report_with(crate::diagnostics::probes::collect_standalone(terminal)),
crate::diagnostics::managed_alias_configured(&outcome.changed_path, shell),
);
if post_report
.findings
.iter()
.any(|finding| finding.id == outcome.id)
{
if outcome.activation() == FixActivation::SatisfiedNow {
// Use the shell stored on the outcome (from planning), not `$SHELL`.
// `$SHELL` may be missing or no longer match the shell the plan targeted.
let post_report = crate::diagnostics::configured_report(
collect_report_with(crate::diagnostics::probes::collect_standalone(terminal)),
outcome.managed_alias_is_configured(),
);
if post_report
.findings
.iter()
.any(|finding| finding.id == outcome.id())
{
anyhow::bail!(
"The change was applied, but Doctor still reports `{}`.",
outcome.id()
);
}
} else if !crate::diagnostics::verify_persistent_fix(&outcome) {
anyhow::bail!(
"The change was applied, but Doctor still reports `{}`.",
outcome.id
"The change was applied, but Doctor could not verify `{}` in persistent configuration.",
outcome.id()
);
}
match outcome.status {
FixStatus::Applied => writeln!(
writer,
"\nSet up SSH wrapping in {}.",
outcome.changed_path.display()
)?,
FixStatus::AlreadyConfigured => writeln!(
writer,
"\nSSH wrapping is already set up in {}.",
outcome.changed_path.display()
)?,
}
if let Some(backup) = outcome.backup_path {
writeln!(writer, "Backup: {}", backup.display())?;
}
writeln!(writer, "Start a new shell to use the alias.")?;
writeln!(
writer,
"\n{}",
crate::diagnostics::format_fix_success(&outcome)
)?;
Ok(())
}

View file

@ -41,12 +41,14 @@ fn local_terminal() -> TerminalContext {
}
fn ssh_wrap_fix_request(home: &std::path::Path) -> crate::diagnostics::FixRequest {
crate::diagnostics::FixRequest {
id: crate::diagnostics::SSH_WRAP_ID,
home: home.to_path_buf(),
shell: Some(std::path::PathBuf::from("/bin/bash")),
validator: None,
}
crate::diagnostics::FixRequest::new_for_test(
crate::diagnostics::SSH_WRAP_ID,
home,
Some(std::path::PathBuf::from("/bin/bash")),
None,
None,
)
.unwrap()
}
static TMUX_ROUTE: ClipboardRoute = ClipboardRoute {
@ -96,6 +98,12 @@ fn healthy_report() -> DiagnosticReport {
multiplexer: MultiplexerKind::Undetected,
byobu: None,
ssh: false,
tmux: crate::diagnostics::TmuxFacts {
extended_keys: crate::diagnostics::TmuxOptionFact::Unavailable,
set_clipboard: crate::diagnostics::TmuxOptionFact::Unavailable,
allow_passthrough_support: crate::diagnostics::TmuxSupportFact::Unavailable,
allow_passthrough: crate::diagnostics::TmuxOptionFact::Unavailable,
},
color: ColorFacts {
level: RuntimeFact::Available(ColorLevel::TrueColor),
available_themes: ThemeKind::ALL.to_vec(),
@ -156,7 +164,9 @@ fn mixed_report() -> DiagnosticReport {
fix: "set -g set-clipboard on".to_owned(),
config_path: Some("~/.tmux.conf".to_owned()),
}),
automatic_remediation: None,
automatic_remediation: crate::diagnostics::automatic_remediation_for(
DiagnosticId::new("terminal", "tmux-clipboard"),
),
note: Some("Reload tmux after editing.".to_owned()),
},
DiagnosticFinding {
@ -487,6 +497,7 @@ fn human_mixed_fixture_is_exact() {
"\n",
"Findings\n",
" ! terminal.tmux-clipboard OSC 52 clipboard passthrough is disabled\n",
" → Automatic setup: `grok doctor fix tmux-clipboard`\n",
" → Add `set -g set-clipboard on` to ~/.tmux.conf\n",
" Reload tmux after editing.\n",
" i terminal.ssh-wrap Use local SSH wrapping\n",
@ -749,7 +760,10 @@ fn json_contract_is_structural_stable_ordered_and_ansi_free() {
"fix": "set -g set-clipboard on",
"configPath": "~/.tmux.conf"
},
"automaticRemediation": null,
"automaticRemediation": {
"fixId": "terminal.tmux-clipboard",
"command": "grok doctor fix terminal.tmux-clipboard"
},
"note": "Reload tmux after editing."
},
{