Merge branch 'main' into refactor/storage

This commit is contained in:
YoVinchen
2025-11-22 23:29:48 +08:00
3 changed files with 12 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ Get 10% OFF the GLM CODING PLAN with [this link](https://z.ai/subscribe?ic=8JVLJ
<tr> <tr>
<td width="180"><img src="assets/partners/logos/sds-en.png" alt="ShanDianShuo" width="150"></td> <td width="180"><img src="assets/partners/logos/sds-en.png" alt="ShanDianShuo" width="150"></td>
<td>Thanks to ShanDianShuo for sponsoring this project! ShanDianShuo is a local-first AI voice input: Millisecond latency, data stays on device, 4x faster than typing, AI-powered correction, Privacy-first, completely free. Doubles your coding efficiency with Claude Code! <a href="shandianshuo.cn">Free download</a> for Mac/Win</td> <td>Thanks to ShanDianShuo for sponsoring this project! ShanDianShuo is a local-first AI voice input: Millisecond latency, data stays on device, 4x faster than typing, AI-powered correction, Privacy-first, completely free. Doubles your coding efficiency with Claude Code! <a href="https://www.shandianshuo.cn">Free download</a> for Mac/Win</td>
</tr> </tr>
</table> </table>

View File

@@ -38,7 +38,7 @@ CC Switch 已经预设了智谱GLM只需要填写 key 即可一键导入编
<tr> <tr>
<td width="180"><img src="assets/partners/logos/sds-zh.png" alt="ShanDianShuo" width="150"></td> <td width="180"><img src="assets/partners/logos/sds-zh.png" alt="ShanDianShuo" width="150"></td>
<td>感谢闪电说赞助了本项目!闪电说是本地优先的 AI 语音输入法:毫秒级响应,数据不离设备;打字速度提升 4 倍AI 智能纠错;绝对隐私安全,完全免费,配合 Claude Code 写代码效率翻倍!支持 Mac/Win 双平台,<a href="shandianshuo.cn">免费下载</a></td> <td>感谢闪电说赞助了本项目!闪电说是本地优先的 AI 语音输入法:毫秒级响应,数据不离设备;打字速度提升 4 倍AI 智能纠错;绝对隐私安全,完全免费,配合 Claude Code 写代码效率翻倍!支持 Mac/Win 双平台,<a href="https://www.shandianshuo.cn">免费下载</a></td>
</tr> </tr>
</table> </table>

View File

@@ -449,7 +449,7 @@ pub fn import_from_codex(config: &mut MultiAppConfig) -> Result<usize, AppError>
// 核心字段(需要手动处理的字段) // 核心字段(需要手动处理的字段)
let core_fields = match typ { let core_fields = match typ {
"stdio" => vec!["type", "command", "args", "env", "cwd"], "stdio" => vec!["type", "command", "args", "env", "cwd"],
"http" | "sse" => vec!["type", "url", "headers"], "http" | "sse" => vec!["type", "url", "http_headers"],
_ => vec!["type"], _ => vec!["type"],
}; };
@@ -490,7 +490,13 @@ pub fn import_from_codex(config: &mut MultiAppConfig) -> Result<usize, AppError>
if let Some(url) = entry_tbl.get("url").and_then(|v| v.as_str()) { if let Some(url) = entry_tbl.get("url").and_then(|v| v.as_str()) {
spec.insert("url".into(), json!(url)); spec.insert("url".into(), json!(url));
} }
if let Some(headers_tbl) = entry_tbl.get("headers").and_then(|v| v.as_table()) { // Read from http_headers (correct Codex format) or headers (legacy) with priority to http_headers
let headers_tbl = entry_tbl
.get("http_headers")
.and_then(|v| v.as_table())
.or_else(|| entry_tbl.get("headers").and_then(|v| v.as_table()));
if let Some(headers_tbl) = headers_tbl {
let mut headers_json = serde_json::Map::new(); let mut headers_json = serde_json::Map::new();
for (k, v) in headers_tbl.iter() { for (k, v) in headers_tbl.iter() {
if let Some(sv) = v.as_str() { if let Some(sv) = v.as_str() {
@@ -910,7 +916,7 @@ fn json_server_to_toml_table(spec: &Value) -> Result<toml_edit::Table, AppError>
// 定义核心字段(已在下方处理,跳过通用转换) // 定义核心字段(已在下方处理,跳过通用转换)
let core_fields = match typ { let core_fields = match typ {
"stdio" => vec!["type", "command", "args", "env", "cwd"], "stdio" => vec!["type", "command", "args", "env", "cwd"],
"http" | "sse" => vec!["type", "url", "headers"], "http" | "sse" => vec!["type", "url", "http_headers"],
_ => vec!["type"], _ => vec!["type"],
}; };
@@ -988,7 +994,7 @@ fn json_server_to_toml_table(spec: &Value) -> Result<toml_edit::Table, AppError>
} }
} }
if !h_tbl.is_empty() { if !h_tbl.is_empty() {
t["headers"] = Item::Table(h_tbl); t["http_headers"] = Item::Table(h_tbl);
} }
} }
} }