F3: Kimi inference pipeline + full grok cloud-surface excision
Sampler / inference (PRD F3):
- kimi_compat.rs: single adaptation point for the Kimi chat/completions
dialect (thinking-field mapping, model_id stripping, empty-content
tool-call message fix, stream_options.include_usage), with kimi-cli
source citations
- Rate-limit handling reworked for Kimi/Moonshot semantics; UA kigi/{version}
- /models replaces the xAI models-v2 endpoint everywhere; idle model
refresh carries X-Msh-* device headers only (X-XAI-Token-Auth and
x-grok-client-mode/CLIENT_MODE_HEADER machinery deleted)
Cloud-surface excision (PRD §5, zero-egress):
- remote/ conversations lane, cli-chat-proxy-types crate, prod/ dir,
share command, credit bar: deleted (single local session lane;
paginate() replaces merge_and_paginate)
- Subscription/tier gate stack deleted end-to-end: AppView
gate/tier/team/ZDR fields, app/subscription.rs watch loop,
dispatch/billing.rs paywall + SuperGrok upsell, free-usage-exhausted
chain, tier-restricted commands, GateInfo, RemoteSettings gate fields,
SettingsUpdateNotification gate fields
- /privacy + coding-data-sharing setting deleted (backed by a dead xAI
RPC; Kigi is zero-egress — nothing to share or retain remotely)
Auth UX correctness (user-reported):
- Device-flow fixtures now mirror the live Kimi payload shape
(https://www.kimi.com/code/authorize_device?user_code=..., verified
against auth.kimi.com); the fabricated auth.kimi.com/device?code=...
URLs are gone
- open_browser_detached is a no-op under cfg(test): unit tests drove
wiremock fixture URLs into the real browser (root cause of the
"garbage mock link" ABCD-1234 tabs)
- Welcome/pager-minimal rebrand: Grok Build -> Kigi, grok.com ->
kimi.com, "Sign in to Grok" -> "Sign in to Kimi"
This commit is contained in:
@@ -48,7 +48,7 @@ pub(super) fn ensure_dashboard_state(app: &mut AppView) {
|
||||
state.adopt_slash_mru(app.slash_mru.clone());
|
||||
state.set_screen_mode(app.screen_mode);
|
||||
state.set_recap_visible(app.session_recap_available);
|
||||
state.set_restricted_commands(&app.tier_restricted_commands);
|
||||
state.set_restricted_commands(&[]);
|
||||
app.dashboard = Some(state);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ pub(super) fn dispatch_open_dashboard(app: &mut AppView) -> Vec<Effect> {
|
||||
// Subsequent reopen — just gc dead ids; in-memory state stays.
|
||||
d.gc_stale_refs(&dashboard_alive_fn(&app.agents));
|
||||
d.set_recap_visible(app.session_recap_available);
|
||||
d.set_restricted_commands(&app.tier_restricted_commands);
|
||||
d.set_restricted_commands(&[]);
|
||||
}
|
||||
// Refresh each local agent's git context (branch / worktree / label)
|
||||
// from disk so the row subtitles show the LATEST branch and worktree
|
||||
@@ -1207,7 +1207,6 @@ pub(super) fn dispatch_dashboard_dispatch_slash(app: &mut AppView, text: String)
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let coding_data_sharing_opt_out_from_app = app.coding_data_retention_opt_out;
|
||||
let show_tips_from_app = app.show_tips;
|
||||
let auto_update_from_app = app.auto_update;
|
||||
let respect_manual_folds_from_app = app.appearance.scrollback.scroll.respect_manual_folds;
|
||||
@@ -1231,23 +1230,6 @@ pub(super) fn dispatch_dashboard_dispatch_slash(app: &mut AppView, text: String)
|
||||
};
|
||||
let reg = dashboard.dispatch.slash_controller.registry();
|
||||
|
||||
// Tier-restricted commands stay visible for discoverability but must
|
||||
// not execute — and must not fall through to the unknown-command
|
||||
// path below (which would spawn a session with the raw slash text as
|
||||
// its first prompt). The dashboard has no question-modal surface, so
|
||||
// upsell via the feedback toast.
|
||||
if reg.is_restricted(invocation.token) {
|
||||
let token = invocation.token.to_string();
|
||||
if let Some(d) = app.dashboard.as_mut() {
|
||||
d.dispatch.set_text("");
|
||||
d.set_error_toast(&format!(
|
||||
"/{token} requires SuperGrok — upgrade at {}",
|
||||
super::billing::UPSELL_URL_UPGRADE
|
||||
));
|
||||
}
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let Some(command) = reg.get(invocation.token).cloned() else {
|
||||
// Unknown command. Fall back to the regular dispatch
|
||||
// path so the text becomes a new session's prompt.
|
||||
@@ -1295,7 +1277,6 @@ pub(super) fn dispatch_dashboard_dispatch_slash(app: &mut AppView, text: String)
|
||||
.iter()
|
||||
.map(|(id, info)| (info.name.clone(), id.clone()))
|
||||
.collect(),
|
||||
coding_data_sharing_opt_out: coding_data_sharing_opt_out_from_app,
|
||||
plan_mode_active: false,
|
||||
show_tips: show_tips_from_app,
|
||||
auto_update: auto_update_from_app,
|
||||
|
||||
Reference in New Issue
Block a user