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:
@@ -321,9 +321,6 @@ pub struct AcpPrompter {
|
||||
/// at decision-time through it. `EventWriter::noop()` when events recording
|
||||
/// is disabled (the default for the permission scaffolding's own tests).
|
||||
event_writer: EventWriter,
|
||||
/// Server permission transport: when set, [`request`](Self::request) asks chat for the
|
||||
/// decision over the server; `None` keeps the local prompt.
|
||||
hub_permission: Option<Arc<dyn crate::permission::PermissionHookTransport>>,
|
||||
/// When `false` (default, fail-safe), the per-tool "Always allow …" options
|
||||
/// are stripped (see [`REMEMBER_TOOL_APPROVALS_GATED_IDS`]).
|
||||
remember_tool_approvals: bool,
|
||||
@@ -496,7 +493,6 @@ impl AcpPrompter {
|
||||
// must NOT double-emit. A workspace-server-side caller that owns the
|
||||
// per-session `events.jsonl` opts in via [`with_event_writer`].
|
||||
event_writer: EventWriter::noop(),
|
||||
hub_permission: None,
|
||||
// Fail-safe default; opt in via `with_remember_tool_approvals`.
|
||||
remember_tool_approvals: false,
|
||||
}
|
||||
@@ -509,16 +505,6 @@ impl AcpPrompter {
|
||||
self
|
||||
}
|
||||
|
||||
/// Route the permission prompt to chat over the server when `Some`;
|
||||
/// `None` keeps the local prompt.
|
||||
pub fn with_hub_permission(
|
||||
mut self,
|
||||
hub_permission: Option<Arc<dyn crate::permission::PermissionHookTransport>>,
|
||||
) -> Self {
|
||||
self.hub_permission = hub_permission;
|
||||
self
|
||||
}
|
||||
|
||||
/// Attach a per-session `events.jsonl` writer so [`request`](Self::request)
|
||||
/// records `PermissionRequested` / `PermissionResolved`. Used by the
|
||||
/// workspace-server permission path (which owns the session log); the shell
|
||||
@@ -737,41 +723,29 @@ impl AcpPrompter {
|
||||
prompt_start,
|
||||
};
|
||||
|
||||
let outcome = match &self.hub_permission {
|
||||
// Route the prompt to chat over the server (see
|
||||
// `ToolServerPermissionTransport` for the await/release contract).
|
||||
Some(transport) => {
|
||||
crate::permission::hub_permission::request_permission_via_hub(
|
||||
transport.as_ref(),
|
||||
access,
|
||||
tool_call_update.tool_call_id.0.as_ref(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
None => {
|
||||
let permission_options = self.build_options(access);
|
||||
let req = acp::RequestPermissionRequest::new(
|
||||
self.session_id.clone(),
|
||||
tool_call_update.clone(),
|
||||
permission_options.values().cloned().collect(),
|
||||
)
|
||||
.meta(self.bash_selection_meta(access));
|
||||
match self.gateway.request_permission(req).await {
|
||||
Ok(resp) => match resp.outcome {
|
||||
acp::RequestPermissionOutcome::Cancelled => PromptOutcome::Cancelled,
|
||||
acp::RequestPermissionOutcome::Selected(selected) => map_selected_outcome(
|
||||
&permission_options,
|
||||
&selected.option_id,
|
||||
resp.meta.as_ref(),
|
||||
access,
|
||||
),
|
||||
// TODO(acp-0.10): `RequestPermissionOutcome` is #[non_exhaustive].
|
||||
_ => PromptOutcome::Error("unknown permission outcome".to_owned()),
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!(?e, "failed to request permission");
|
||||
PromptOutcome::Error("failed to request permission".to_owned())
|
||||
}
|
||||
let outcome = {
|
||||
let permission_options = self.build_options(access);
|
||||
let req = acp::RequestPermissionRequest::new(
|
||||
self.session_id.clone(),
|
||||
tool_call_update.clone(),
|
||||
permission_options.values().cloned().collect(),
|
||||
)
|
||||
.meta(self.bash_selection_meta(access));
|
||||
match self.gateway.request_permission(req).await {
|
||||
Ok(resp) => match resp.outcome {
|
||||
acp::RequestPermissionOutcome::Cancelled => PromptOutcome::Cancelled,
|
||||
acp::RequestPermissionOutcome::Selected(selected) => map_selected_outcome(
|
||||
&permission_options,
|
||||
&selected.option_id,
|
||||
resp.meta.as_ref(),
|
||||
access,
|
||||
),
|
||||
// TODO(acp-0.10): `RequestPermissionOutcome` is #[non_exhaustive].
|
||||
_ => PromptOutcome::Error("unknown permission outcome".to_owned()),
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!(?e, "failed to request permission");
|
||||
PromptOutcome::Error("failed to request permission".to_owned())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user