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

Skip to content

Commit b9d2c45

Browse files
author
李杰
committed
release: v0.22.9
1 parent e1aca65 commit b9d2c45

49 files changed

Lines changed: 2257 additions & 1126 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: 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.9] - 2026-04-23
11+
12+
### Added
13+
- **Windsurf account login/import now supports Auth1 accounts and Devin Session Tokens**: token import can read `devin-session-token$...`, password login auto-detects Firebase vs Auth1, and Auth1 sessions can recover synthetic API keys plus plan snapshots.
14+
- **Log Viewer now supports switching log files and filtering by level**: the modal can browse managed `app.log` / `codex-api.log` files and filter entries by `INFO` / `WARN` / `ERROR`.
15+
16+
### Changed
17+
- **Codex Local API Service now removes the manual `Speed` selector and follows upstream default tier behavior**: the modal no longer exposes the tier control, request rewriting no longer injects `service_tier`, and the stats range keeps the last selected view.
18+
- **Codex Local API Service streaming and routing are now lighter under account pools**: `/v1/chat/completions` stream responses are transformed chunk-by-chunk instead of full-buffer replay, prepared accounts are cached briefly for routing, and request stats are flushed asynchronously in batches.
19+
20+
### Fixed
21+
- **Codex account injection now uses account-store tokens as the source of truth**: current-account resolution and profile injection stop reading managed local auth snapshots back into the store, preventing stale local state from overriding refreshed credentials.
22+
923
---
1024
## [0.22.8] - 2026-04-22
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.9] - 2026-04-23
11+
12+
### 新增
13+
- **Windsurf 账号登录/导入现已支持 Auth1 账号与 Devin Session Token**:导入时可直接识别 `devin-session-token$...`;邮箱密码登录会自动识别 Firebase / Auth1;Auth1 会话可补齐 synthetic API Key 与套餐快照。
14+
- **日志查看器现已支持切换日志文件并按级别筛选**:弹框可浏览受管的 `app.log` / `codex-api.log` 日志文件,并按 `INFO` / `WARN` / `ERROR` 过滤日志条目。
15+
16+
### 变更
17+
- **Codex 本地 API 服务现已移除手动“速度”档位,并改为跟随上游默认 tier 行为**:弹框不再展示速度选择;请求转发不再注入 `service_tier`;统计范围会记住上次选择。
18+
- **Codex 本地 API 服务在账号池下的流式转发与路由开销已收敛**`/v1/chat/completions` 流式响应改为边读边转,不再整段缓冲后回放;路由阶段会短暂缓存已准备账号;请求统计改为异步批量落盘。
19+
20+
### 修复
21+
- **Codex 账号注入现已改为以账号中心存储为 Token 真源**:当前账号解析与实例注入不再回读受管本地 auth 快照,避免旧本地状态反向覆盖已刷新的凭据。
22+
923
---
1024
## [0.22.8] - 2026-04-22
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.8",
4+
"version": "0.22.9",
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.8"
3+
version = "0.22.9"
44
description = "Cockpit Tools"
55
authors = ["jlcodes"]
66
license = "CC-BY-NC-SA-4.0"

src-tauri/src/commands/codex.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ fn restart_codex_specified_app_if_enabled(user_config: &config::UserConfig) {
3030
logger::log_info(&format!("已重启指定应用: {}", path));
3131
}
3232
Err(error) => {
33-
logger::log_warn(&format!(
34-
"重启指定应用失败(path={}):{}",
35-
path, error
36-
));
33+
logger::log_warn(&format!("重启指定应用失败(path={}):{}", path, error));
3734
}
3835
}
3936
}
@@ -751,13 +748,6 @@ pub async fn codex_local_access_update_routing_strategy(
751748
codex_local_access::update_local_access_routing_strategy(strategy).await
752749
}
753750

754-
#[tauri::command]
755-
pub async fn codex_local_access_update_service_tier(
756-
service_tier: Option<String>,
757-
) -> Result<CodexLocalAccessState, String> {
758-
codex_local_access::update_local_access_service_tier(service_tier).await
759-
}
760-
761751
#[tauri::command]
762752
pub async fn codex_local_access_set_enabled(
763753
enabled: bool,
@@ -812,8 +802,6 @@ pub async fn codex_local_access_activate(app: AppHandle) -> Result<CodexLocalAcc
812802
logger::log_info("已关闭切换 Codex 时自动启动 Codex App");
813803
}
814804

815-
restart_codex_specified_app_if_enabled(&user_config);
816-
817805
let _ = crate::modules::tray::update_tray_menu(&app);
818806
Ok(state)
819807
}

src-tauri/src/commands/logs.rs

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
use serde::Serialize;
22
use std::fs;
3-
use std::path::Path;
3+
use std::path::{Path, PathBuf};
44
use std::time::UNIX_EPOCH;
55

66
use crate::modules::logger;
77

88
#[derive(Debug, Clone, Serialize)]
9-
pub struct LatestLogSnapshot {
9+
pub struct ManagedLogFile {
10+
pub log_file_path: String,
11+
pub log_file_name: String,
12+
pub file_size: u64,
13+
pub modified_at_ms: Option<i64>,
14+
}
15+
16+
#[derive(Debug, Clone, Serialize)]
17+
pub struct LogSnapshot {
1018
pub log_dir_path: String,
1119
pub log_file_path: String,
1220
pub log_file_name: String,
1321
pub content: String,
1422
pub line_limit: usize,
1523
pub file_size: u64,
1624
pub modified_at_ms: Option<i64>,
25+
pub available_files: Vec<ManagedLogFile>,
1726
}
1827

1928
fn to_unix_millis(time: std::time::SystemTime) -> Option<i64> {
@@ -51,15 +60,41 @@ fn open_directory(path: &Path) -> Result<(), String> {
5160
Ok(())
5261
}
5362

63+
fn build_managed_log_file(path: &Path) -> Result<ManagedLogFile, String> {
64+
let metadata = fs::metadata(path).map_err(|e| format!("读取日志文件元数据失败: {}", e))?;
65+
66+
Ok(ManagedLogFile {
67+
log_file_path: path.to_string_lossy().to_string(),
68+
log_file_name: path
69+
.file_name()
70+
.and_then(|name| name.to_str())
71+
.unwrap_or_default()
72+
.to_string(),
73+
file_size: metadata.len(),
74+
modified_at_ms: metadata.modified().ok().and_then(to_unix_millis),
75+
})
76+
}
77+
78+
fn build_available_log_files(paths: Vec<PathBuf>) -> Result<Vec<ManagedLogFile>, String> {
79+
paths
80+
.into_iter()
81+
.map(|path| build_managed_log_file(path.as_path()))
82+
.collect()
83+
}
84+
5485
#[tauri::command]
55-
pub fn logs_get_latest_snapshot(line_limit: Option<usize>) -> Result<LatestLogSnapshot, String> {
86+
pub fn logs_get_snapshot(
87+
file_name: Option<String>,
88+
line_limit: Option<usize>,
89+
) -> Result<LogSnapshot, String> {
5690
let line_limit = logger::clamp_log_tail_lines(line_limit);
5791
let log_dir = logger::get_log_dir()?;
58-
let log_file = logger::get_latest_app_log_file()?;
92+
let log_file = logger::resolve_managed_log_file(file_name.as_deref())?;
5993
let content = logger::read_log_tail_lines(&log_file, line_limit)?;
6094
let metadata = fs::metadata(&log_file).map_err(|e| format!("读取日志文件元数据失败: {}", e))?;
95+
let available_files = build_available_log_files(logger::list_managed_log_files()?)?;
6196

62-
Ok(LatestLogSnapshot {
97+
Ok(LogSnapshot {
6398
log_dir_path: log_dir.to_string_lossy().to_string(),
6499
log_file_path: log_file.to_string_lossy().to_string(),
65100
log_file_name: log_file
@@ -71,6 +106,7 @@ pub fn logs_get_latest_snapshot(line_limit: Option<usize>) -> Result<LatestLogSn
71106
line_limit,
72107
file_size: metadata.len(),
73108
modified_at_ms: metadata.modified().ok().and_then(to_unix_millis),
109+
available_files,
74110
})
75111
}
76112

src-tauri/src/commands/system.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,7 @@ pub fn get_general_config(app: tauri::AppHandle) -> Result<GeneralConfig, String
992992
ghcp_launch_on_switch: user_config.ghcp_launch_on_switch,
993993
openclaw_auth_overwrite_on_switch: user_config.openclaw_auth_overwrite_on_switch,
994994
codex_launch_on_switch: user_config.codex_launch_on_switch,
995-
codex_restart_specified_app_on_switch: user_config
996-
.codex_restart_specified_app_on_switch,
995+
codex_restart_specified_app_on_switch: user_config.codex_restart_specified_app_on_switch,
997996
codex_local_access_entry_visible: user_config.codex_local_access_entry_visible,
998997
antigravity_dual_switch_no_restart_enabled: user_config
999998
.antigravity_dual_switch_no_restart_enabled,

src-tauri/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ pub fn run() {
7777
"[SingleInstance] 收到唤起请求: arg_count={}",
7878
args.len()
7979
));
80-
let handled =
81-
modules::external_import::handle_external_import_args(app, &args, "single-instance");
80+
let handled = modules::external_import::handle_external_import_args(
81+
app,
82+
&args,
83+
"single-instance",
84+
);
8285
logger::log_info(&format!(
8386
"[SingleInstance] 外部导入处理结果: handled={}",
8487
handled
@@ -241,15 +244,13 @@ pub fn run() {
241244
}
242245

243246
let startup_args: Vec<String> = std::env::args().collect();
244-
logger::log_info(&format!(
245-
"[Startup] 启动参数数量: {}",
246-
startup_args.len()
247-
));
248-
let startup_external_import_handled = modules::external_import::handle_external_import_args(
249-
&app.handle(),
250-
&startup_args,
251-
"startup",
252-
);
247+
logger::log_info(&format!("[Startup] 启动参数数量: {}", startup_args.len()));
248+
let startup_external_import_handled =
249+
modules::external_import::handle_external_import_args(
250+
&app.handle(),
251+
&startup_args,
252+
"startup",
253+
);
253254
logger::log_info(&format!(
254255
"[Startup] 外部导入处理结果: handled={}",
255256
startup_external_import_handled
@@ -385,7 +386,7 @@ pub fn run() {
385386
commands::system::open_folder,
386387
commands::system::delete_corrupted_file,
387388
// Logs Commands
388-
commands::logs::logs_get_latest_snapshot,
389+
commands::logs::logs_get_snapshot,
389390
commands::logs::logs_open_log_directory,
390391
// Wakeup Commands
391392
commands::wakeup::wakeup_ensure_runtime_ready,
@@ -480,7 +481,6 @@ pub fn run() {
480481
commands::codex::codex_local_access_clear_stats,
481482
commands::codex::codex_local_access_update_port,
482483
commands::codex::codex_local_access_update_routing_strategy,
483-
commands::codex::codex_local_access_update_service_tier,
484484
commands::codex::codex_local_access_set_enabled,
485485
commands::codex::codex_local_access_activate,
486486
// GitHub Copilot Commands

src-tauri/src/models/codex_local_access.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub struct CodexLocalAccessCollection {
2828
pub api_key: String,
2929
#[serde(default)]
3030
pub routing_strategy: CodexLocalAccessRoutingStrategy,
31-
#[serde(default)]
32-
pub default_service_tier: Option<String>,
3331
#[serde(default = "default_restrict_free_accounts")]
3432
pub restrict_free_accounts: bool,
3533
pub account_ids: Vec<String>,

0 commit comments

Comments
 (0)