Skip to content

Commit 2e6bbd5

Browse files
author
李杰
committed
release: v0.22.5
1 parent a66794b commit 2e6bbd5

33 files changed

Lines changed: 201 additions & 138 deletions

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ 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.5] - 2026-04-20
11+
12+
### Fixed
13+
- **Trae account upsert now uses `user_id` as the primary identity key and falls back to email only when needed**: imports no longer merge different users just because emails match, and placeholder `unknown` email values are excluded from identity matching.
14+
- **Cursor plan badge normalization now maps `pro_student` to `pro`**: student Pro subscriptions now render the expected Pro badge instead of exposing raw membership text.
15+
16+
### Added
17+
- **Codex API Service switch now prompts to enable the service when it is currently disabled**: the account-page action shows a warning modal and supports one-click `Enable and Switch` before proceeding.
18+
19+
### Changed
20+
- **Gemini default-instance settings now persist `working_dir` end-to-end**: list/update/start/stop flows all read and return the saved working directory instead of forcing it to empty.
21+
- **API Service activation paths no longer auto-run session visibility repair**: switching to service mode now focuses on applying the real profile change, while history-repair remains an explicit operation.
22+
923
---
1024
## [0.22.4] - 2026-04-19
1125

CHANGELOG.zh-CN.md

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

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

9+
---
10+
## [0.22.5] - 2026-04-20
11+
12+
### 修复
13+
- **Trae 账号 upsert 现已改为 `user_id` 优先识别,仅在必要时才回退到邮箱**:导入时不再因邮箱相同误合并不同用户,且占位邮箱 `unknown` 不再参与身份匹配。
14+
- **Cursor 套餐徽标归一化现已把 `pro_student` 映射为 `pro`**:学生 Pro 订阅将显示预期的 Pro 徽标,不再暴露原始 membership 文本。
15+
16+
### 新增
17+
- **Codex API 服务在“未启用”状态下切号前现会先弹出启用确认**:账号页操作会显示警告弹框,并支持一键“启用并切号”后继续执行。
18+
19+
### 变更
20+
- **Gemini 默认实例设置现已端到端持久化 `working_dir`**:列表、更新、启动、停止链路都会读取并返回已保存的工作目录,不再固定为空。
21+
- **API 服务激活链路现已不再自动触发历史会话可见性修复**:切换到服务模式时仅执行真实实例配置切换,历史修复改为显式触发流程。
22+
923
---
1024
## [0.22.4] - 2026-04-19
1125

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.4",
4+
"version": "0.22.5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

release-artifacts/SHA256SUMS.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

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.4"
3+
version = "0.22.5"
44
description = "Cockpit Tools"
55
authors = ["jlcodes"]
66
license = "CC-BY-NC-SA-4.0"

src-tauri/src/commands/codex.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -725,18 +725,6 @@ pub async fn codex_local_access_set_enabled(
725725
#[tauri::command]
726726
pub async fn codex_local_access_activate(app: AppHandle) -> Result<CodexLocalAccessState, String> {
727727
let codex_home = codex_account::get_codex_home();
728-
let provider_before =
729-
crate::modules::codex_session_visibility::read_history_visibility_provider_for_dir(
730-
&codex_home,
731-
)
732-
.map(Some)
733-
.unwrap_or_else(|error| {
734-
logger::log_warn(&format!(
735-
"切换 API 服务前读取 Codex provider 失败,跳过自动修复预判: {}",
736-
error
737-
));
738-
None
739-
});
740728
let state = codex_local_access::activate_local_access_for_dir(&codex_home).await?;
741729

742730
let mut index = codex_account::load_account_index();
@@ -756,41 +744,6 @@ pub async fn codex_local_access_activate(app: AppHandle) -> Result<CodexLocalAcc
756744
logger::log_info("已同步更新 Codex 默认实例为 API 服务模式");
757745
}
758746

759-
let provider_after =
760-
crate::modules::codex_session_visibility::read_history_visibility_provider_for_dir(
761-
&codex_home,
762-
)
763-
.map(Some)
764-
.unwrap_or_else(|error| {
765-
logger::log_warn(&format!(
766-
"切换 API 服务后读取 Codex provider 失败,跳过自动修复可见性: {}",
767-
error
768-
));
769-
None
770-
});
771-
let should_repair_visibility = match (provider_before.as_deref(), provider_after.as_deref()) {
772-
(Some(before), Some(after)) => before != after,
773-
(None, Some(_)) => true,
774-
_ => false,
775-
};
776-
if should_repair_visibility {
777-
match crate::modules::codex_session_visibility::repair_session_visibility_across_instances()
778-
{
779-
Ok(summary) => {
780-
logger::log_info(&format!(
781-
"切换 API 服务后已自动执行历史会话可见性修复: {}",
782-
summary.message
783-
));
784-
}
785-
Err(error) => {
786-
logger::log_warn(&format!(
787-
"API 服务切换成功,但自动修复历史会话可见性失败,请稍后在会话管理中手动补跑: {}",
788-
error
789-
));
790-
}
791-
}
792-
}
793-
794747
let user_config = config::get_user_config();
795748
logger::log_info("API 服务启动模式下跳过 OpenCode / OpenClaw OAuth 同步");
796749

src-tauri/src/commands/codex_instance.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -87,56 +87,7 @@ async fn inject_bound_account_to_profile(
8787
bind_account_id: &str,
8888
) -> Result<(), String> {
8989
if modules::codex_instance::is_api_service_bind_account_id(bind_account_id) {
90-
let provider_before =
91-
modules::codex_session_visibility::read_history_visibility_provider_for_dir(
92-
profile_dir,
93-
)
94-
.map(Some)
95-
.unwrap_or_else(|error| {
96-
modules::logger::log_warn(&format!(
97-
"实例切换 API 服务前读取 provider 失败,跳过自动修复预判: {}",
98-
error
99-
));
100-
None
101-
});
102-
10390
modules::codex_local_access::activate_local_access_for_dir(profile_dir).await?;
104-
105-
let provider_after =
106-
modules::codex_session_visibility::read_history_visibility_provider_for_dir(
107-
profile_dir,
108-
)
109-
.map(Some)
110-
.unwrap_or_else(|error| {
111-
modules::logger::log_warn(&format!(
112-
"实例切换 API 服务后读取 provider 失败,跳过自动修复可见性: {}",
113-
error
114-
));
115-
None
116-
});
117-
let should_repair_visibility = match (provider_before.as_deref(), provider_after.as_deref())
118-
{
119-
(Some(before), Some(after)) => before != after,
120-
(None, Some(_)) => true,
121-
_ => false,
122-
};
123-
if should_repair_visibility {
124-
match modules::codex_session_visibility::repair_session_visibility_across_instances() {
125-
Ok(summary) => {
126-
modules::logger::log_info(&format!(
127-
"实例切换 API 服务后已自动执行历史会话可见性修复: {}",
128-
summary.message
129-
));
130-
}
131-
Err(error) => {
132-
modules::logger::log_warn(&format!(
133-
"实例 API 服务切换成功,但自动修复历史会话可见性失败,请稍后在会话管理中手动补跑: {}",
134-
error
135-
));
136-
}
137-
}
138-
}
139-
14091
return Ok(());
14192
}
14293

src-tauri/src/commands/gemini_instance.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn resolve_instance_launch_context(instance_id: &str) -> Result<GeminiLaunchCont
5757
let default_settings = modules::gemini_instance::load_default_settings()?;
5858
return Ok(GeminiLaunchContext {
5959
user_data_dir: default_dir.to_string_lossy().to_string(),
60-
working_dir: None,
60+
working_dir: default_settings.working_dir,
6161
extra_args: default_settings.extra_args,
6262
use_home_env: false,
6363
});
@@ -166,7 +166,7 @@ pub async fn gemini_list_instances() -> Result<Vec<InstanceProfileView>, String>
166166
id: DEFAULT_INSTANCE_ID.to_string(),
167167
name: String::new(),
168168
user_data_dir: default_dir_str,
169-
working_dir: None,
169+
working_dir: default_settings.working_dir.clone(),
170170
extra_args: default_settings.extra_args.clone(),
171171
bind_account_id: default_settings.bind_account_id.clone(),
172172
created_at: 0,
@@ -225,6 +225,7 @@ pub async fn gemini_update_instance(
225225
let default_dir_str = default_dir.to_string_lossy().to_string();
226226
let updated = modules::gemini_instance::update_default_settings(
227227
bind_account_id,
228+
working_dir,
228229
extra_args,
229230
follow_local_account,
230231
)?;
@@ -233,7 +234,7 @@ pub async fn gemini_update_instance(
233234
id: DEFAULT_INSTANCE_ID.to_string(),
234235
name: String::new(),
235236
user_data_dir: default_dir_str,
236-
working_dir: None,
237+
working_dir: updated.working_dir,
237238
extra_args: updated.extra_args,
238239
bind_account_id: updated.bind_account_id,
239240
created_at: 0,
@@ -301,7 +302,7 @@ pub async fn gemini_start_instance(instance_id: String) -> Result<InstanceProfil
301302
id: DEFAULT_INSTANCE_ID.to_string(),
302303
name: String::new(),
303304
user_data_dir: default_dir_str,
304-
working_dir: None,
305+
working_dir: default_settings.working_dir.clone(),
305306
extra_args: default_settings.extra_args,
306307
bind_account_id: default_settings.bind_account_id,
307308
created_at: 0,
@@ -348,7 +349,7 @@ pub async fn gemini_stop_instance(instance_id: String) -> Result<InstanceProfile
348349
id: DEFAULT_INSTANCE_ID.to_string(),
349350
name: String::new(),
350351
user_data_dir: default_dir_str,
351-
working_dir: None,
352+
working_dir: default_settings.working_dir.clone(),
352353
extra_args: default_settings.extra_args,
353354
bind_account_id: default_settings.bind_account_id,
354355
created_at: 0,

src-tauri/src/models/instance.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ pub struct DefaultInstanceSettings {
5656
#[serde(default)]
5757
pub extra_args: String,
5858
#[serde(default)]
59+
pub working_dir: Option<String>,
60+
#[serde(default)]
5961
pub launch_mode: InstanceLaunchMode,
6062
#[serde(default = "default_follow_local_account")]
6163
pub follow_local_account: bool,
@@ -72,6 +74,7 @@ impl Default for DefaultInstanceSettings {
7274
Self {
7375
bind_account_id: None,
7476
extra_args: String::new(),
77+
working_dir: None,
7578
launch_mode: InstanceLaunchMode::App,
7679
follow_local_account: true,
7780
last_pid: None,

0 commit comments

Comments
 (0)