Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36b9bd7

Browse files
author
李杰
committed
release: v0.22.1
1 parent 9b8fa48 commit 36b9bd7

59 files changed

Lines changed: 3214 additions & 649 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ All notable changes to Cockpit Tools will be documented in this file.
66

77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

9+
---
10+
## [0.22.1] - 2026-04-18
11+
12+
### Added
13+
- **Account overview pages now support platform-scoped filter persistence (disabled by default)**: Quick Settings adds a `Remember overview filters (except search)` toggle, and when enabled the app persists per-platform view mode, tag/group filters, and sort preferences.
14+
- **Backend OAuth token keeper is now enabled for long-running desktop sessions**: Cockpit starts a periodic token keepalive worker on app startup and refreshes near-expiry OAuth tokens across supported providers with backoff and tray-state refresh hooks.
15+
16+
### Changed
17+
- **Antigravity auto-switch now supports Credits threshold triggers in addition to quota thresholds**: Settings and Quick Settings add Credits monitoring controls, trigger reasons now include credits context, and candidate ranking now prefers higher quota then higher remaining Credits.
18+
- **Codex API Service card now stays fixed as the first entry card across overview layouts**: the service card no longer gets split into a separate region, empty-state actions now use a centered `Add Account` CTA, and plan badges in the member picker are aligned with account-page badge styling.
19+
920
---
1021
## [0.22.0] - 2026-04-18
1122

CHANGELOG.zh-CN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66

77
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)
88

9+
---
10+
## [0.22.1] - 2026-04-18
11+
12+
### 新增
13+
- **账号总览页现已支持按平台维度的筛选记忆(默认关闭)**:快捷设置新增“记住账号总览筛选(不含搜索)”开关;开启后,会按平台持久化视图模式、标签/分组筛选与排序偏好。
14+
- **桌面端长时间运行场景现已启用后端 OAuth Token 保活**:应用启动后会启动周期性保活任务,对即将过期的各平台 OAuth Token 执行刷新,并带失败退避与托盘状态刷新联动。
15+
16+
### 变更
17+
- **Antigravity 自动切号现已在配额阈值之外新增 Credits 阈值触发能力**:设置页与快捷设置新增 Credits 监控选项,自动切号原因会展示 Credits 上下文,候选排序调整为先看配额再看剩余 Credits。
18+
- **Codex API 服务卡片现已固定为账号总览首个入口卡片**:不再拆分为独立区域;空状态操作改为居中“添加账号”主按钮;成员选择弹框内套餐徽标与账号页样式保持一致。
19+
920
---
1021
## [0.22.0] - 2026-04-18
1122

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cockpit-tools",
33
"private": true,
4-
"version": "0.22.0",
4+
"version": "0.22.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cockpit-tools"
3-
version = "0.22.0"
3+
version = "0.22.1"
44
description = "Cockpit Tools"
55
authors = ["jlcodes"]
66
license = "CC-BY-NC-SA-4.0"

src-tauri/src/commands/codex.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::models::codex::{
22
CodexAccount, CodexApiProviderMode, CodexQuickConfig, CodexQuota, CodexTokens,
33
};
4-
use crate::models::codex_local_access::{
5-
CodexLocalAccessRoutingStrategy, CodexLocalAccessState,
6-
};
4+
use crate::models::codex_local_access::{CodexLocalAccessRoutingStrategy, CodexLocalAccessState};
75
use crate::modules::{
86
codex_account, codex_local_access, codex_oauth, codex_quota, codex_wakeup,
97
codex_wakeup_scheduler, config, logger, openclaw_auth, opencode_auth, process,
@@ -706,9 +704,7 @@ pub async fn codex_local_access_clear_stats() -> Result<CodexLocalAccessState, S
706704
}
707705

708706
#[tauri::command]
709-
pub async fn codex_local_access_update_port(
710-
port: u16,
711-
) -> Result<CodexLocalAccessState, String> {
707+
pub async fn codex_local_access_update_port(port: u16) -> Result<CodexLocalAccessState, String> {
712708
codex_local_access::update_local_access_port(port).await
713709
}
714710

src-tauri/src/commands/codex_instance.rs

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,34 +86,38 @@ async fn inject_bound_account_to_profile(
8686
) -> Result<(), String> {
8787
if modules::codex_instance::is_api_service_bind_account_id(bind_account_id) {
8888
let provider_before =
89-
modules::codex_session_visibility::read_history_visibility_provider_for_dir(profile_dir)
90-
.map(Some)
91-
.unwrap_or_else(|error| {
92-
modules::logger::log_warn(&format!(
93-
"实例切换 API 服务前读取 provider 失败,跳过自动修复预判: {}",
94-
error
95-
));
96-
None
97-
});
89+
modules::codex_session_visibility::read_history_visibility_provider_for_dir(
90+
profile_dir,
91+
)
92+
.map(Some)
93+
.unwrap_or_else(|error| {
94+
modules::logger::log_warn(&format!(
95+
"实例切换 API 服务前读取 provider 失败,跳过自动修复预判: {}",
96+
error
97+
));
98+
None
99+
});
98100

99101
modules::codex_local_access::activate_local_access_for_dir(profile_dir).await?;
100102

101103
let provider_after =
102-
modules::codex_session_visibility::read_history_visibility_provider_for_dir(profile_dir)
103-
.map(Some)
104-
.unwrap_or_else(|error| {
105-
modules::logger::log_warn(&format!(
106-
"实例切换 API 服务后读取 provider 失败,跳过自动修复可见性: {}",
107-
error
108-
));
109-
None
110-
});
111-
let should_repair_visibility =
112-
match (provider_before.as_deref(), provider_after.as_deref()) {
113-
(Some(before), Some(after)) => before != after,
114-
(None, Some(_)) => true,
115-
_ => false,
116-
};
104+
modules::codex_session_visibility::read_history_visibility_provider_for_dir(
105+
profile_dir,
106+
)
107+
.map(Some)
108+
.unwrap_or_else(|error| {
109+
modules::logger::log_warn(&format!(
110+
"实例切换 API 服务后读取 provider 失败,跳过自动修复可见性: {}",
111+
error
112+
));
113+
None
114+
});
115+
let should_repair_visibility = match (provider_before.as_deref(), provider_after.as_deref())
116+
{
117+
(Some(before), Some(after)) => before != after,
118+
(None, Some(_)) => true,
119+
_ => false,
120+
};
117121
if should_repair_visibility {
118122
match modules::codex_session_visibility::repair_session_visibility_across_instances() {
119123
Ok(summary) => {

src-tauri/src/commands/system.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ pub struct GeneralConfig {
152152
pub auto_switch_enabled: bool,
153153
/// 自动切号阈值(百分比)
154154
pub auto_switch_threshold: i32,
155+
/// 是否启用 Credits 阈值自动切号
156+
pub auto_switch_credits_enabled: bool,
157+
/// Credits 自动切号阈值(剩余值)
158+
pub auto_switch_credits_threshold: i32,
155159
/// 自动切号触发模式:any_group | selected_groups
156160
pub auto_switch_scope_mode: String,
157161
/// 自动切号指定模型分组(分组 ID)
@@ -724,6 +728,8 @@ pub fn save_network_config(
724728
.antigravity_dual_switch_no_restart_enabled,
725729
auto_switch_enabled: current.auto_switch_enabled,
726730
auto_switch_threshold: current.auto_switch_threshold,
731+
auto_switch_credits_enabled: current.auto_switch_credits_enabled,
732+
auto_switch_credits_threshold: current.auto_switch_credits_threshold,
727733
auto_switch_scope_mode: current.auto_switch_scope_mode,
728734
auto_switch_selected_group_ids: current.auto_switch_selected_group_ids,
729735
auto_switch_account_scope_mode: current.auto_switch_account_scope_mode,
@@ -979,6 +985,8 @@ pub fn get_general_config(app: tauri::AppHandle) -> Result<GeneralConfig, String
979985
.antigravity_dual_switch_no_restart_enabled,
980986
auto_switch_enabled: user_config.auto_switch_enabled,
981987
auto_switch_threshold: user_config.auto_switch_threshold,
988+
auto_switch_credits_enabled: user_config.auto_switch_credits_enabled,
989+
auto_switch_credits_threshold: user_config.auto_switch_credits_threshold,
982990
auto_switch_scope_mode: user_config.auto_switch_scope_mode,
983991
auto_switch_selected_group_ids: user_config.auto_switch_selected_group_ids,
984992
auto_switch_account_scope_mode: user_config.auto_switch_account_scope_mode,
@@ -1095,6 +1103,8 @@ pub fn save_general_config(
10951103
antigravity_dual_switch_no_restart_enabled: Option<bool>,
10961104
auto_switch_enabled: Option<bool>,
10971105
auto_switch_threshold: Option<i32>,
1106+
auto_switch_credits_enabled: Option<bool>,
1107+
auto_switch_credits_threshold: Option<i32>,
10981108
auto_switch_scope_mode: Option<String>,
10991109
auto_switch_selected_group_ids: Option<Vec<String>>,
11001110
auto_switch_account_scope_mode: Option<String>,
@@ -1299,6 +1309,10 @@ pub fn save_general_config(
12991309
.unwrap_or(current.antigravity_dual_switch_no_restart_enabled),
13001310
auto_switch_enabled: auto_switch_enabled.unwrap_or(current.auto_switch_enabled),
13011311
auto_switch_threshold: auto_switch_threshold.unwrap_or(current.auto_switch_threshold),
1312+
auto_switch_credits_enabled: auto_switch_credits_enabled
1313+
.unwrap_or(current.auto_switch_credits_enabled),
1314+
auto_switch_credits_threshold: auto_switch_credits_threshold
1315+
.unwrap_or(current.auto_switch_credits_threshold),
13021316
auto_switch_scope_mode: auto_switch_scope_mode
13031317
.map(|value| value.trim().to_string())
13041318
.filter(|value| !value.is_empty())

src-tauri/src/commands/windsurf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::time::Instant;
21
use serde::{Deserialize, Serialize};
2+
use std::time::Instant;
33
use tauri::{AppHandle, Emitter};
44

55
use crate::models::windsurf::{WindsurfAccount, WindsurfOAuthStartResponse};

src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ pub fn run() {
146146
});
147147
}
148148

149+
modules::provider_token_keeper::ensure_started(app.handle().clone());
149150
modules::wakeup_scheduler::restore_state_from_disk();
150151
modules::wakeup_scheduler::ensure_started(app.handle().clone());
151152
modules::codex_wakeup_scheduler::ensure_started(app.handle().clone());

0 commit comments

Comments
 (0)