M2 audit: excise the Computer Hub stack — Kigi's last remote-cloud surface
Removed root-and-branch for the zero-egress guarantee (the hub was xAI's remote-workspace/cloud-sandbox service): - Crates deleted: kigi-computer-hub-core, kigi-computer-hub-sdk, kigi-computer-hub-mcp-adapter, kigi-workspace-client (hub-proxied workspace RPC client), and kigi-tracing (its sole network path was the OTLP gRPC exporter; zero consumers remained). kigi-tracing-macros (purely local) stays. - kigi-workspace: every hub surface deleted — hub server/channel/auth, HITL-over-hub permissions, donation/metrics pumps, file upload RPCs, hub tool-snapshot merge (resolve pipeline is MCP-only now), WorkspaceOps::Proxy. Local worktrees, sessions, leader IPC, MCP, and the ACP permission prompt path are untouched; LocalRegistry re-homed into kigi-tool-runtime on the existing ToolDyn types so in-process tool dispatch is unchanged. - kigi-shell: leader workspace-exposure control surface (incl. the wss://computer-hub... URL), [hub] config, ObservabilityBridge, hub WebSocket proxy, dead OTLP config knobs. ClientMode::Headless (never constructed) removed. - kigi-tui/bin: hidden `kigi workspace` command removed (`kigi worktree` stays). - Renames: --xai-api-base-url → --api-base-url / KIGI_API_BASE_URL / [endpoints] api_base_url (serde alias keeps old configs working; the flag feeds BYOK/custom-endpoint routing, not main inference); grok_version → kigi_version in inspect/models-cache/trace metadata (old caches self-heal via version-mismatch refetch). - Dependency tree: dropped fastrace*, opentelemetry-otlp/http/proto, tokio-tungstenite from the workspace; fixed the 4 real useless_format violations the fastrace lint allowance was masking and removed the allowance. - marketplaceAllowlist kept: it gates the LOCAL plugin-marketplace feature, not an xAI service. Known §9 leftover (deliberate, for the M3 sweep): the BYOK default base URL string. Gates: workspace check/clippy 0/0, fmt, deny ok; suites green (workspace 1042, shell 4918, tui 6634, tools 2608, tool-runtime 47, mcp 154).
This commit is contained in:
@@ -175,9 +175,6 @@ pub async fn connect(cancel: &CancellationToken, flags: ConnectFlags) -> Result<
|
||||
if let Some(effort) = flags.reasoning_effort_override {
|
||||
agent_config.reasoning_effort_override = Some(effort);
|
||||
}
|
||||
// Agent connect intentionally leaves hub URL unset; provider hub is
|
||||
// WorkspaceStartArgs only.
|
||||
|
||||
if !flags.permission_rules.is_empty() {
|
||||
agent_config.cli_agent_overrides.permission_rules = flags.permission_rules.clone();
|
||||
}
|
||||
|
||||
@@ -110,12 +110,6 @@ See ~/.kigi/README.md for more information.
|
||||
},
|
||||
/// Manage git worktrees
|
||||
Worktree(crate::worktree_cmd::WorktreeArgs),
|
||||
/// Expose this workspace to the Computer Hub (via the leader).
|
||||
///
|
||||
/// Disabled by default and enabled server-side per account; set
|
||||
/// `KIGI_WORKSPACE_COMMAND=1` to enable it locally for testing.
|
||||
#[command(hide = true)]
|
||||
Workspace(WorkspaceMgmtArgs),
|
||||
/// Open the Agent Dashboard view at startup.
|
||||
///
|
||||
/// Centralised, agent-native overview of every session (top-level and
|
||||
@@ -138,7 +132,7 @@ pub struct WrapArgs {
|
||||
)]
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
/// Targets a running leader process by PID (used by `kigi leader` / `kigi workspace`).
|
||||
/// Targets a running leader process by PID (used by `kigi leader`).
|
||||
#[derive(Debug, clap::Args, Clone, Default)]
|
||||
pub struct LeaderTargetArgs {
|
||||
/// Leader process ID from `kigi leader list`.
|
||||
@@ -169,69 +163,6 @@ pub enum LeaderMgmtCommand {
|
||||
/// Stop all running leader processes
|
||||
Kill,
|
||||
}
|
||||
#[derive(Debug, clap::Args, Clone)]
|
||||
pub struct WorkspaceMgmtArgs {
|
||||
#[command(subcommand)]
|
||||
pub command: WorkspaceMgmtCommand,
|
||||
}
|
||||
#[derive(Debug, Subcommand, Clone)]
|
||||
pub enum WorkspaceMgmtCommand {
|
||||
/// Start (or update) the workspace→hub exposure.
|
||||
Start(WorkspaceStartArgs),
|
||||
/// Drain and disconnect from the hub, keeping the exposure warm.
|
||||
Pause {
|
||||
#[command(flatten)]
|
||||
target: LeaderTargetArgs,
|
||||
/// Emit machine-readable JSON output.
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
/// Reconnect a paused exposure to the hub.
|
||||
Resume {
|
||||
#[command(flatten)]
|
||||
target: LeaderTargetArgs,
|
||||
/// Emit machine-readable JSON output.
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
/// Stop exposing the workspace (the leader keeps running).
|
||||
Stop {
|
||||
#[command(flatten)]
|
||||
target: LeaderTargetArgs,
|
||||
/// Emit machine-readable JSON output.
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
/// Restart the exposure (stop, then start with the given options).
|
||||
Restart(WorkspaceStartArgs),
|
||||
/// Show the current workspace-exposure status.
|
||||
#[command(visible_alias = "list")]
|
||||
Status {
|
||||
#[command(flatten)]
|
||||
target: LeaderTargetArgs,
|
||||
/// Emit machine-readable JSON output.
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
}
|
||||
#[derive(Debug, clap::Args, Clone)]
|
||||
pub struct WorkspaceStartArgs {
|
||||
/// Computer Hub WebSocket URL (default: `[hub].url`, then the prod hub).
|
||||
#[arg(long, value_name = "URL")]
|
||||
pub hub_url: Option<String>,
|
||||
/// Workspace root directory to expose. Defaults to the current directory.
|
||||
#[arg(long, value_name = "DIR", value_hint = ValueHint::DirPath)]
|
||||
pub cwd: Option<PathBuf>,
|
||||
/// Force leader mode for this command, overriding config.
|
||||
#[arg(long, conflicts_with = "no_leader")]
|
||||
pub leader: bool,
|
||||
/// Refuse to start even when config enables leader mode.
|
||||
#[arg(long, conflicts_with = "leader")]
|
||||
pub no_leader: bool,
|
||||
/// Emit machine-readable JSON output.
|
||||
#[arg(long)]
|
||||
pub json: bool,
|
||||
}
|
||||
/// Arguments for the `agent` subcommand.
|
||||
#[derive(Debug, clap::Args, Clone)]
|
||||
pub struct AgentArgs {
|
||||
@@ -276,9 +207,9 @@ pub struct AgentArgs {
|
||||
/// Override the CLI chat proxy base URL.
|
||||
#[arg(long = "coding-api-base-url")]
|
||||
pub coding_api_base_url: Option<String>,
|
||||
/// Override the public xAI API base URL.
|
||||
#[arg(long = "xai-api-base-url")]
|
||||
pub xai_api_base_url: Option<String>,
|
||||
/// Override the direct (BYOK / external-API-key) API base URL.
|
||||
#[arg(long = "api-base-url")]
|
||||
pub api_base_url: Option<String>,
|
||||
/// Agent runtime mode. Optional: bare `kigi agent` (and the `kigi acp`
|
||||
/// alias) default to stdio.
|
||||
#[command(subcommand)]
|
||||
|
||||
@@ -1619,7 +1619,7 @@ fn sanitize_user_error_strips_auth_prefixes() {
|
||||
#[test]
|
||||
fn sanitize_user_error_collapses_disk_full() {
|
||||
assert_eq!(
|
||||
sanitize_user_error("couldn't create worktree: Internal error: \"hub error: Worktree creation failed: not enough free disk space\""),
|
||||
sanitize_user_error("couldn't create worktree: Internal error: \"workspace error: Worktree creation failed: not enough free disk space\""),
|
||||
"Out of disk space."
|
||||
);
|
||||
assert_eq!(
|
||||
|
||||
@@ -318,7 +318,7 @@ impl PagerLeaderCluster {
|
||||
let env = vec![
|
||||
crate::test_util::EnvVarGuard::set("KIGI_SHARE_DIR", kigi_home.path()),
|
||||
crate::test_util::EnvVarGuard::set("KIGI_CODE_BASE_URL", server.url()),
|
||||
crate::test_util::EnvVarGuard::set("KIGI_XAI_API_BASE_URL", server.url()),
|
||||
crate::test_util::EnvVarGuard::set("KIGI_API_BASE_URL", server.url()),
|
||||
crate::test_util::EnvVarGuard::set("XAI_API_KEY", "test-key-for-ci"),
|
||||
crate::test_util::EnvVarGuard::set("KIGI_TELEMETRY_ENABLED", "false"),
|
||||
crate::test_util::EnvVarGuard::set("KIGI_FEEDBACK_ENABLED", "false"),
|
||||
|
||||
@@ -48,7 +48,6 @@ pub use cli::{
|
||||
AgentArgs, AgentCmd, Command, LeaderArgs, LeaderMgmtArgs, LeaderMgmtCommand, LeaderTargetArgs,
|
||||
OutputFormat, PagerArgs, ServeArgs, WrapArgs,
|
||||
};
|
||||
pub use cli::{WorkspaceMgmtArgs, WorkspaceMgmtCommand, WorkspaceStartArgs};
|
||||
use crossterm::cursor::{self, SetCursorStyle};
|
||||
use crossterm::event;
|
||||
use crossterm::execute;
|
||||
|
||||
@@ -888,9 +888,6 @@ pub async fn run_single_turn(
|
||||
None,
|
||||
);
|
||||
|
||||
// No agent-level hub client URL (gateway-only cloud; workspace provider
|
||||
// hub_url lives on `grok workspace` / WorkspaceStartArgs only).
|
||||
|
||||
apply_agent_flag(&options.agent, &mut agent_config);
|
||||
|
||||
if let Some(ref json) = options.agents_json {
|
||||
|
||||
@@ -54,7 +54,7 @@ pub fn build_session_tar(session_dir: &Path, session_id: &str) -> Result<Vec<u8>
|
||||
|
||||
let metadata = ExportMetadata {
|
||||
session_id: session_id.to_owned(),
|
||||
grok_version: env!("VERSION_WITH_COMMIT").to_owned(),
|
||||
kigi_version: env!("VERSION_WITH_COMMIT").to_owned(),
|
||||
os: std::env::consts::OS.to_owned(),
|
||||
arch: std::env::consts::ARCH.to_owned(),
|
||||
exported_at: chrono::Utc::now().to_rfc3339(),
|
||||
@@ -86,7 +86,7 @@ pub fn build_session_tar(session_dir: &Path, session_id: &str) -> Result<Vec<u8>
|
||||
#[derive(serde::Serialize)]
|
||||
struct ExportMetadata {
|
||||
session_id: String,
|
||||
grok_version: String,
|
||||
kigi_version: String,
|
||||
os: String,
|
||||
arch: String,
|
||||
exported_at: String,
|
||||
|
||||
Reference in New Issue
Block a user