Synced from monorepo

Synced from monorepo

Changes:
- Workspace server: surface preview-proxy metrics through the hub metric pump
- Shell: reclaim a session’s retained state in one entry
- Shell: reclaim a session’s resident state in one entry
- Pager: withhold key event types from Alacritty builds that double keys
- Tools: cancel a session’s subagents when it closes
- Pager: keep the whole plan in scrollback and separate reasoning from output in minimal mode
- Pager: probe terminal version over DA2 and include it with feedback
- SuperGrok Plus: identity, CLI, and analytics tier surfaces
- Shell: inherit the session process scope into subagents
- Pager: build @-file-search matcher lazily on first use
- Tools: fix description and output contradictions in tool definitions
- Workspace: degrade @-file-search instead of aborting on thread exhaustion
- Tools: reap a session’s LSP servers when it closes
- Tools: fix contradictions and defects in tool descriptions, schemas, and harness pools
- MCP: reap stdio MCP children on session close
- Shell: reuse spawn-time skill discovery for session telemetry
- Tools: stop leaking shell-wrapper positional params into sourced scripts (fixes activate_conda under persistent/static shell)
- Shell: self-heal corrupt session-search SQLite cache
- Workspace: cap workspace-server tokio workers on many-core hosts
- Shell: reap a session’s child processes when it closes
- Crash handler: capture SIGABRT so panic-aborts leave crash reports
- CLI chat proxy: team-scoped Grok Code managed-config admin routes
- MCP: add CLI enable/disable for MCP servers
- Shell: cap tokio worker threads for startup thread demand
- Workspace: harden git_commit and add git_sync_base operation
- Circuit breaker: add feature-gated gRPC retry policy

Source-Revision: 2a818575225183d8ca915f5632a09b8067b5156a
This commit is contained in:
grokkybara[bot] 2026-07-28 22:50:19 +00:00
commit 5da6962e4a
192 changed files with 10337 additions and 3421 deletions

View file

@ -5270,51 +5270,23 @@ fn default_selected_permission_mouse_click_on_indicator_opens_picker_in_one_clic
}
}
/// The `/privacy` slash command's argument parser
/// is case-insensitive and supports a deliberately-pared-down list of
/// unambiguous-semantic aliases. The unit-level coverage lives in the
/// slash command module; this e2e test pins the integration contract
/// (the parser is reachable from the slash command and produces the
/// expected `Action`).
///
/// Ambiguous aliases
/// (`on/off/true/false/enable/disable`) were DROPPED because they
/// could be read either as "turn on privacy" (=opt-out) or "turn on
/// sharing" (=opt-in). For a privacy-critical setting we err on the
/// side of explicit, unambiguous arguments. The test below verifies
/// both the accept list AND the reject list.
/// `/privacy` takes no arguments: it opens the settings page and nothing
/// else. The alias parser it used to carry (`opt-in`, `share`, `out`, …) is
/// gone — a one-word prompt alias could flip a privacy preference with none
/// of the disclosure copy in front of the user, and the ambiguous forms
/// (`on`/`off`) risked landing on the opposite of the intent.
#[test]
fn pr9_privacy_slash_command_parses_aliases() {
use xai_grok_pager::slash::commands::privacy::parse_privacy_arg;
fn pr9_privacy_slash_command_takes_no_arguments() {
use xai_grok_pager::slash::commands::builtin_commands;
use xai_grok_pager::slash::registry::CommandRegistry;
// Canonical names.
assert_eq!(parse_privacy_arg("opt-in"), Some(true));
assert_eq!(parse_privacy_arg("opt-out"), Some(false));
// Case-insensitive (sample).
assert_eq!(parse_privacy_arg("Opt-In"), Some(true));
assert_eq!(parse_privacy_arg("OPT-OUT"), Some(false));
// Unambiguous-semantic aliases (pruned list).
assert_eq!(parse_privacy_arg("in"), Some(true));
assert_eq!(parse_privacy_arg("out"), Some(false));
assert_eq!(parse_privacy_arg("share"), Some(true));
assert_eq!(parse_privacy_arg("private"), Some(false));
// Ambiguous aliases MUST be rejected. `/privacy on`
// could be read as "turn on privacy" (=opt-out, the OPPOSITE of
// what an earlier mapping returned). For a privacy
// setting, ambiguity = silent data-exfiltration risk.
for ambiguous in &["on", "off", "true", "false", "enable", "disable"] {
assert_eq!(
parse_privacy_arg(ambiguous),
None,
"ambiguous alias `{ambiguous}` MUST be rejected (PR 9 R1, Security Issue 10)",
);
}
// Unknown.
assert_eq!(parse_privacy_arg("maybe"), None);
let reg = CommandRegistry::new(builtin_commands());
let cmd = reg.get("privacy").expect("/privacy must be registered");
assert!(
!cmd.takes_args(),
"/privacy must not advertise an argument slot"
);
assert_eq!(cmd.usage(), "/privacy");
}
// ---------------------------------------------------------------------------