Files
Kigi-CLI/crates/codegen/kigi-tui/tests/pty_e2e_config_ui.rs
T
ZacharyZhang-NY 021b82443d M1/F1: Kimi Code OAuth device-code flow
Replace the xAI OAuth stack with the Kimi device authorization grant:
- kimi_oauth.rs wire layer (device_authorization + token poll + refresh
  against kigi_env::oauth_host(); client_id per PRD; retryable statuses
  429/5xx with backoff; expired_token restarts authorization)
- X-Msh-Device-{Name,Model,Id} headers; device_id minted uuid4-hex at
  ~/.kigi/device_id (0600)
- Storage: system keyring service `kigi`, entry `oauth/kimi-code`
  (macOS/Windows native backends), atomic-file fallback under ~/.kigi;
  official client's keyring/~/.kimi never touched
- Refresh manager: 60s tick, threshold max(300, expires_in*0.5),
  401-tombstone keyed by rejected refresh token with 300s cooldown and
  rotation auto-clear, cross-process lock with sibling-adoption
  triple-check, sleep/wake forced refresh
- Deleted xAI machinery: enterprise OIDC (PKCE/JWKS/teams), devbox login,
  external auth provider, JWT tier gating + subscription paywall stack,
  X-XAI-Token-Auth marker headers, ZDR gates, /user enrichment
- kigi login / TUI /login both drive the device flow; login-host display
  now derives from kigi_env::oauth_host()
- 264 auth unit/wiremock tests; live contract probe of
  auth.kimi.com/api/oauth/device_authorization matches the wire shapes

Gates: check/clippy --all-targets clean, fmt, deny ok, kigi-shell lib
5131 tests green.
2026-07-17 07:37:29 -04:00

55 lines
2.7 KiB
Rust

//! Models, settings, campaigns, tips, and modal PTY coverage.
//!
//! All cases are ignored for ordinary Cargo runs; Bazel opts in and caps this
//! process-heavy family at four concurrent libtest workers.
// Shared support intentionally serves all PTY family crates.
#[allow(dead_code, unused_imports)]
#[path = "pty_e2e/common.rs"]
mod common;
#[path = "pty_e2e/agent_type_mismatch_modal_on_model_switch.rs"]
mod agent_type_mismatch_modal_on_model_switch;
#[path = "pty_e2e/agent_type_mismatch_no_keeps_current_session.rs"]
mod agent_type_mismatch_no_keeps_current_session;
#[path = "pty_e2e/agent_type_mismatch_yes_starts_new_session.rs"]
mod agent_type_mismatch_yes_starts_new_session;
#[path = "pty_e2e/campaign_nudges_default_until_dismissed_by_model_pick.rs"]
mod campaign_nudges_default_until_dismissed_by_model_pick;
#[path = "pty_e2e/campaign_remote_settings_nudge_and_dismiss.rs"]
mod campaign_remote_settings_nudge_and_dismiss;
#[path = "pty_e2e/dashboard_overlay_tab_esc_backout_and_ctrl_backslash.rs"]
mod dashboard_overlay_tab_esc_backout_and_ctrl_backslash;
#[path = "pty_e2e/extensions_modal_copy_hints_pty.rs"]
mod extensions_modal_copy_hints_pty;
#[path = "pty_e2e/prompt_suggestion_ghost_tab_accepts.rs"]
mod prompt_suggestion_ghost_tab_accepts;
#[path = "pty_e2e/reasoning_efforts_fallback_menu_matches_builtin.rs"]
mod reasoning_efforts_fallback_menu_matches_builtin;
#[path = "pty_e2e/reasoning_efforts_from_config_toml_menu.rs"]
mod reasoning_efforts_from_config_toml_menu;
#[path = "pty_e2e/reasoning_efforts_menu_renders_and_remaps_on_wire.rs"]
mod reasoning_efforts_menu_renders_and_remaps_on_wire;
#[path = "pty_e2e/reverse_agent_type_mismatch_cursor_to_default.rs"]
mod reverse_agent_type_mismatch_cursor_to_default;
#[path = "pty_e2e/same_agent_type_switch_no_modal.rs"]
mod same_agent_type_switch_no_modal;
#[path = "pty_e2e/show_thinking_blocks_toggle_hides_existing_pty.rs"]
mod show_thinking_blocks_toggle_hides_existing_pty;
#[path = "pty_e2e/undo_tip_resets_each_new_session.rs"]
mod undo_tip_resets_each_new_session;
#[path = "pty_e2e/undo_tip_seen_count_never_persisted.rs"]
mod undo_tip_seen_count_never_persisted;
#[path = "pty_e2e/undo_tip_session_cap_blocks_fourth_show.rs"]
mod undo_tip_session_cap_blocks_fourth_show;
#[path = "pty_e2e/verb_group_fold_expand_collapse_pty.rs"]
mod verb_group_fold_expand_collapse_pty;
#[path = "pty_e2e/verb_group_settings_toggle_pty.rs"]
mod verb_group_settings_toggle_pty;
#[path = "pty_e2e/verb_group_streaming_fold_pty.rs"]
mod verb_group_streaming_fold_pty;
#[path = "pty_e2e/verb_group_thinking_fold_pty.rs"]
mod verb_group_thinking_fold_pty;
#[path = "pty_e2e/zero_turn_model_switch_no_modal.rs"]
mod zero_turn_model_switch_no_modal;