A local-first multi-agent app development platform, built on PenguinHarness
feat(models,cli,web): AgentHub 0.4.4 with a max thinking tier (#334)
Yaowei Zhenga95c06efb689
diff --git a/changelog/unreleased/2026-08-19-agenthub-0.4.4.md b/changelog/unreleased/2026-08-19-agenthub-0.4.4.mdnew file mode 100644index 00000000..aba31f20--- /dev/null+++ b/changelog/unreleased/2026-08-19-agenthub-0.4.4.md@@ -0,0 +1,51 @@+# AgentHub 0.4.4: a max thinking level, and gateway heartbeats that no longer kill a stream++- **Date:** 2026-08-19+- **Type:** feature+- **Scope:** `core`, `server`, `web`, `cli`, `docs`+- **PR:** [#334](https://github.com/Prism-Shadow/penguin-harness/pull/334)+- **Issue:** [#286](https://github.com/Prism-Shadow/penguin-harness/issues/286)+- **Breaking:** yes — on DeepSeek models the `low` and `xhigh` tiers now send shallower efforts than before; pick `max` to keep the depth `xhigh` used to give.++[中文版](2026-08-19-agenthub-0.4.4.zh.md)++`@prismshadow/agenthub` moved from 0.4.2 to 0.4.4, over two releases: 0.4.3 skips the heartbeat events gateways inject into a streaming response instead of failing the stream (agenthub [#174](https://github.com/Prism-Shadow/agenthub/pull/174)), and 0.4.4 added a `MAX` thinking level above `XHIGH` and re-mapped every client's effort vocabulary onto the widened ladder (agenthub [#176](https://github.com/Prism-Shadow/agenthub/pull/176)). The harness took the new tier all the way through: `max` is now a selectable thinking level in the Web pickers, a valid `thinking_level` for `run_subagent`, and an accepted value everywhere a level is stored or sent.++## Gateway heartbeats++A gateway in front of a model API — one-api-style proxies, OpenRouter — sends a heartbeat during a long generation. On 0.4.2 that event reached the unknown-event guard and threw, the harness classified the throw as a retryable request failure, and the retry hit the next heartbeat: a long generation through such a gateway reconnected until it gave up, showing as an endless "reconnecting" in the Web App.++- Responses-protocol clients (`gpt-5.6`, `openai-responses`, `minimax-m3`) treat `keepalive` as a known no-op; Chat Completions clients (`openai-chat`, `deepseek-v4`, `glm-5.3`, `kimi-k3`) read `choices` only when the field is populated; the Anthropic-protocol clients (`claude-5`, `ant-messages`) accept `ping`. Genuinely unknown events still fail loudly.+- 0.4.4 then generalized the Gemini half: instead of inferring a heartbeat from a chunk carrying neither candidates nor usage, `gemini3_7` marks a chunk `unused` when nothing was read out of it at all — no content items, no usage, no finish reason. Streams that omit usage behave the same either way.++## The max tier++- `ThinkingLevelName` gained `"max"`, and `mapThinkingLevel` maps it to AgentHub's `ThinkingLevel.MAX`. Every client maps the tier onto the deepest effort its vendor accepts and degrades silently where no such tier exists — Gemini and MiniMax M3 stop at their `high` — so picking it never fails.+- `max` is offered in the Web pickers, not merely accepted as a stored value. The pickers exclude `none` because many models cannot disable thinking; `max` carries no such caveat, so it joins `low` / `medium` / `high` / `xhigh` in `SELECTABLE_THINKING_LEVELS`, in `DEFAULT_CHAT_THINKING_LEVELS` (a Project's `[default_chat]` fallback), and in `SUBAGENT_THINKING_LEVELS` — the tiers `run_subagent` accepts for `thinking_level`.+- The per-turn `thinkingLevel` on `POST /api/sessions/:id/tasks` and the Agent config's `model.thinking_level` both accept `max`; anything else is still a 400.+- The CLI offers it too. `--thinking` and `/thinking` ([#322](https://github.com/Prism-Shadow/penguin-harness/pull/322)) validate against core's `DEFAULT_CHAT_THINKING_LEVELS`, so they accepted `max` the moment the ladder widened — but their help text, `/thinking` readouts and invalid-level message spell the tiers out in free text and still stopped at `xhigh`, advertising less than the flag took. Those eight strings (both locales) and the CLI docs now name `max`, and a test pins the advertised set against the accepted one so the two cannot drift apart again.+- `xhigh` was described in both locales as "the highest tier" of extended reasoning, which the new tier made false. Its description now names it as the tier beyond `high`, and `max` took over the superlative — the same rewording AgentHub applied to its own playground selector. Nothing in the harness compared or clamped levels ordinally, so no other site assumed `xhigh` was the ceiling.++## DeepSeek effort re-mapping++DeepSeek's `reasoning_effort` accepts `low` / `high` / `max` and folds `medium` and `xhigh` onto `high` server-side. 0.4.4 aligned the client with that vocabulary, which changes what two existing tiers send on DeepSeek models:++| Tier | Sent before (0.4.3) | Sent now (0.4.4) |+| --- | --- | --- |+| `LOW` | `high` | `low` |+| `XHIGH` | `max` | `high` |+| `MAX` | — | `max` |++A DeepSeek Session left on `low` therefore reasons less, and costs less, than it did; one on `xhigh` reasons less deeply than it did.++## Thinking-level labels name the wire value++Each tier is now labelled with the value it actually sends: the Chinese label appends it in parentheses (`极高 (xhigh)`, `最高 (max)`) and the English label is that value itself — `xhigh`, not `Extreme High`. Every surface reading the shared name table picked it up: the conversation-time pickers, the mid-chat switch dialog and its toasts, and the Project chat-defaults dialog. The Agent settings rows already showed the raw wire value.++## Compatibility++- **DeepSeek users who relied on `xhigh` should switch to `max`** to keep the effort that tier used to send. A Session on `low` needs no action unless the old (much deeper) behavior was wanted, in which case `high` is the closest match.+- Widening `run_subagent`'s `thinking_level` enum changed the default tool entry, so `KERNEL_VERSION` advanced to generation `2026-08-19` with `tools.builtin.run_subagent` as its only changed leaf. Every existing Agent takes a kernel update; an entry the user edited is kept untouched and one they deleted stays deleted, so nothing has to be done by hand.+- Stored configs and traces carrying any older level keep working — the ladder only grew at the top, and no existing value changed meaning in the harness.+- `pnpm-workspace.yaml`'s `minimumReleaseAgeExclude` entry now names 0.4.4 alone; the 0.4.3 entry was dropped as that file's own note instructed.+- The two published packages were diffed to confirm no base URL or endpoint construction changed between 0.4.3 and 0.4.4, so the model catalog and the protocol-path hints are unaffected; `protocol-path.ts`'s verification note names 0.4.4 as the version it was re-checked against.diff --git a/changelog/unreleased/2026-08-19-agenthub-0.4.4.zh.md b/changelog/unreleased/2026-08-19-agenthub-0.4.4.zh.mdnew file mode 100644index 00000000..3b71b70e--- /dev/null+++ b/changelog/unreleased/2026-08-19-agenthub-0.4.4.zh.md@@ -0,0 +1,51 @@+# AgentHub 0.4.4:新增 max 思考等级,网关心跳不再中断流式响应++- **Date:** 2026-08-19+- **Type:** feature+- **Scope:** `core`, `server`, `web`, `cli`, `docs`+- **PR:** [#334](https://github.com/Prism-Shadow/penguin-harness/pull/334)+- **Issue:** [#286](https://github.com/Prism-Shadow/penguin-harness/issues/286)+- **Breaking:** yes — 在 DeepSeek 模型上,`low` 与 `xhigh` 两档发送的 effort 比此前更浅;想保留 `xhigh` 原先的思考深度,请改选 `max`。++[English](2026-08-19-agenthub-0.4.4.md)++`@prismshadow/agenthub` 跨两个版本从 0.4.2 升到 0.4.4:0.4.3 会跳过网关注入到流式响应中的心跳事件,而不是让整条流失败(agenthub [#174](https://github.com/Prism-Shadow/agenthub/pull/174));0.4.4 在 `XHIGH` 之上新增了 `MAX` 思考等级,并把各 client 的 effort 取值重新映射到加宽后的档位阶梯上(agenthub [#176](https://github.com/Prism-Shadow/agenthub/pull/176))。harness 把这一新档位打通到了各处:`max` 现在是 Web 拾取器里可选的思考等级、`run_subagent` 合法的 `thinking_level`,以及一切存储或传输档位处都接受的取值。++## 网关心跳++架在模型 API 前面的网关——one-api 一类的代理、OpenRouter——会在长时间生成期间发送心跳。在 0.4.2 上,这类事件会落到未知事件的兜底分支并抛错,harness 把这次抛错判定为可重试的请求失败,而重试又会撞上下一个心跳:经由这类网关的长生成会一直重连到放弃,在 Web App 里表现为无休止的「正在重连」。++- Responses 协议的 client(`gpt-5.6`、`openai-responses`、`minimax-m3`)把 `keepalive` 视为已知的空操作;Chat Completions 系的 client(`openai-chat`、`deepseek-v4`、`glm-5.3`、`kimi-k3`)只在 `choices` 字段确实有值时才读取它;Anthropic 协议的 client(`claude-5`、`ant-messages`)接受 `ping`。真正未知的事件仍然照旧报错。+- 0.4.4 又把 Gemini 这一侧的判断做得更通用:`gemini3_7` 不再靠「分块既无 candidates 也无 usage」来反推心跳,而是在一个分块里什么都没读出来时——没有内容项、没有 usage、没有 finish reason——直接标记为 `unused`。对于本就不带 usage 的流,两种做法表现一致。++## max 档位++- `ThinkingLevelName` 新增 `"max"`,`mapThinkingLevel` 把它映射到 AgentHub 的 `ThinkingLevel.MAX`。各 client 会把该档位映射到对应厂商能接受的最深 effort,厂商没有这一档时静默降级——Gemini 与 MiniMax M3 止步于各自的 `high`——因此选它不会失败。+- `max` 是**可选**档位,而不只是一个能被接受的已存值。拾取器之所以排除 `none`,是因为多数模型无法关闭思考;`max` 没有这层顾虑,所以它与 `low` / `medium` / `high` / `xhigh` 一同进入 `SELECTABLE_THINKING_LEVELS`、`DEFAULT_CHAT_THINKING_LEVELS`(Project 的 `[default_chat]` 兜底档位),以及 `SUBAGENT_THINKING_LEVELS`——即 `run_subagent` 的 `thinking_level` 接受的档位集合。+- `POST /api/sessions/:id/tasks` 的逐轮 `thinkingLevel` 与 Agent 配置的 `model.thinking_level` 都接受 `max`;其他取值仍然返回 400。+- CLI 同样提供该档位。`--thinking` 与 `/thinking`([#322](https://github.com/Prism-Shadow/penguin-harness/pull/322))是按 core 的 `DEFAULT_CHAT_THINKING_LEVELS` 校验的,因此阶梯一加宽它们就已经接受 `max`;但它们的帮助文本、`/thinking` 的回显与非法取值提示都是把档位写死在文案里的,仍停在 `xhigh`,宣称的集合比实际接受的更窄。现已把这 8 条文案(两种语言)与 CLI 文档补上 `max`,并加了一个测试把「宣称的集合」与「接受的集合」钉在一起,防止二者再次走偏。+- 两个语种此前都把 `xhigh` 描述为扩展推理的「最高」档,新档位使这句话不再成立。现在它的描述改为「在 `high` 之上再进一步」,最高级的说法交给 `max`——AgentHub 也对自己的 playground 选择器做了同样的改写。harness 里没有任何地方对档位做序数比较或收敛,因此不存在其他把 `xhigh` 当作天花板的地方。++## DeepSeek effort 重新映射++DeepSeek 的 `reasoning_effort` 只接受 `low` / `high` / `max`,服务端会把 `medium` 与 `xhigh` 都折算成 `high`。0.4.4 让 client 与这套取值对齐,于是在 DeepSeek 模型上,两个既有档位实际发送的值发生了变化:++| 档位 | 此前发送(0.4.3) | 现在发送(0.4.4) |+| --- | --- | --- |+| `LOW` | `high` | `low` |+| `XHIGH` | `max` | `high` |+| `MAX` | — | `max` |++因此,停在 `low` 的 DeepSeek 会话思考更浅、花费也更少;停在 `xhigh` 的会话思考深度有所下降。++## 思考等级标签标注实际取值++每个档位现在都以它真正发送的取值来标注:中文标签在括号里补上该取值(`极高 (xhigh)`、`最高 (max)`),英文标签则直接就是该取值——是 `xhigh`,不是 `Extreme High`。所有读取这份共享名称表的界面都随之更新:对话态拾取器、会话中途切换的确认框与其提示、以及 Project 聊天默认值对话框。Agent 设置中的行本就显示原始取值。++## 兼容性++- **此前依赖 `xhigh` 的 DeepSeek 用户请改选 `max`**,以保留该档位原先发送的 effort。停在 `low` 的会话无需处理,除非确实想要原先(深得多)的行为,那么最接近的选择是 `high`。+- 加宽 `run_subagent` 的 `thinking_level` 枚举改变了默认工具条目,因此 `KERNEL_VERSION` 推进到 `2026-08-19` 这一代,其中唯一变化的叶子是 `tools.builtin.run_subagent`。所有既有 Agent 都会执行一次内核更新;用户改过的条目保持不动,用户删掉的条目也不会被重新加回,无需任何手工操作。+- 携带任何旧档位的已存配置与 Trace 均照常工作——阶梯只在顶端变长,harness 中没有任何既有取值改变了含义。+- `pnpm-workspace.yaml` 中 `minimumReleaseAgeExclude` 的条目现在只列 0.4.4;按该文件自身注释的要求,移除了 0.4.3 的条目。+- 已逐个比对两个已发布版本的 client,确认 0.4.3 到 0.4.4 之间没有任何 base URL 或端点构造上的改动,因此模型目录与协议路径提示不受影响;`protocol-path.ts` 的校验注释也已改为标注 0.4.4 这一复核版本。diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex c6836165..06a34f8d 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -24,7 +24,7 @@},"dependencies": {"@modelcontextprotocol/client": "^2.0.0",- "@prismshadow/agenthub": "^0.4.2",+ "@prismshadow/agenthub": "^0.4.4","@prismshadow/penguin-core": "workspace:*","@prismshadow/penguin-server": "workspace:*","@prismshadow/penguin-skills": "workspace:*",diff --git a/packages/cli/src/commands/chat.ts b/packages/cli/src/commands/chat.tsindex 93b5a08f..a89bcac7 100644--- a/packages/cli/src/commands/chat.ts+++ b/packages/cli/src/commands/chat.ts@@ -3,7 +3,7 @@** penguin chat [--model-id <id> --provider <group>] [--project-id <id>] [--agent-id <id>]* [--workspace <path>] [--approve <allow-all|deny-all|read-only|always-ask>]- * [--thinking <low|medium|high|xhigh>] [--verbose]+ * [--thinking <low|medium|high|xhigh|max>] [--verbose]** Each line of input starts one conversation turn; `/goal[:<budget>] <objective>` runs* goal mode (looping until the goal reaches a terminal state);diff --git a/packages/cli/src/commands/run.ts b/packages/cli/src/commands/run.tsindex 4722796c..8bb05284 100644--- a/packages/cli/src/commands/run.ts+++ b/packages/cli/src/commands/run.ts@@ -4,7 +4,7 @@* penguin run -m <msg> [--model-id <id> --provider <group>] [--workspace <path>]* [--project-id <id>] [--agent-id <id>]* [--approve <allow-all|deny-all|read-only|always-ask>]- * [--thinking <low|medium|high|xhigh>] [--goal [budget]]+ * [--thinking <low|medium|high|xhigh|max>] [--goal [budget]]** Uses the current directory when Workspace is unspecified; uses the Project's default model* when model is unspecified. A model reference is always an explicit `(provider, model_id)`diff --git a/packages/cli/src/i18n.ts b/packages/cli/src/i18n.tsindex 56d8ae02..d8733aa8 100644--- a/packages/cli/src/i18n.ts+++ b/packages/cli/src/i18n.ts@@ -347,7 +347,7 @@ const en: Messages = {approve:"Approval mode: allow-all (auto-approve, default), deny-all (auto-reject), read-only (auto-approve read-only tools, prompt for the rest), always-ask (prompt per tool)",thinking:- "Thinking level for this session: low, medium, high, or xhigh (defaults to the Agent's configured level)",+ "Thinking level for this session: low, medium, high, xhigh, or max (defaults to the Agent's configured level)",},config: {desc: "Manage Project configuration",@@ -548,12 +548,13 @@ const en: Messages = {`Invalid token budget "${value}". Use a positive number with an optional k/m suffix (500k, 2m).`,goalObjectiveEmpty: () => "Goal mode requires a non-empty objective: pass it via -m.",thinkingCurrentDefault: (level) =>- `[thinking] level: ${level} (this Session's default) — change with /thinking <low|medium|high|xhigh>`,+ `[thinking] level: ${level} (this Session's default) — change with /thinking <low|medium|high|xhigh|max>`,thinkingCurrentOverride: (level, sessionDefault) =>- `[thinking] level: ${level} (override for this chat's turns; this Session's default is ${sessionDefault}) — change with /thinking <low|medium|high|xhigh>`,+ `[thinking] level: ${level} (override for this chat's turns; this Session's default is ${sessionDefault}) — change with /thinking <low|medium|high|xhigh|max>`,thinkingSet: (level) =>`[thinking] level set to ${level} for this chat's subsequent turns (the Agent config is unchanged)`,- thinkingInvalid: (value) => `Invalid thinking level "${value}". Use low, medium, high, or xhigh.`,+ thinkingInvalid: (value) =>+ `Invalid thinking level "${value}". Use low, medium, high, xhigh, or max.`,verboseOn: () => "[verbose] on — tool output from here on shows in full",verboseOff: () =>"[verbose] off — long tool output from here on is collapsed (/verbose to toggle)",@@ -627,7 +628,7 @@ const zh: Messages = {workspace: "Workspace 目录,须为已存在目录(默认当前目录)",approve:"审批模式:allow-all(全部放行,缺省)、deny-all(全部拒绝)、read-only(自动放行只读工具,其余仍逐个询问)、always-ask(逐个询问)",- thinking: "本会话的思考等级:low、medium、high 或 xhigh(缺省用 Agent 配置的等级)",+ thinking: "本会话的思考等级:low、medium、high、xhigh 或 max(缺省用 Agent 配置的等级)",},config: {desc: "管理 Project 配置",@@ -816,11 +817,11 @@ const zh: Messages = {`无效的 token 预算 "${value}":应为正数,可带 k/m 后缀(500k、2m)。`,goalObjectiveEmpty: () => "目标模式需要非空的目标文本:请通过 -m 传入。",thinkingCurrentDefault: (level) =>- `[思考] 当前等级:${level}(本 Session 的缺省值)——用 /thinking <low|medium|high|xhigh> 修改`,+ `[思考] 当前等级:${level}(本 Session 的缺省值)——用 /thinking <low|medium|high|xhigh|max> 修改`,thinkingCurrentOverride: (level, sessionDefault) =>- `[思考] 当前等级:${level}(本次对话后续轮次的覆盖值;本 Session 缺省为 ${sessionDefault})——用 /thinking <low|medium|high|xhigh> 修改`,+ `[思考] 当前等级:${level}(本次对话后续轮次的覆盖值;本 Session 缺省为 ${sessionDefault})——用 /thinking <low|medium|high|xhigh|max> 修改`,thinkingSet: (level) => `[思考] 等级已设为 ${level},本次对话后续轮次生效(不改动 Agent 配置)`,- thinkingInvalid: (value) => `无效的思考等级 "${value}"。请使用 low、medium、high 或 xhigh。`,+ thinkingInvalid: (value) => `无效的思考等级 "${value}"。请使用 low、medium、high、xhigh 或 max。`,verboseOn: () => "[详细输出] 已开启——后续工具输出完整显示(/verbose 切换)",verboseOff: () => "[详细输出] 已关闭——后续过长的工具输出将折叠(/verbose 切换)",toolOutputElided: (hidden) => `……(另有 ${hidden} 行,/verbose 显示完整输出)`,diff --git a/packages/cli/src/thinking-command.ts b/packages/cli/src/thinking-command.tsindex d201eccf..ac166f87 100644--- a/packages/cli/src/thinking-command.ts+++ b/packages/cli/src/thinking-command.ts@@ -2,7 +2,7 @@* Thinking-level control (pure logic, shared by chat's `/thinking`, the `--thinking`* startup flag on run/chat, and unit tests).*- * The selectable levels are core's DEFAULT_CHAT_THINKING_LEVELS (low/medium/high/xhigh),+ * The selectable levels are core's DEFAULT_CHAT_THINKING_LEVELS (low/medium/high/xhigh/max),* mirroring the web pickers: "none" stays a valid stored config value but is never offered* for selection (many models cannot disable thinking).*diff --git a/packages/cli/test/thinking-command.test.ts b/packages/cli/test/thinking-command.test.tsindex 51ba01b8..48b52fd7 100644--- a/packages/cli/test/thinking-command.test.ts+++ b/packages/cli/test/thinking-command.test.ts@@ -5,23 +5,45 @@ import {parseThinkingLevel,} from "../src/thinking-command.js";import type { ThinkingConfigSource } from "../src/thinking-command.js";+import { getMessages } from "../src/i18n.js";+import { DEFAULT_CHAT_THINKING_LEVELS } from "@prismshadow/penguin-core";describe("parseThinkingLevel", () => {- it("accepts the four selectable tiers (trimmed, case-insensitive)", () => {+ it("accepts every selectable tier (trimmed, case-insensitive)", () => {expect(parseThinkingLevel("low")).toBe("low");expect(parseThinkingLevel("medium")).toBe("medium");expect(parseThinkingLevel(" HIGH ")).toBe("high");expect(parseThinkingLevel("xhigh")).toBe("xhigh");+ // "max" joined the ladder with AgentHub 0.4.4; the flag and /thinking accept it because+ // both validate against core's DEFAULT_CHAT_THINKING_LEVELS, and the printed sets say so.+ expect(parseThinkingLevel("MAX")).toBe("max");});it('rejects "none" (a valid stored value but never selectable, mirroring the web picker) and garbage', () => {expect(parseThinkingLevel("none")).toBeNull();expect(parseThinkingLevel("")).toBeNull();- expect(parseThinkingLevel("max")).toBeNull();expect(parseThinkingLevel("x-high")).toBeNull();});});+describe("the advertised tier set matches the accepted one", () => {+ it("every tier the messages name is actually accepted, in both locales", () => {+ // #322 spelled the ladder out in free text rather than deriving it, so widening the+ // ladder in core silently desynced the printed set from the accepted one. Pin it.+ for (const messages of [getMessages("en"), getMessages("zh")]) {+ const printed = [+ messages.common.thinking,+ messages.thinkingCurrentDefault("low"),+ messages.thinkingCurrentOverride("low", "medium"),+ messages.thinkingInvalid("bogus"),+ ].join(" ");+ for (const level of DEFAULT_CHAT_THINKING_LEVELS) {+ expect(printed).toContain(level);+ }+ }+ });+});+describe("parseThinkingCommand", () => {it("bare /thinking asks to show the current level", () => {expect(parseThinkingCommand("/thinking")).toEqual({ ok: true, level: null });@@ -43,8 +65,8 @@ describe("parseThinkingCommand", () => {describe("configuredThinkingLevel (display mirror of core's resolution chain)", () => {const source = (- agentLevel: "none" | "low" | "medium" | "high" | "xhigh" | undefined,- projectDefault: "low" | "medium" | "high" | "xhigh" | undefined,+ agentLevel: "none" | "low" | "medium" | "high" | "xhigh" | "max" | undefined,+ projectDefault: "low" | "medium" | "high" | "xhigh" | "max" | undefined,): ThinkingConfigSource => ({state: { systemConfig: agentLevel ? { model: { thinking_level: agentLevel } } : {} },projectConfig: projectDefault ? { default_chat: { thinking_level: projectDefault } } : {},diff --git a/packages/core/package.json b/packages/core/package.jsonindex 9e1c11f3..6122d86e 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -46,7 +46,7 @@},"dependencies": {"@modelcontextprotocol/client": "^2.0.0",- "@prismshadow/agenthub": "^0.4.2",+ "@prismshadow/agenthub": "^0.4.4","@prismshadow/penguin-skills": "workspace:*","arktype": "^2.2.3","smol-toml": "^1.3.0",diff --git a/packages/core/src/interfaces.ts b/packages/core/src/interfaces.tsindex 0184b575..85acb1c0 100644--- a/packages/core/src/interfaces.ts+++ b/packages/core/src/interfaces.ts@@ -101,7 +101,7 @@ export type ApproveFn = (toolCall: OmniMessage<ToolCallPayload>) => Promise<Appr// LLM interface// ----------------------------------------------------------------------------export type ThinkingLevelName = "none" | "low" | "medium" | "high" | "xhigh";+export type ThinkingLevelName = "none" | "low" | "medium" | "high" | "xhigh" | "max";/*** GenerativeModel initialization config.@@ -257,7 +257,7 @@ export interface SubagentHandle {/*** Thinking levels the model may request for a spawned child Session (`run_subagent`'s- * `thinking_level` argument): the four selectable tiers only — never `"none"`, mirroring the+ * `thinking_level` argument): the selectable tiers only — never `"none"`, mirroring the* user-facing pickers (many models cannot disable thinking; see the web picker's* SELECTABLE_THINKING_LEVELS and project-config's DEFAULT_CHAT_THINKING_LEVELS). Omitting the* argument inherits the parent Session's effective level, so a parent genuinely running@@ -268,6 +268,7 @@ export const SUBAGENT_THINKING_LEVELS: readonly ThinkingLevelName[] = ["medium","high","xhigh",+ "max",];/**diff --git a/packages/core/src/llm/generative-model.ts b/packages/core/src/llm/generative-model.tsindex eeccf194..f8d3992c 100644--- a/packages/core/src/llm/generative-model.ts+++ b/packages/core/src/llm/generative-model.ts@@ -1433,6 +1433,7 @@ export function mapThinkingLevel(name: ThinkingLevelName | undefined): ThinkingLmedium: ThinkingLevel.MEDIUM,high: ThinkingLevel.HIGH,xhigh: ThinkingLevel.XHIGH,+ max: ThinkingLevel.MAX,};return table[name];}diff --git a/packages/core/src/state/kernel-history.ts b/packages/core/src/state/kernel-history.tsindex 6867fa08..a0bb803f 100644--- a/packages/core/src/state/kernel-history.ts+++ b/packages/core/src/state/kernel-history.ts@@ -26,7 +26,7 @@ import type { SystemConfig } from "./default-config.js";* pinned-hash test enforces both directions (bump without new hashes, or changed defaults* without a bump, both fail).*/-export const KERNEL_VERSION = "2026-08-18";+export const KERNEL_VERSION = "2026-08-19";/*** Identity / user-data fields excluded from kernel management: never hashed, never written@@ -141,8 +141,11 @@ export function isKernelOutdated(kernelVersion: string | null | undefined): bool* byte-exact reconstruction of that era's defaults from the frozen LEGACY_* constants;* that proof self-retired once the defaults evolved past the toggles generation.* - `"2026-08-11"` — the toggles generation.- * - `"2026-08-18"` (current) — `run_subagent` gained the optional `thinking_level` argument+ * - `"2026-08-18"` — `run_subagent` gained the optional `thinking_level` argument* (issue #306): only the `tools.builtin.run_subagent` leaf changed.+ * - `"2026-08-19"` (current) — the `max` thinking level joined the ladder, widening+ * `run_subagent`'s `thinking_level` enum: again only the `tools.builtin.run_subagent` leaf+ * changed.** Generations older than the seeded ones cannot be fully reconstructed; their values match* no recorded hash and are conservatively kept by a kernel update (restore-default-config is@@ -251,6 +254,42 @@ export const KERNEL_HASH_HISTORY: Readonly<Record<string, Readonly<Record<string"tools.builtin.describe_image":"fad6d0cdd483eb53b5d243c0508024ab3b708ce6d3c81933acd291f05d4a265f",},+ "2026-08-19": {+ system_prompt: "de8952daede04db17400c5cd59b279eccf523cf2d8a0ecedfa37a96de7925b44",+ max_turns: "1bad6b8cf97131fceab8543e81f7757195fbb1d36b376ee994ad1cf17699c464",+ "model.max_tokens": "492f431bae35265f2e5f4ed49bd8c58dda912431be561504846988d00d05d117",+ "model.thinking_level": "60d4c90eee5e731df8d3ef2891de541d2e755ff8ee9db358e26bdec49f6e0db9",+ "model.timeoutMs": "4f9f73b34c5b89879aad65a48025f3187dd9ce6dc3d4e88eecb2fc79227350f1",+ "compaction.max_context_length":+ "8eda794b86cb709202a0023fd5273e3de6d24117b7e36b9bdb53c0238dac4785",+ "compaction.max_session_turns":+ "1bad6b8cf97131fceab8543e81f7757195fbb1d36b376ee994ad1cf17699c464",+ "compaction.mode": "e58fac0b4b9c0f29b3d224da119dff5f6517a40d139faf92e309705b98bd410a",+ "compaction.prompt": "8ed55781e8071083f8246ed70d9e063ee729d3872d5bc6a2bedfa9c99aed6ae5",+ "memory.enabled": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",+ "memory.prompt": "9380e2382e5dd3d37a6470b0bc0d27c9ed113fa9a54ff78122784c57a16b992c",+ "memory.workspace_prompt": "76c5a8e18a568f471593ef1da6d75d2596f27619cb877703b2dd28bb0554e0d5",+ "vault.enabled": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",+ "vault.prompt": "66e607aa4e205413f1816a677bed31af2d8c24218e71b55adba54aff5aa094ce",+ "skills.enabled": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",+ "skills.prompt": "42934d17f5dd9c02dfa7c1d37f255dea92bd36905c96a54775c65ef7db713bd9",+ "schedules.enabled": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",+ "schedules.prompt": "3c690ff9bb3e4d423b2d5dfce74f5890d52bf8ae159cfe135a671ac3d46da75a",+ "tools.builtin.read_file": "858f128945421043f5f373c908a0ee081e93e9413debaa49c8c7af1c1c76db3c",+ "tools.builtin.edit_file": "165a3e2dabe3d13200a1670f3c23ed2d6561c508439db1972db066719f3549ef",+ "tools.builtin.write_file": "c98253bd5a3b6ff021accda91af016a809a9b50ce56f38a3ed60eeb673c0b130",+ "tools.builtin.exec_command":+ "16b327e5c3617b7c4d21505c9d1a72dd33a74de97cd5c60d6c4538b8ec408421",+ "tools.builtin.input_command":+ "4c907500cda145161a9481803cfb57ed814b6793e762fd6284510187e9d781c8",+ "tools.builtin.run_subagent":+ "f43ac4f9621032d554275be1d416f994f0d3cc0918537de99c974e436eb69316",+ "tools.builtin.input_subagent":+ "22cc4648d773e8422e80a12a7a095b00b7f7eb01ab5a9ea080858dcd7517b4e3",+ "tools.builtin.read_image": "05b797a88df1e6a90fb3da67ec654b206f8d81291f89d160a505620afcea38bb",+ "tools.builtin.describe_image":+ "fad6d0cdd483eb53b5d243c0508024ab3b708ce6d3c81933acd291f05d4a265f",+ },};/**diff --git a/packages/core/src/state/project-config.ts b/packages/core/src/state/project-config.tsindex 28ccf0fc..2f822322 100644--- a/packages/core/src/state/project-config.ts+++ b/packages/core/src/state/project-config.ts@@ -126,7 +126,7 @@ export const CHAT_APPROVAL_MODES = ["allow-all", "deny-all", "read-only", "alwayexport type ChatApprovalMode = (typeof CHAT_APPROVAL_MODES)[number];/**- * Thinking levels storable in `[default_chat]`: the four selectable tiers only — never+ * Thinking levels storable in `[default_chat]`: the selectable tiers only — never* `"none"` (the project default is a fallback for Agents without an explicit level, and* "no thinking" is not offered as a default; see the web picker's SELECTABLE_THINKING_LEVELS).*/@@ -136,6 +136,7 @@ export const DEFAULT_CHAT_THINKING_LEVELS: readonly DefaultChatThinkingLevel[] ="medium","high","xhigh",+ "max",];/**diff --git a/packages/core/test/llm.test.ts b/packages/core/test/llm.test.tsindex 3a8214e6..6d06d934 100644--- a/packages/core/test/llm.test.ts+++ b/packages/core/test/llm.test.ts@@ -1022,6 +1022,7 @@ describe("config helpers", () => {expect(mapThinkingLevel("medium")).toBe(ThinkingLevel.MEDIUM);expect(mapThinkingLevel("high")).toBe(ThinkingLevel.HIGH);expect(mapThinkingLevel("xhigh")).toBe(ThinkingLevel.XHIGH);+ expect(mapThinkingLevel("max")).toBe(ThinkingLevel.MAX);expect(mapThinkingLevel(undefined)).toBeUndefined();});diff --git a/packages/core/test/subagent.test.ts b/packages/core/test/subagent.test.tsindex a95f1c72..0c4caa18 100644--- a/packages/core/test/subagent.test.ts+++ b/packages/core/test/subagent.test.ts@@ -250,7 +250,7 @@ describe("run_subagent tool (foreground)", () => {);expect(result?.stopReason).toBe("failed");expect(ownDeltas(out)).toContain("invalid `thinking_level`");- expect(ownDeltas(out)).toContain("low / medium / high / xhigh");+ expect(ownDeltas(out)).toContain("low / medium / high / xhigh / max");expect(spawned).toHaveLength(0);}});diff --git a/packages/docs/content/cli.en.md b/packages/docs/content/cli.en.mdindex 0fa7ffa0..1604aec8 100644--- a/packages/docs/content/cli.en.md+++ b/packages/docs/content/cli.en.md@@ -27,7 +27,7 @@ penguin run -m "Summarize the code structure of this directory"| `--agent-id <id>` | Agent to use || `--workspace <path>` | Workspace directory; defaults to the current directory and must exist || `--approve <mode>` | Approval mode, see below |-| `--thinking <level>` | Thinking level for the Session: `low` / `medium` / `high` / `xhigh`. Omitted, the configured chain applies (the Agent's `model.thinking_level`, else the Project's `default_chat.thinking_level`, else `medium`). Pinned at Session creation, so spawned subagent sessions follow it |+| `--thinking <level>` | Thinking level for the Session: `low` / `medium` / `high` / `xhigh` / `max`. Omitted, the configured chain applies (the Agent's `model.thinking_level`, else the Project's `default_chat.thinking_level`, else `medium`). Pinned at Session creation, so spawned subagent sessions follow it |## penguin chat@@ -48,7 +48,7 @@ In-REPL commands:| `/compact` | Proactively compact the current context || `/clear` | Start a fresh blank Session in place; the old Session stays on disk and can be resumed with `--resume` || `/thinking` | Show the thinking level the next turn will run at, and whether it is this Session's default or an active per-turn override (which also names the default it overrides) |-| `/thinking <level>` | Override the thinking level (`low` / `medium` / `high` / `xhigh`) for subsequent turns of this chat; never written back to the Agent config. The override applies to this Session's own turns only — subagent sessions are spawned with the level the Session was created with |+| `/thinking <level>` | Override the thinking level (`low` / `medium` / `high` / `xhigh` / `max`) for subsequent turns of this chat; never written back to the Agent config. The override applies to this Session's own turns only — subagent sessions are spawned with the level the Session was created with || `/verbose` | Toggle between collapsed and full tool output || `/exit`, `/quit` | Quit |diff --git a/packages/docs/content/cli.zh.md b/packages/docs/content/cli.zh.mdindex 7c9ea4ec..6d088dce 100644--- a/packages/docs/content/cli.zh.md+++ b/packages/docs/content/cli.zh.md@@ -27,7 +27,7 @@ penguin run -m "总结当前目录的代码结构"| `--agent-id <id>` | 指定 Agent || `--workspace <path>` | Workspace 目录,默认当前目录,必须已存在 || `--approve <mode>` | 审批模式,见下文 |-| `--thinking <level>` | 本 Session 的思考等级:`low` / `medium` / `high` / `xhigh`。省略时按配置链取值(Agent 的 `model.thinking_level`,其次 Project 的 `default_chat.thinking_level`,最后 `medium`)。在 Session 创建时钉定,派生的子会话随之生效 |+| `--thinking <level>` | 本 Session 的思考等级:`low` / `medium` / `high` / `xhigh` / `max`。省略时按配置链取值(Agent 的 `model.thinking_level`,其次 Project 的 `default_chat.thinking_level`,最后 `medium`)。在 Session 创建时钉定,派生的子会话随之生效 |## penguin chat@@ -48,7 +48,7 @@ REPL 内命令:| `/compact` | 主动压缩当前上下文 || `/clear` | 原地开启全新空白 Session;原会话保留在磁盘上,仍可用 `--resume` 恢复 || `/thinking` | 显示下一轮将使用的思考等级,并区分它是本 Session 的缺省值还是生效中的逐轮覆盖值(后者同时给出被覆盖的缺省值) |-| `/thinking <level>` | 覆盖本次对话后续轮次的思考等级(`low` / `medium` / `high` / `xhigh`);不会写回 Agent 配置。该覆盖只作用于本 Session 自己的轮次——派生的子会话仍按 Session 创建时的等级启动 |+| `/thinking <level>` | 覆盖本次对话后续轮次的思考等级(`low` / `medium` / `high` / `xhigh` / `max`);不会写回 Agent 配置。该覆盖只作用于本 Session 自己的轮次——派生的子会话仍按 Session 创建时的等级启动 || `/verbose` | 在折叠与完整工具输出之间切换 || `/exit`、`/quit` | 退出 |diff --git a/packages/docs/content/configuration.en.md b/packages/docs/content/configuration.en.mdindex 3a4590d7..23136df4 100644--- a/packages/docs/content/configuration.en.md+++ b/packages/docs/content/configuration.en.md@@ -103,7 +103,7 @@ Edit this file via the CLI (`penguin config model …`) or the Web Models page| `system_prompt` | built-in template | Required; the only template with placeholder substitution || `max_turns` | `-1` | Maximum LLM turns per Task (`-1` = unlimited; a positive integer caps the Task) || `model.max_tokens` | `32000` | Output Token ceiling per Request (-1 = no cap, provider default); each request clamps the effective value to the model's `context_window` minus the estimated input, so a small-window model never gets asked for more than fits |-| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh`; the session default, overridable per-Task |+| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh` / `max`; the session default, overridable per-Task || `model.timeoutMs` | `120000` | Per-Request timeout (milliseconds) || `compaction.max_context_length` | `128000` | Context Token threshold that triggers compaction; the effective threshold is capped at the model's `context_window` − 2048 so compaction fires before a small window overflows || `compaction.max_session_turns` | `-1` | Cumulative Session turn threshold (`-1` = unlimited) |diff --git a/packages/docs/content/configuration.zh.md b/packages/docs/content/configuration.zh.mdindex 2b8c0712..759376e4 100644--- a/packages/docs/content/configuration.zh.md+++ b/packages/docs/content/configuration.zh.md@@ -103,7 +103,7 @@ output = 0.857143| `system_prompt` | 内置模板 | 必填;唯一进行占位符替换的模板 || `max_turns` | `-1` | 单个 Task 的最大 LLM 轮数(`-1` 不限制,正整数为上限) || `model.max_tokens` | `32000` | 单次输出 Token 天花板(-1 不设上限,用服务商默认);每次请求会把实际值收敛到模型 `context_window` 减估算输入以内,小窗口模型不会被索要放不下的输出 |-| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh`;作为会话默认档位,可被逐轮 Task 参数覆盖 |+| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh` / `max`;作为会话默认档位,可被逐轮 Task 参数覆盖 || `model.timeoutMs` | `120000` | 单次 Request 超时(毫秒) || `compaction.max_context_length` | `128000` | 触发压缩的上下文 Token 阈值;生效阈值不超过模型 `context_window` − 2048,压缩在小窗口溢出之前触发 || `compaction.max_session_turns` | `-1` | Session 累计轮数阈值(`-1` 不限制) |diff --git a/packages/docs/content/interfaces.en.md b/packages/docs/content/interfaces.en.mdindex 8d0e4741..6ddd07f4 100644--- a/packages/docs/content/interfaces.en.md+++ b/packages/docs/content/interfaces.en.md@@ -86,7 +86,7 @@ interface GenerativeModelConfig {contextWindow?: number;maxTokens?: number;fastMode?: boolean; // per-model fast mode (AgentHub fast_mode; premium faster tier), off by default- thinkingLevel?: ThinkingLevelName; // construction default (a per-request parameter can override); "none" | "low" | "medium" | "high" | "xhigh"+ thinkingLevel?: ThinkingLevelName; // construction default (a per-request parameter can override); "none" | "low" | "medium" | "high" | "xhigh" | "max"requestTimeoutMs?: number; // per-Request timeout, default 120000; <=0 disablestoolCallIds?: ToolCallIdAllocator; // Session-level tool_call_id registry (pass the same instance across compaction)}diff --git a/packages/docs/content/interfaces.zh.md b/packages/docs/content/interfaces.zh.mdindex 1da894ca..6967551f 100644--- a/packages/docs/content/interfaces.zh.md+++ b/packages/docs/content/interfaces.zh.md@@ -86,7 +86,7 @@ interface GenerativeModelConfig {contextWindow?: number;maxTokens?: number;fastMode?: boolean; // 单模型快速模式(AgentHub fast_mode;溢价快速档位),默认关闭- thinkingLevel?: ThinkingLevelName; // 构造期默认档位(逐请求参数可覆盖);"none" | "low" | "medium" | "high" | "xhigh"+ thinkingLevel?: ThinkingLevelName; // 构造期默认档位(逐请求参数可覆盖);"none" | "low" | "medium" | "high" | "xhigh" | "max"requestTimeoutMs?: number; // 单次 Request 超时,默认 120000;<=0 关闭toolCallIds?: ToolCallIdAllocator; // Session 级 tool_call_id 唯一性登记表(压缩重建时传同一实例)}diff --git a/packages/docs/content/models.en.md b/packages/docs/content/models.en.mdindex 9b3b4a39..f2d40f7c 100644--- a/packages/docs/content/models.en.md+++ b/packages/docs/content/models.en.md@@ -110,7 +110,9 @@ Unlike protocol detection, **this probe is a real, billed completion**: an imageFor MiniMax M3, `none` maps directly to `reasoning.effort = "none"`.-Five levels: `none | low | medium | high | xhigh`, configured per Agent as `model.thinking_level` in `system_config.yaml`, default medium. The Web pickers offer `low` and above only (many models cannot disable thinking; `none` stays a valid stored value and still displays). The chat draft view offers a quick picker next to the model selector: a picked level is written back to the selected Agent's setting immediately (the switched-to level becomes that Agent's new default and applies from the next session). Inside an active session the thinking level is a **per-turn parameter**: the composer's picker lists only the levels and starts out showing the Agent config's level — while the user hasn't picked one it auto-follows the config (sends omit the level, so config edits keep taking effect); once picked, the level sticks for that session and rides on every subsequent send (it applies to that session's subsequent Tasks only and never writes back to the Agent config). See [Configuration](/configuration).+DeepSeek V4 accepts `low`/`high`/`max` and folds `medium` and `xhigh` onto `high` server-side. AgentHub 0.4.4 aligned the client with that vocabulary, so on DeepSeek models `low` now sends `low` (it previously sent `high`) and `xhigh` now sends `high` (it previously sent `max`): a Session left on `low` reasons less — and costs less — than before, and one on `xhigh` reasons less deeply. Pick `max` to get DeepSeek's deepest effort.++Six levels: `none | low | medium | high | xhigh | max`, configured per Agent as `model.thinking_level` in `system_config.yaml`, default medium. The Web pickers offer `low` and above only (many models cannot disable thinking; `none` stays a valid stored value and still displays). Every level is labelled with the wire value it sends, so the label names exactly what goes on the request. `max` is the deepest tier: each client maps it onto the deepest effort its vendor accepts and degrades silently where there is no such tier, so picking it never fails — on Gemini and MiniMax M3 it lands on the same effort as `xhigh`. The chat draft view offers a quick picker next to the model selector: a picked level is written back to the selected Agent's setting immediately (the switched-to level becomes that Agent's new default and applies from the next session). Inside an active session the thinking level is a **per-turn parameter**: the composer's picker lists only the levels and starts out showing the Agent config's level — while the user hasn't picked one it auto-follows the config (sends omit the level, so config edits keep taking effect); once picked, the level sticks for that session and rides on every subsequent send (it applies to that session's subsequent Tasks only and never writes back to the Agent config). See [Configuration](/configuration).## Fast modediff --git a/packages/docs/content/models.zh.md b/packages/docs/content/models.zh.mdindex 8a99cb01..1133c586 100644--- a/packages/docs/content/models.zh.md+++ b/packages/docs/content/models.zh.md@@ -110,7 +110,9 @@ Custom 与自建分组走 AgentHub 的通用协议客户端,Web 对话框会对于 MiniMax M3,`none` 会直接映射为 `reasoning.effort = "none"`。-思考等级共五档:`none | low | medium | high | xhigh`,按 Agent 在 `system_config.yaml` 的 `model.thinking_level` 配置,默认 medium。Web 拾取器只提供 `low` 及以上档位(多数模型不支持关闭思考;`none` 仍是合法的已存值,能正常显示)。对话草稿页在模型选择器旁提供快捷拾取器:选定档位立即写回所选 Agent 的该项配置(切换后的档位即成为该 Agent 的新默认,自下一个 Session 生效)。进行中的会话里,思考等级是**逐轮参数**:输入区拾取器只列出各档位,初始即显示 Agent 配置的档位——用户未手动选择时自动跟随配置下发(请求不携带档位,配置的修改持续生效);选定某档后即固定为该会话的档位,随之后每次发送携带(仅作用于该会话的后续 Task,不写回 Agent 配置)。见 [配置参考](/configuration)。+DeepSeek V4 只接受 `low`/`high`/`max`,服务端会把 `medium` 与 `xhigh` 都折算成 `high`。AgentHub 0.4.4 让 client 与这套取值对齐,因此在 DeepSeek 模型上,`low` 现在发送 `low`(此前发送 `high`),`xhigh` 现在发送 `high`(此前发送 `max`):停在 `low` 的会话思考更浅、花费也更少,停在 `xhigh` 的会话思考深度有所下降。想要 DeepSeek 最深的思考档位,请选 `max`。++思考等级共六档:`none | low | medium | high | xhigh | max`,按 Agent 在 `system_config.yaml` 的 `model.thinking_level` 配置,默认 medium。Web 拾取器只提供 `low` 及以上档位(多数模型不支持关闭思考;`none` 仍是合法的已存值,能正常显示)。每个档位都以实际发送的取值标注,标签即请求上真正带的值。`max` 是最深的一档:各 client 会把它映射到对应厂商能接受的最深档位,厂商没有这一档时静默降级,因此选它不会失败——在 Gemini 与 MiniMax M3 上它与 `xhigh` 落到同一档。对话草稿页在模型选择器旁提供快捷拾取器:选定档位立即写回所选 Agent 的该项配置(切换后的档位即成为该 Agent 的新默认,自下一个 Session 生效)。进行中的会话里,思考等级是**逐轮参数**:输入区拾取器只列出各档位,初始即显示 Agent 配置的档位——用户未手动选择时自动跟随配置下发(请求不携带档位,配置的修改持续生效);选定某档后即固定为该会话的档位,随之后每次发送携带(仅作用于该会话的后续 Task,不写回 Agent 配置)。见 [配置参考](/configuration)。## 快速模式diff --git a/packages/docs/content/server-api.en.md b/packages/docs/content/server-api.en.mdindex a3621140..d92c5bd9 100644--- a/packages/docs/content/server-api.en.md+++ b/packages/docs/content/server-api.en.md@@ -269,9 +269,9 @@ Key request bodies (explicit keys):// POST /api/sessions/:sessionId/tasks — start a Taskinterface TaskCreateRequest {input: TaskInputPart[];- // Thinking level for this Task (a per-turn parameter, one of the five names; 400 otherwise);+ // Thinking level for this Task (a per-turn parameter, one of the six names; 400 otherwise);// omitted = falls back to the Session's pinned level, then to the Agent config- thinkingLevel?: "none" | "low" | "medium" | "high" | "xhigh";+ thinkingLevel?: "none" | "low" | "medium" | "high" | "xhigh" | "max";}type TaskInputPart =| { type: "text"; text: string }diff --git a/packages/docs/content/server-api.zh.md b/packages/docs/content/server-api.zh.mdindex a311b0fe..c18f68e1 100644--- a/packages/docs/content/server-api.zh.md+++ b/packages/docs/content/server-api.zh.md@@ -268,8 +268,8 @@ GET /preview/<token>/<相对路径> (不鉴权,令牌即凭证// POST /api/sessions/:sessionId/tasks —— 发起一个 Taskinterface TaskCreateRequest {input: TaskInputPart[];- // 本次 Task 的思考等级(逐轮参数,五档之一;非法值 400);缺省 = 先回退到该 Session 固定的档位,再回退到 Agent 配置- thinkingLevel?: "none" | "low" | "medium" | "high" | "xhigh";+ // 本次 Task 的思考等级(逐轮参数,六档之一;非法值 400);缺省 = 先回退到该 Session 固定的档位,再回退到 Agent 配置+ thinkingLevel?: "none" | "low" | "medium" | "high" | "xhigh" | "max";}type TaskInputPart =| { type: "text"; text: string }diff --git a/packages/docs/content/tools.en.md b/packages/docs/content/tools.en.mdindex 7d273973..2abc7977 100644--- a/packages/docs/content/tools.en.md+++ b/packages/docs/content/tools.en.md@@ -172,7 +172,7 @@ On POSIX, Ctrl-C sends `SIGINT` to the session's process group, interrupting theagent_id?: string; // the child Agent; defaults to the current Agentmodel_id?: string; // the child Session's model, paired with provider; omit both to inherit the parent Session's modelprovider?: string; // the provider group model_id belongs to; required whenever model_id is given- thinking_level?: string; // "low" | "medium" | "high" | "xhigh"; omit to inherit the parent Session's level+ thinking_level?: string; // "low" | "medium" | "high" | "xhigh" | "max"; omit to inherit the parent Session's levelyield_time_ms?: number; // foreground wait; default 300000description: string; // required while call_description is on}diff --git a/packages/docs/content/tools.zh.md b/packages/docs/content/tools.zh.mdindex 26b7ec14..d47a3f33 100644--- a/packages/docs/content/tools.zh.md+++ b/packages/docs/content/tools.zh.md@@ -170,7 +170,7 @@ POSIX 上 Ctrl-C 向会话进程组发送 `SIGINT`,中断前台命令。Windowagent_id?: string; // 子 Agent;缺省复用当前 Agentmodel_id?: string; // 子 Session 模型,须与 provider 成对给出;两者都缺省时继承父 Session 的模型provider?: string; // model_id 所属的 provider 组;给出 model_id 时必填- thinking_level?: string; // "low" | "medium" | "high" | "xhigh";缺省继承父 Session 的思考等级+ thinking_level?: string; // "low" | "medium" | "high" | "xhigh" | "max";缺省继承父 Session 的思考等级yield_time_ms?: number; // 前台等待时长;默认 300000description: string; // 开关开启时必填}diff --git a/packages/server/src/api/types.ts b/packages/server/src/api/types.tsindex 273fedfb..0ba8cb69 100644--- a/packages/server/src/api/types.ts+++ b/packages/server/src/api/types.ts@@ -548,7 +548,7 @@ export interface ChatDefaultsDto {/*** Fallback thinking level for Agents whose config has no explicit `model.thinking_level`* (resolution chain: Agent explicit > this project default > built-in "medium"). Never- * "none" — only the four selectable tiers.+ * "none" — only the selectable tiers.*/thinkingLevel?: Exclude<ThinkingLevelName, "none">;}@@ -972,7 +972,7 @@ export interface SessionResponse {export interface SessionPatchRequest {approvalMode?: ApprovalMode;/**- * Pin this Session's thinking level (`none | low | medium | high | xhigh`, anything else+ * Pin this Session's thinking level (`none | low | medium | high | xhigh | max`, anything else* is a 400). It applies to every later run of the Session that doesn't carry its own* level, and replaces the Agent-config fallback for this Session. There is no unpin:* the picker only offers concrete levels.@@ -1090,7 +1090,7 @@ export interface TaskCreateRequest {input: TaskInputPart[];/*** Thinking level for this Task's LLM requests (a per-turn parameter; one of- * `none | low | medium | high | xhigh`, anything else is a 400). Omitted = falls back to+ * `none | low | medium | high | xhigh | max`, anything else is a 400). Omitted = falls back to* the Session's pinned level (`SessionInfo.thinkingLevel`) and, when that is unset too,* to the Agent config's `model.thinking_level`. A queued follow-up (`queueIfBusy`) keeps* its level and applies it when it auto-starts.diff --git a/packages/server/src/db/schema.ts b/packages/server/src/db/schema.tsindex 3ff5ea3a..ddeeeed0 100644--- a/packages/server/src/db/schema.ts+++ b/packages/server/src/db/schema.ts@@ -52,7 +52,7 @@ CREATE TABLE IF NOT EXISTS sessions (model_id TEXT NOT NULL, -- upstream model id (sent to AgentHub as-is; never concatenate <provider>/<id>)workspace TEXT NOT NULL,approval_mode TEXT NOT NULL DEFAULT 'allow-all', -- allow-all|deny-all|read-only|always-ask- thinking_level TEXT, -- level pinned for THIS session (none|low|medium|high|xhigh); NULL=not pinned, runs follow the Agent config+ thinking_level TEXT, -- level pinned for THIS session (none|low|medium|high|xhigh|max); NULL=not pinned, runs follow the Agent configtitle TEXT, -- auto-generated by the model after the first exchange; NULL=not yet (frontend shows "New chat")archived_at TEXT, -- archive time; NULL=not archived (shown by default; archived ones move under "Archived")client TEXT, -- creating client: 'web' (created via the Web App) | 'cli' (adopted from a CLI Trace); NULL = legacy row, treated as webdiff --git a/packages/server/src/http/routes/chat-defaults.ts b/packages/server/src/http/routes/chat-defaults.tsindex 8966588d..c3184bf2 100644--- a/packages/server/src/http/routes/chat-defaults.ts+++ b/packages/server/src/http/routes/chat-defaults.ts@@ -54,7 +54,7 @@ export function chatDefaultsRoutes(deps: AppDeps): Hono<AppEnv> {const approvalMode = optionalEnum(body, "approvalMode", APPROVAL_MODES);if (approvalMode !== undefined) req.approvalMode = approvalMode;- // Only the four selectable tiers — "none" is rejected (never offered as a default).+ // Only the selectable tiers — "none" is rejected (never offered as a default).const thinkingLevel = optionalEnum(body, "thinkingLevel", DEFAULT_CHAT_THINKING_LEVELS);if (thinkingLevel !== undefined) req.thinkingLevel = thinkingLevel;diff --git a/packages/server/src/http/routes/sessions.ts b/packages/server/src/http/routes/sessions.tsindex eb251ba0..ae786ecb 100644--- a/packages/server/src/http/routes/sessions.ts+++ b/packages/server/src/http/routes/sessions.ts@@ -77,8 +77,15 @@ export const APPROVAL_MODES: readonly ApprovalMode[] = ["always-ask",];-/** The five valid per-turn thinking level names (TaskCreateRequest.thinkingLevel). */-const THINKING_LEVELS: readonly ThinkingLevelName[] = ["none", "low", "medium", "high", "xhigh"];+/** The valid per-turn thinking level names (TaskCreateRequest.thinkingLevel). */+const THINKING_LEVELS: readonly ThinkingLevelName[] = [+ "none",+ "low",+ "medium",+ "high",+ "xhigh",+ "max",+];/** Unit-count bounds for windowed history reads (`tailLimit` / `limit`), and the `before` page's default. */const MESSAGES_PAGE_LIMIT_MAX = 1000;@@ -802,7 +809,7 @@ export function sessionsRoutes(deps: AppDeps): Hono<AppEnv> {const row = resolveSession(c);const body = await readJson(c);const goal = parseGoalField(body);- // Per-turn thinking level (optional): validated against the five names; omitted follows+ // Per-turn thinking level (optional): validated against the level names; omitted follows// the session's default. In goal mode it rides every round of the goal; a queued// follow-up keeps its level for its auto-start.const thinkingLevel = optionalEnum(body, "thinkingLevel", THINKING_LEVELS);diff --git a/packages/server/src/services/agent-config-service.ts b/packages/server/src/services/agent-config-service.tsindex 407f44ef..0cd87242 100644--- a/packages/server/src/services/agent-config-service.ts+++ b/packages/server/src/services/agent-config-service.ts@@ -66,7 +66,14 @@ import {} from "../http/validate.js";import { maskApiKey } from "./project-config-service.js";-const THINKING_LEVELS: readonly ThinkingLevelName[] = ["none", "low", "medium", "high", "xhigh"];+const THINKING_LEVELS: readonly ThinkingLevelName[] = [+ "none",+ "low",+ "medium",+ "high",+ "xhigh",+ "max",+];const COMPACTION_MODES = ["summarize", "discard"] as const;function asRecord(v: unknown): Record<string, unknown> {diff --git a/packages/skills/skills/agenthub-models/SKILL.md b/packages/skills/skills/agenthub-models/SKILL.mdindex 5e8c6cef..1f26b24f 100644--- a/packages/skills/skills/agenthub-models/SKILL.md+++ b/packages/skills/skills/agenthub-models/SKILL.md@@ -124,7 +124,7 @@ for await (const event of client.streamingResponseStateful({```- Each `event` is a `UniEvent`: `event_type` is `start` | `delta` | `stop`, and `content_items` carry the increments.-- `config` accepts `max_tokens`, `temperature`, `system_prompt`, `thinking_level` (the `ThinkingLevel` enum, `NONE` to `XHIGH`), `tool_choice`, `prompt_caching`, `fast_mode` and `tools`.+- `config` accepts `max_tokens`, `temperature`, `system_prompt`, `thinking_level` (the `ThinkingLevel` enum, `NONE` to `MAX`), `tool_choice`, `prompt_caching`, `fast_mode` and `tools`.- `streamingResponseStateful` keeps conversation history inside the client; manage it with `getHistory()` / `setHistory(history)` / `clearHistory()`. The stateless variant is `streamingResponse({ messages, config })`.## Config parameters the model may reject@@ -141,7 +141,7 @@ try {}```-- `thinking_level` never throws: every client maps each level onto the closest one the model supports. Kimi K3 reasons unconditionally, so `NONE` degrades to its lowest effort rather than disabling thinking; GLM-5.2 sends `reasoning_effort` alongside its `thinking` block and only `NONE` disables it. GLM-5.3 thinks unconditionally (`NONE` degrades to the light `low` effort) and clamps `reasoning_effort` to `low`/`high`/`max`; `gemini-3.7-*` clamps to `low`/`medium`/`high` (`NONE` degrades to `low`).+- `thinking_level` never throws: every client maps each level onto the closest one the model supports, and `MAX` (the tier above `XHIGH`, added in AgentHub 0.4.4) degrades silently wherever the vendor has no such tier — Gemini and MiniMax M3 stop at `high`. Kimi K3 reasons unconditionally, so `NONE` degrades to its lowest effort rather than disabling thinking; GLM-5.2 sends `reasoning_effort` alongside its `thinking` block and only `NONE` disables it. GLM-5.3 thinks unconditionally (`NONE` degrades to the light `low` effort) and clamps `reasoning_effort` to `low`/`high`/`max`; `gemini-3.7-*` clamps to `low`/`medium`/`high` (`NONE` degrades to `low`). DeepSeek V4 accepts `low`/`high`/`max` and maps `medium` and `xhigh` onto `high` server-side, so since 0.4.4 `LOW` sends `low` (it sent `high`) and `XHIGH` sends `high` (it sent `max`).- `temperature` is rejected outright by Gemini 3.6/3.7 — those generations deprecated the sampling parameters, so the client refuses them instead of sending a value the API ignores. GPT-5.5/5.6, the whole Claude 4.6+ family (4.6 included since AgentHub 0.4.2), DeepSeek V4, Kimi K2.6 and Kimi K3 accept only the protocol default `1.0` and reject any other value. Gemini 3, GLM and the generic protocol clients (`openai-chat` / `openai-responses` / `ant-messages`) pass it through.- `tool_choice`: `"auto"` is safe everywhere. Claude accepts a single forced tool name; DeepSeek V4 and Kimi K2.6 allow `"auto"` / `"none"`; Kimi K3 adds `"required"` but refuses a specific tool (K2.x also rejects `"required"`); GLM only accepts `"auto"`.- `prompt_caching`: every client accepts `PromptCaching.ENABLE` and rejects the other values — caching is on by default and Kimi K3 caches context automatically.diff --git a/packages/skills/skills/penguin-sdk/SKILL.md b/packages/skills/skills/penguin-sdk/SKILL.mdindex 786d6d6a..3d84e232 100644--- a/packages/skills/skills/penguin-sdk/SKILL.md+++ b/packages/skills/skills/penguin-sdk/SKILL.md@@ -99,7 +99,7 @@ session.dispose();- `createSession({ workspaceDir, provider, modelId })` — `workspaceDir` must already exist (omit for a temporary workspace); the model reference is the `(provider, modelId)` pair, so pass both to pick a configured model or neither for the project default — passing one alone throws.- The `approve` callback gates every tool call; **omitting it denies everything**.-- `opts.thinkingLevel` (`"none" | "low" | "medium" | "high" | "xhigh"`) overrides the agent's default (`model.thinking_level` in `system_config.yaml`) for this turn only — raise it for hard questions, drop it for latency-sensitive calls like titling or classification.+- `opts.thinkingLevel` (`"none" | "low" | "medium" | "high" | "xhigh" | "max"`) overrides the agent's default (`model.thinking_level` in `system_config.yaml`) for this turn only — raise it for hard questions, drop it for latency-sensitive calls like titling or classification.- Session lifetime is the app's memory model: reuse one Session for a stateful chat (context accumulates, as above), create one per request for stateless QA (the RAG recipe below); either way call `session.dispose()` when done to release background processes.- An Agent's behavior is edited in its `agent_state/` files (system_config.yaml, AGENTS.md, skills/), not in code.diff --git a/packages/web/e2e/draft.spec.mjs b/packages/web/e2e/draft.spec.mjsindex 9f07c28a..17bb3f40 100644--- a/packages/web/e2e/draft.spec.mjs+++ b/packages/web/e2e/draft.spec.mjs@@ -97,18 +97,20 @@ test("draft: pick model/approval -> reload restores them -> send creates the sesawait expect(page.getByRole("button", { name: "审批模式" })).toContainText("放行只读");// Conversation-time thinking level (backed by the Agent settings): the picker shows the- // seeded default (medium, short name 中); the menu carries a title bar and the short-name- // rows 低/中/高/极高 only — no descriptions, no default row, and no 无 (many models cannot- // disable thinking); picking 高 writes straight through to the Agent config, so the session- // created on send runs with it and it becomes the Agent's new default.+ // seeded default (medium); the menu carries a title bar and the rows 低/中/高/极高/最高+ // only — no descriptions, no default row, and no 无 (many models cannot disable thinking).+ // Each row is labelled with the wire value it sends, so the names read "高 (high)".+ // Picking 高 (high) writes straight through to the Agent config, so the session created on+ // send runs with it and it becomes the Agent's new default.const thinkingBtn = page.getByRole("button", { name: "思考等级" });- await expect(thinkingBtn).toContainText("中");+ await expect(thinkingBtn).toContainText("中 (medium)");await thinkingBtn.click();await expect(page.getByText("思考等级", { exact: true })).toBeVisible(); // menu title bar- await expect(page.getByRole("button", { name: "低", exact: true })).toBeVisible();- await expect(page.getByRole("button", { name: "无", exact: true })).toHaveCount(0);- await page.getByRole("button", { name: "高", exact: true }).click();- await expect(thinkingBtn).toContainText("高");+ await expect(page.getByRole("button", { name: "低 (low)", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "最高 (max)", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "无 (none)", exact: true })).toHaveCount(0);+ await page.getByRole("button", { name: "高 (high)", exact: true }).click();+ await expect(thinkingBtn).toContainText("高 (high)");await expect.poll(async () => {const cfg = await (@@ -138,7 +140,7 @@ test("draft: pick model/approval -> reload restores them -> send creates the sesawait expect(page.getByRole("button", { name: "选择模型" })).toContainText("claude-4-8-mini");await expect(page.getByRole("button", { name: "审批模式" })).toContainText("放行只读");// The thinking level is NOT draft state: it restores from the Agent config (written through above), not the cache.- await expect(page.getByRole("button", { name: "思考等级" })).toContainText("高");+ await expect(page.getByRole("button", { name: "思考等级" })).toContainText("高 (high)");// Send: the Session is only created now, and the selections land faithfully in its meta.await page.getByRole("button", { name: "发送" }).click();await page.waitForURL(/\/chat\/session-/);@@ -159,7 +161,7 @@ test("draft: pick model/approval -> reload restores them -> send creates the ses).json();const meta = replay.messages.find((m) => m.type === "session_meta");expect(meta?.payload?.thinking_level).toBeUndefined();- await expect(page.getByTitle("思考等级:高")).toBeVisible();+ await expect(page.getByTitle("思考等级:高 (high)")).toBeVisible();// On a successful send the cache clears — except the model selection, which carries over as// the next conversation's default (switch-becomes-default, like the thinking level above).diff --git a/packages/web/e2e/reloaded-followup.spec.mjs b/packages/web/e2e/reloaded-followup.spec.mjsindex 241721fb..992910ef 100644--- a/packages/web/e2e/reloaded-followup.spec.mjs+++ b/packages/web/e2e/reloaded-followup.spec.mjs@@ -83,11 +83,26 @@ test("a stale steer response after reload queues the follow-up instead of strand// rides an ordinary send: the server keeps it with the queued input and applies it when the// follow-up auto-starts. The picker is only disabled while a send is in flight, so it is// editable here; the pick is per-turn and does not write through to the Agent config.+ //+ // This conversation already has history, so the mid-chat switch guard (#310) stages the+ // pick behind its dialog instead of applying it. Cancel first: the guard must leave the+ // displayed level exactly where it was, never half-applied.const thinkingBtn = page.getByRole("button", { name: "思考等级" });- await expect(thinkingBtn).toContainText("中");+ await expect(thinkingBtn).toContainText("中 (medium)");await thinkingBtn.click();- await page.getByRole("button", { name: "高", exact: true }).click();- await expect(thinkingBtn).toContainText("高");+ await page.getByRole("button", { name: "高 (high)", exact: true }).click();+ // The dialog's title is its accessible name, not body text — assert on its choices.+ await expect(page.getByRole("button", { name: "仍要切换", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "压缩后切换", exact: true })).toBeDisabled();+ await page.getByRole("button", { name: "取消", exact: true }).click();+ await expect(thinkingBtn).toContainText("中 (medium)");++ // Now switch for real: a compaction cannot start while the task runs, so "压缩后切换" is+ // disabled here and "仍要切换" is the applying choice.+ await thinkingBtn.click();+ await page.getByRole("button", { name: "高 (high)", exact: true }).click();+ await page.getByRole("button", { name: "仍要切换", exact: true }).click();+ await expect(thinkingBtn).toContainText("高 (high)");await composer.fill("hello after reload");const followUpPost = page.waitForResponse((response) =>diff --git a/packages/web/src/features/chat/thinking-level.ts b/packages/web/src/features/chat/thinking-level.tsindex 6a9414c8..fc88f6d2 100644--- a/packages/web/src/features/chat/thinking-level.ts+++ b/packages/web/src/features/chat/thinking-level.ts@@ -19,15 +19,17 @@* legacy config or trace that carries it still displays via the label table below.*/-/** All five stored/wire levels, for display lookup (mirrors core's ThinkingLevelName). */-export const THINKING_LEVELS = ["none", "low", "medium", "high", "xhigh"] as const;+/** All stored/wire levels, for display lookup (mirrors core's ThinkingLevelName). */+export const THINKING_LEVELS = ["none", "low", "medium", "high", "xhigh", "max"] as const;/*** The levels the picker offers, in menu order: "none" is deliberately excluded (many models* don't support disabling thinking) — it can still be displayed (a stored legacy value) but- * never picked.+ * never picked. "max" carries no such caveat: every AgentHub client maps it onto the deepest+ * effort its vendor accepts and degrades silently where there is no such tier, so it is+ * offered like any other tier.*/-export const SELECTABLE_THINKING_LEVELS = ["low", "medium", "high", "xhigh"] as const;+export const SELECTABLE_THINKING_LEVELS = ["low", "medium", "high", "xhigh", "max"] as const;/*** Effective thinking level for the draft picker's DISPLAY — the SAME chain core resolves@@ -48,7 +50,7 @@ export function effectiveThinkingLevel(/*** Short display label for a level from the localized name table (S.chat.thinkingLevelNames).- * Covers all five stored levels including "none" (so a legacy value displays sanely instead+ * Covers every stored level including "none" (so a legacy value displays sanely instead* of being rewritten or hidden). Returns null for anything else — including "" (an Agent* without an explicit override) and session_meta's "default" — so callers can render a* placeholder on the trigger and hide the session read-only tag instead of showing a rawdiff --git a/packages/web/src/features/models/protocol-path.ts b/packages/web/src/features/models/protocol-path.tsindex cf41bc8f..cba33c09 100644--- a/packages/web/src/features/models/protocol-path.ts+++ b/packages/web/src/features/models/protocol-path.ts@@ -1,7 +1,7 @@/*** Protocol-path suffix for the config dialog's base URL field: the path the AgentHub* client appends to a custom base URL, shown inside the field so the user knows which- * endpoint shape the URL must serve. Verified against the vendored agenthub 0.4.2+ * endpoint shape the URL must serve. Verified against the vendored agenthub 0.4.4* clients and the SDKs they construct:* - Anthropic direct (claude-* clients, `@anthropic-ai/sdk`): POST {base}/v1/messages —* the SDK's default base URL (https://api.anthropic.com) carries no /v1; the requestdiff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.tsindex fe6ab151..05595f59 100644--- a/packages/web/src/lib/strings-en.ts+++ b/packages/web/src/lib/strings-en.ts@@ -301,7 +301,11 @@ export const en: Strings = {["high", "Enables a higher tier of extended reasoning; slower responses."],["xhigh",- "Enables the highest tier of extended reasoning; identical to high on some models.",+ "Enables an extended tier of reasoning beyond high; identical to high on some models.",+ ],+ [+ "max",+ "Enables the deepest tier of extended reasoning; slowest and identical to xhigh on some models.",],] as ReadonlyArray<readonly [string, string]>,thinkingLevelNoneKept:@@ -890,12 +894,14 @@ export const en: Strings = {chooseAgent: "Choose agent",chooseModel: "Choose model",thinkingLevel: "Thinking level",+ /** Tier names for the thinking-level controls: the wire value itself, so the label names the value actually sent (per maintainer request). `none` exists purely to display a stored legacy value — it is never offered as a choice (many models cannot disable thinking). */thinkingLevelNames: {- none: "None",- low: "Low",- medium: "Medium",- high: "High",- xhigh: "Extreme High",+ none: "none",+ low: "low",+ medium: "medium",+ high: "high",+ xhigh: "xhigh",+ max: "max",},thinkingSwitchTitle: "Switch thinking level",thinkingSwitchBody: (to: string): string =>diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.tsindex 8e7a41c3..ca7e47f1 100644--- a/packages/web/src/lib/strings.ts+++ b/packages/web/src/lib/strings.ts@@ -279,7 +279,8 @@ export const zh = {["low", "开启较低强度的扩展推理。"],["medium", "开启中等强度的扩展推理(新建 Agent 的缺省档位)。"],["high", "开启较高强度的扩展推理,响应更慢。"],- ["xhigh", "开启最高强度的扩展推理,部分模型上效果与 high 相同。"],+ ["xhigh", "在 high 之上再进一步的扩展推理,部分模型上效果与 high 相同。"],+ ["max", "开启最高强度的扩展推理,最慢,部分模型上效果与 xhigh 相同。"],] as ReadonlyArray<readonly [string, string]>,/** Row description shown only while the stored config is `none`: displayed as-is, never rewritten, and no longer offered as a choice. */thinkingLevelNoneKept: "已存的历史档位:新选择不再提供关闭档(多数模型不支持关闭思考)。",@@ -852,13 +853,14 @@ export const zh = {chooseAgent: "选择 Agent",chooseModel: "选择模型",thinkingLevel: "思考等级",- /** Short tier names for the pre-conversation picker (per review: short names only, no descriptions, no "default" row). `none` exists purely to display a stored legacy value — it is never offered as a choice (many models cannot disable thinking). */+ /** Tier names for the thinking-level controls: the Chinese name followed by the wire value in parentheses, so the label names the value actually sent (per maintainer request). `none` exists purely to display a stored legacy value — it is never offered as a choice (many models cannot disable thinking). */thinkingLevelNames: {- none: "无",- low: "低",- medium: "中",- high: "高",- xhigh: "极高",+ none: "无 (none)",+ low: "低 (low)",+ medium: "中 (medium)",+ high: "高 (high)",+ xhigh: "极高 (xhigh)",+ max: "最高 (max)",} as Readonly<Record<string, string>>,/** Mid-chat switch guard (issue #310): confirm before a level change that costs prompt-cache hits over the existing history. Title is the dialog's accessible name only. */thinkingSwitchTitle: "切换思考等级",diff --git a/packages/web/test/agent-settings-options.test.ts b/packages/web/test/agent-settings-options.test.tsindex d4b27acc..4f5727cc 100644--- a/packages/web/test/agent-settings-options.test.ts+++ b/packages/web/test/agent-settings-options.test.ts@@ -13,12 +13,13 @@ const ENTRIES: ReadonlyArray<readonly [string, string]> = [["medium", "Medium tier."],["high", "High tier."],["xhigh", "Extra-high tier."],+ ["max", "Max tier."],];describe("optionRows", () => {it("drops the '' inherit row and keeps dictionary order", () => {const rows = optionRows(ENTRIES);- expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh"]);+ expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh", "max"]);expect(rows.some((r) => r.value === "")).toBe(false);});diff --git a/packages/web/test/thinking-level.test.ts b/packages/web/test/thinking-level.test.tsindex ef24e79e..1f22e324 100644--- a/packages/web/test/thinking-level.test.ts+++ b/packages/web/test/thinking-level.test.ts@@ -1,6 +1,6 @@/*** thinking-level.ts unit tests: the conversation-time pickers' short-name lookup and the- * selectable list — both pickers offer only low/medium/high/xhigh (many models cannot disable+ * selectable list — both pickers offer only low/medium/high/xhigh/max (many models cannot disable* thinking; there is no "follow config" row — the session picker auto-follows the Agent* config by initializing its display to it), while "none" stays a displayable stored value;* "" (internally "untouched"/no override) and a legacy meta's "default" resolve to null so@@ -29,27 +29,29 @@ import type { ThinkingSwitchItem } from "../src/features/chat/thinking-level";/** Mirrors the shape of S.chat.thinkingLevelNames. */const NAMES: Readonly<Record<string, string>> = {- none: "None",- low: "Low",- medium: "Medium",- high: "High",- xhigh: "Extreme High",+ none: "none",+ low: "low",+ medium: "medium",+ high: "high",+ xhigh: "xhigh",+ max: "max",};describe("thinking level lists", () => {- it("offers only low/medium/high/xhigh — no 'none' (many models cannot disable thinking)", () => {- expect(SELECTABLE_THINKING_LEVELS).toEqual(["low", "medium", "high", "xhigh"]);+ it("offers only low/medium/high/xhigh/max — no 'none' (many models cannot disable thinking)", () => {+ expect(SELECTABLE_THINKING_LEVELS).toEqual(["low", "medium", "high", "xhigh", "max"]);expect(SELECTABLE_THINKING_LEVELS).not.toContain("none");});- it("keeps all five stored levels displayable (a legacy 'none' is shown, never offered)", () => {- expect(THINKING_LEVELS).toEqual(["none", "low", "medium", "high", "xhigh"]);+ it("keeps every stored level displayable (a legacy 'none' is shown, never offered)", () => {+ expect(THINKING_LEVELS).toEqual(["none", "low", "medium", "high", "xhigh", "max"]);expect(THINKING_LEVELS.map((l) => thinkingLevelLabel(NAMES, l))).toEqual([- "None",- "Low",- "Medium",- "High",- "Extreme High",+ "none",+ "low",+ "medium",+ "high",+ "xhigh",+ "max",]);});});@@ -88,12 +90,13 @@ describe("thinkingLevelOptionsFor (agent-settings dropdown assembly)", () => {["medium", "Medium tier."],["high", "High tier."],["xhigh", "Extra-high tier."],+ ["max", "Max tier."],];it("filters the '' inherit row and keeps dictionary order; no none row normally", () => {- for (const stored of [undefined, "", "medium", "xhigh"]) {+ for (const stored of [undefined, "", "medium", "xhigh", "max"]) {const rows = thinkingLevelOptionsFor(OPTIONS, "legacy none", stored);- expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh"]);+ expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh", "max"]);expect(rows.some((r) => r.value === "none")).toBe(false);expect(rows[0]).toMatchObject({triggerLabel: "low",@@ -105,7 +108,7 @@ describe("thinkingLevelOptionsFor (agent-settings dropdown assembly)", () => {it("appends a display-only none row when the persisted config stores none (backward compat)", () => {const rows = thinkingLevelOptionsFor(OPTIONS, "legacy none", "none");- expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh", "none"]);+ expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh", "max", "none"]);expect(rows.at(-1)).toEqual({value: "none",triggerLabel: "none",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex dacf7b2b..4a54b6ea 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -49,8 +49,8 @@ importers:specifier: ^2.0.0version: 2.0.0'@prismshadow/agenthub':- specifier: ^0.4.2+ specifier: ^0.4.4'@prismshadow/penguin-core':specifier: workspace:*version: link:../core@@ -95,8 +95,8 @@ importers:specifier: ^2.0.0version: 2.0.0'@prismshadow/agenthub':- specifier: ^0.4.2+ specifier: ^0.4.4'@prismshadow/penguin-skills':specifier: workspace:*version: link:../skills@@ -931,8 +931,8 @@ packages:engines: {node: '>=18'}hasBin: true- '@prismshadow/[email protected]':- resolution: {integrity: sha512-wI+S18fP/vESkVHUo9bMipsphxt1KXrjNSXgcwZmQp+NH+y61jalOANtp0hZW4oMP4YfkDB3Al/RvJJ5Jhp8QQ==}+ '@prismshadow/[email protected]':+ resolution: {integrity: sha512-hKO5Zj5GxMabqClZph9xT/eZTi835Pv14/AcZpa0TeOtjixJwuy/YAUZKkXBsYCwFbcy31Uel+S81qifjVo5cA==}'@prismshadow/penguin-cli@file:packages/cli':resolution: {directory: packages/cli, type: directory}@@ -4458,7 +4458,7 @@ snapshots:dependencies:playwright: 1.61.1dependencies:'@anthropic-ai/bedrock-sdk': 0.26.4([email protected])'@anthropic-ai/sdk': 0.91.1([email protected])@@ -4476,7 +4476,7 @@ snapshots:'@prismshadow/penguin-cli@file:packages/cli([email protected])':dependencies:'@modelcontextprotocol/client': 2.0.0'@prismshadow/penguin-core': file:packages/core([email protected])([email protected])([email protected])'@prismshadow/penguin-server': file:packages/server([email protected])([email protected])([email protected])'@prismshadow/penguin-skills': file:packages/skills@@ -4495,7 +4495,7 @@ snapshots:'@prismshadow/penguin-core@file:packages/core([email protected])([email protected])([email protected])':dependencies:'@modelcontextprotocol/client': 2.0.0'@prismshadow/penguin-skills': file:packages/skillsarktype: 2.2.3smol-toml: 1.6.1diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex dda5d21a..4682f38e 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -28,8 +28,8 @@ allowBuilds:# targets NSIS only, so the script is deliberately not run.electron-winstaller: false# pnpm 11 withholds freshly published versions by default (supply-chain gate), which-# would resolve agenthub back to 0.4.1 and lose the minimax-m3 client. This package is+# would resolve agenthub back to 0.4.3 and lose the max thinking level. This package is# first-party, so the exemption carries no third-party risk. Remove the entry at the next-# agenthub bump — by then 0.4.2 is long past the age gate.+# agenthub bump — by then 0.4.4 is long past the age gate.minimumReleaseAgeExclude:- - "@prismshadow/[email protected]"+ - "@prismshadow/[email protected]"