Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "thinkwatch-lite",
"private": true,
"description": "Desktop app for a local AI API gateway on macOS, Windows and Linux",
"version": "2026.11.12",
"version": "2026.11.13",
"type": "module",
"packageManager": "pnpm@11.13.0",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions release-notes/2026.11.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Model capabilities are discovered automatically, with manual overrides available in the existing Model specs dialog. When an upstream or relay omits capability metadata, choose supported reasoning effort levels and an optional default yourself, explicitly mark effort as not adjustable, or restore automatic discovery at any time. Providers without model listings can still use manually entered model IDs.

The dialog shows upstream declarations, the saved effective profile, its source, and any levels unavailable through the current protocol. Aliases offer only levels supported by every routing candidate. Sharing links now disclose when they omit manual effort profiles and recommend a config package instead.

This release bundles Core 0.95.0. After updating, restart Codex to reload its model catalog.
30 changes: 15 additions & 15 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thinkwatch-lite"
version = "2026.11.12"
version = "2026.11.13"
edition = "2024"
# **这个数决定依赖能升到哪一版。**edition 2024 的解析器只挑声明的 Rust
# 版本编得动的依赖:写 1.85 的时候,`cargo update` 一直停在旧的 time 和
Expand All @@ -21,17 +21,17 @@ edition = "2024"
rust-version = "1.90"
license = "MIT"

# core 的几个 crate。**钉在 tag 上,不是分支,而且全部钉同一个 tag。**跟着 `main`
# core 的几个 crate 全部钉在同一个发布 tag 上。跟着 `main`
# 走意味着同一份源码今天和明天编出来的东西不一样;而更要紧的是,打进 `.app` 的那个
# twcore 二进制必须和这里编译进去的协议镜像来自同一个 core 版本 —— 打包脚本正是
# 从 tw-api 锁到的 tag 去取二进制的(见 scripts/fetch-core.sh)。
[workspace.dependencies]
tw-api = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-types = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-yaml = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-guard = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-watch = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-link = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.94.0" }
tw-api = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }
tw-types = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }
tw-yaml = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }
tw-guard = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }
tw-watch = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }
tw-link = { git = "https://github.com/ThinkWatchProject/ThinkWatch-Core.git", tag = "v0.95.0" }

[lib]
name = "thinkwatch_lite_lib"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "ThinkWatch Lite",
"version": "2026.11.12",
"version": "2026.11.13",
"identifier": "app.thinkwatch.lite",
"build": {
"beforeDevCommand": "pnpm dev",
Expand Down
105 changes: 105 additions & 0 deletions src-tauri/tests/control_plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,3 +814,108 @@ async fn a_tool_call_plugin_is_turned_on_only_through_the_confirmed_save() {
.await
.unwrap();
}

/// The desktop transport preserves effort edits and returns the Core's effective profile.
#[tokio::test]
async fn manual_effort_profiles_round_trip_through_the_desktop_control_client() {
use tw_api::{ModelSpecSave, ReasoningEffort, ReasoningEffortChange, ReasoningLevel::*, ep};
let core = Core::start();
core.wait_ready().await;
let c = core.ok();
let provider = "manual-effort";
let model = "private-model";
c.call::<ep::CreateProvider>(
&[],
&serde_json::from_value(serde_json::json!({
"provider":{"name":provider,"base_url":"http://127.0.0.1:1/v1","protocol":"openai-chat"}
}))
.unwrap(),
)
.await
.unwrap();
c.call::<ep::SetManualModels>(
&[],
&tw_api::ManualModelsSave {
provider: provider.into(),
models: vec![model.into()],
base_version: None,
},
)
.await
.unwrap();
let profile = ReasoningEffort {
supported_levels: vec![Medium, High, Ultra],
default_level: Some(Ultra),
};
c.call::<ep::SetModelSpec>(
&[],
&ModelSpecSave {
provider: provider.into(),
model: model.into(),
reasoning_effort: ReasoningEffortChange::Set {
value: profile.clone(),
},
..Default::default()
},
)
.await
.unwrap();
let rows = c
.call::<ep::ProviderModels>(&[provider], &())
.await
.unwrap();
let row = rows.models.iter().find(|r| r.id == model).unwrap();
assert_eq!(row.manual_reasoning_effort.as_ref(), Some(&profile));
assert_eq!(row.reasoning, Some(true));
assert_eq!(row.manual_reasoning, None);
assert_eq!(
row.reasoning_effort,
Some(ReasoningEffort {
supported_levels: vec![Medium, High],
default_level: Some(Medium)
})
);
assert_eq!(row.reasoning_effort_filtered_levels, [Ultra]);
c.call::<ep::SetModelSpec>(
&[],
&ModelSpecSave {
provider: provider.into(),
model: model.into(),
context_window: Some(64000),
..Default::default()
},
)
.await
.unwrap();
let rows = c
.call::<ep::ProviderModels>(&[provider], &())
.await
.unwrap();
let row = rows.models.iter().find(|r| r.id == model).unwrap();
assert_eq!(
row.manual_reasoning_effort.as_ref(),
Some(&profile),
"omitted effort edits keep the original profile"
);
c.call::<ep::SetModelSpec>(
&[],
&ModelSpecSave {
provider: provider.into(),
model: model.into(),
reasoning_effort: ReasoningEffortChange::Auto,
..Default::default()
},
)
.await
.unwrap();
let rows = c
.call::<ep::ProviderModels>(&[provider], &())
.await
.unwrap();
let row = rows.models.iter().find(|r| r.id == model).unwrap();
assert!(row.manual_reasoning_effort.is_none());
assert!(
row.reasoning_effort.is_none(),
"missing upstream metadata remains unknown after reset"
);
}
58 changes: 51 additions & 7 deletions src/generated/tw-api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generated by tw-api (`tw_api::ts::export_all`). Do not edit by hand.

export const CONTROL_API_VERSION = 59;
export const CONTROL_API_VERSION = 60;

/**
* 手动中止(`POST /request/{id}/abort`、`POST /sessions/{id}/abort`)叫停了哪几个请求。
Expand Down Expand Up @@ -3099,31 +3099,51 @@ export type ModelRow = { id: string,
*/
enabled: boolean,
/**
* 上下文窗口:这一家手写的(`model_specs`),没写时来自价目表
* 上下文窗口:手动覆盖优先,然后上游报告,最后价目表
*/
context_window?: number | null,
/**
* `context_window` 从哪儿来。不知道上下文窗口时没有
*/
context_window_source?: SpecSource | null,
/**
* 一次最多输出多少 token:这一家手写的,没写时来自价目表
* 一次最多输出多少 token:手动覆盖优先,然后上游报告,最后价目表
*/
max_output_tokens?: number | null,
/**
* `max_output_tokens` 从哪儿来。不知道输出上限时没有
*/
max_output_tokens_source?: SpecSource | null,
/**
* 会不会推理:这一家手写的,没写时来自价目表。不知道时没有
* 会不会推理:手动覆盖优先,然后上游报告,最后价目表。不知道时没有
*/
reasoning?: boolean | null,
/**
* `reasoning` 从哪儿来。不知道时没有
*/
reasoning_source?: SpecSource | null,
/**
* 收不收图:这一家手写的,没写时来自价目表。不知道时没有
* 推理开关的手动原值;非空手动档位推导出的 true 不会写进这里。
*/
manual_reasoning?: boolean | null,
/**
* 实际可用的档位(已应用推理开关和协议转换限制)。没有表示未知。
*/
reasoning_effort?: ReasoningEffort | null, reasoning_effort_source?: SpecSource | null,
/**
* 上游实际报告的档位;手动覆盖时仍保留,供界面解释和恢复自动。
*/
reported_reasoning_effort?: ReasoningEffort | null,
/**
* 配置原值,包含省略的默认值。不能从生效值反推它。
*/
manual_reasoning_effort?: ReasoningEffort | null,
/**
* 当前协议转换不能表示、因而没有向客户端提供的档位。
*/
reasoning_effort_filtered_levels?: Array<ReasoningLevel>,
/**
* 收不收图:手动覆盖优先,然后上游报告,最后价目表。不知道时没有
*/
image_input?: boolean | null,
/**
Expand Down Expand Up @@ -3161,7 +3181,8 @@ export type ModelSource = "discovered" | "manual" | "none";

/**
* 设一家上游的一个模型的规格(`PUT /provider-model-spec`):价目表不认识这个模型、
* 或者写错了时手写。**四项都空就是删掉这一项**,回到价目表。
* 或者写错了时手写。旧的四项按请求替换;推理档位必须显式 auto 才清除。
* 所有规格(含保留的高级字段)都空时删除模型项。
*/
export type ModelSpecSave = { provider: string,
/**
Expand All @@ -3180,6 +3201,10 @@ max_output_tokens?: number | null,
* 会不会推理。空 = 用价目表的
*/
reasoning?: boolean | null,
/**
* 省略或 keep 保留原值,auto 移除覆盖,set 整组替换。
*/
reasoning_effort?: ReasoningEffortChange,
/**
* 收不收图。空 = 用价目表的
*/
Expand Down Expand Up @@ -4341,6 +4366,25 @@ export type RatioView = {
*/
median: number, samples: number, };

/**
* 一整组推理档位。空列表明确表示不可调;没有这项才是自动或未知。
*/
export type ReasoningEffort = { supported_levels: Array<ReasoningLevel>,
/**
* 省略时在最终可用档位里优先 medium,否则取最低档。
*/
default_level?: ReasoningLevel | null, };

/**
* 编辑推理档位:旧客户端省略时保留,恢复自动必须显式提交 auto。
*/
export type ReasoningEffortChange = { "mode": "keep" } | { "mode": "auto" } | { "mode": "set", value: ReasoningEffort, };

/**
* 客户端可选择的推理强度,按从低到高排列。是否能转发还取决于协议。
*/
export type ReasoningLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";

/**
* 一个例外值。**只存哈希和打码后的样子,不存原值**:例外表随配置导出、同步、备份。
*
Expand Down Expand Up @@ -5672,7 +5716,7 @@ reason: ServeSkip, };
/**
* 上下文窗口、输出上限这样的模型规格从哪儿来。
*/
export type SpecSource = "price_table" | "manual";
export type SpecSource = "price_table" | "manual" | "upstream";

/**
* L3 测速要花多少。
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/core.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,12 @@
"config.manual_model_wildcard": "上游「{upstream}」手动添加的模型「{model}」含有 * 或 ?。手动添加的模型须为确切的模型 ID;只使用上游的部分模型,请设置启用范围(models_only)。",
"config.manual_model_duplicate": "模型「{model}」在上游「{upstream}」手动添加的模型中重复。",
"config.manual_model_too_long": "上游「{upstream}」手动添加的模型中有一项超过 {max} 个字符。",
"config.model_spec_effort_duplicate": "上游「{upstream}」模型「{model}」的推理档位「{level}」重复。",
"config.model_spec_effort_default": "上游「{upstream}」模型「{model}」的默认推理档位必须属于 supported_levels。",
"config.model_spec_effort_disabled": "上游「{upstream}」模型「{model}」已禁用推理,不能同时指定非空推理档位。",
"config.model_spec_blank_model": "上游「{upstream}」的模型规格(model_specs)中有一项的模型 ID 为空。",
"config.model_spec_wildcard": "上游「{upstream}」的模型规格「{model}」含有 * 或 ?。模型规格只能对应一个确切的模型 ID。",
"config.model_spec_nothing_set": "上游「{upstream}」的模型规格「{model}」中 context_window、max_output_tokens、reasoning、image_input 均未设置。请至少设置一项,或删除该规格。",
"config.model_spec_nothing_set": "上游「{upstream}」的模型规格「{model}」中没有设置任何规格。请至少设置一项,或删除该规格。",
"config.model_spec_zero": "上游「{upstream}」的模型规格「{model}」中 {field} 为 0,须为大于 0 的 token 数。要使用价目表中的值,请删除该项。",
"config.reserved_name": "{what:kind}名称「{name}」以 __ 开头,该前缀保留给内置项,请使用其他名称。",
"config.rule_name_empty": "有一条自定义{what:rule_line}规则没有名称。",
Expand Down
Loading
Loading