惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
V
Visual Studio Blog
博客园_首页
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
SegmentFault 最新的问题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
J
Java Code Geeks
月光博客
月光博客
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
C
CERT Recently Published Vulnerability Notes
C
CXSECURITY Database RSS Feed - CXSecurity.com
B
Blog RSS Feed
S
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
W
WeLiveSecurity
A
Arctic Wolf
U
Unit 42
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
量子位
B
Blog
T
The Exploit Database - CXSecurity.com
C
Cisco Blogs
博客园 - 三生石上(FineUI控件)
H
Help Net Security
博客园 - 叶小钗
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
小众软件
小众软件
雷峰网
雷峰网
TaoSecurity Blog
TaoSecurity Blog
Schneier on Security
Schneier on Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(gateway): expose agent thinking defaults · openclaw/openclaw@f8f5259
jbetala7 · 2026-05-31 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -4101,21 +4101,30 @@ public struct AgentSummary: Codable, Sendable {

41014101

public let workspace: String?

41024102

public let model: [String: AnyCodable]?

41034103

public let agentruntime: [String: AnyCodable]?

4104+

public let thinkinglevels: [[String: AnyCodable]]?

4105+

public let thinkingoptions: [String]?

4106+

public let thinkingdefault: String?

41044107
41054108

public init(

41064109

id: String,

41074110

name: String?,

41084111

identity: [String: AnyCodable]?,

41094112

workspace: String?,

41104113

model: [String: AnyCodable]?,

4111-

agentruntime: [String: AnyCodable]?)

4114+

agentruntime: [String: AnyCodable]?,

4115+

thinkinglevels: [[String: AnyCodable]]? = nil,

4116+

thinkingoptions: [String]? = nil,

4117+

thinkingdefault: String? = nil)

41124118

{

41134119

self.id = id

41144120

self.name = name

41154121

self.identity = identity

41164122

self.workspace = workspace

41174123

self.model = model

41184124

self.agentruntime = agentruntime

4125+

self.thinkinglevels = thinkinglevels

4126+

self.thinkingoptions = thinkingoptions

4127+

self.thinkingdefault = thinkingdefault

41194128

}

41204129
41214130

private enum CodingKeys: String, CodingKey {

@@ -4125,6 +4134,9 @@ public struct AgentSummary: Codable, Sendable {

41254134

case workspace

41264135

case model

41274136

case agentruntime = "agentRuntime"

4137+

case thinkinglevels = "thinkingLevels"

4138+

case thinkingoptions = "thinkingOptions"

4139+

case thinkingdefault = "thinkingDefault"

41284140

}

41294141

}

41304142
Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

import { Value } from "typebox/value";

22

import { describe, expect, it } from "vitest";

33

import {

4+

AgentsListResultSchema,

45

SkillsProposalInspectResultSchema,

56

ToolsEffectiveResultSchema,

67

} from "./agents-models-skills.js";

@@ -28,6 +29,31 @@ function toolsEffectiveResult() {

2829

};

2930

}

3031
32+

describe("AgentsListResultSchema", () => {

33+

it("accepts resolved per-agent thinking metadata", () => {

34+

const result = {

35+

defaultId: "main",

36+

mainKey: "main",

37+

scope: "per-sender",

38+

agents: [

39+

{

40+

id: "investment-master",

41+

name: "Investment Master",

42+

model: { primary: "deepseek/deepseek-v4-flash" },

43+

thinkingLevels: [

44+

{ id: "off", label: "off" },

45+

{ id: "xhigh", label: "xhigh" },

46+

],

47+

thinkingOptions: ["off", "xhigh"],

48+

thinkingDefault: "xhigh",

49+

},

50+

],

51+

};

52+
53+

expect(Value.Check(AgentsListResultSchema, result)).toBe(true);

54+

});

55+

});

56+
3157

describe("ToolsEffectiveResultSchema", () => {

3258

it("accepts runtime tool quarantine notices", () => {

3359

const result = {

Original file line numberDiff line numberDiff line change

@@ -56,6 +56,19 @@ export const AgentSummarySchema = Type.Object(

5656

{ additionalProperties: false },

5757

),

5858

),

59+

thinkingLevels: Type.Optional(

60+

Type.Array(

61+

Type.Object(

62+

{

63+

id: NonEmptyString,

64+

label: NonEmptyString,

65+

},

66+

{ additionalProperties: false },

67+

),

68+

),

69+

),

70+

thinkingOptions: Type.Optional(Type.Array(NonEmptyString)),

71+

thinkingDefault: Type.Optional(NonEmptyString),

5972

},

6073

{ additionalProperties: false },

6174

);

Original file line numberDiff line numberDiff line change

@@ -77,6 +77,7 @@ const DEFAULTED_OPTIONAL_INIT_PARAM_ENTRIES: readonly [string, readonly string[]

7777

["MessageActionParams", ["inboundTurnKind"]],

7878

["CronRunLogEntry", ["errorReason", "failureNotificationDelivery"]],

7979

["ExecApprovalRequestParams", ["requireDeliveryRoute", "suppressDelivery"]],

80+

["AgentSummary", ["thinkingLevels", "thinkingOptions", "thinkingDefault"]],

8081

];

8182
8283

const DEFAULTED_OPTIONAL_INIT_PARAMS: Record<string, Set<string>> = Object.fromEntries(

Original file line numberDiff line numberDiff line change

@@ -52,7 +52,7 @@ import {

5252

isConfiguredAgent,

5353

updateAgentConfigEntry,

5454

} from "./agents-config-mutations.js";

55-

import type { GatewayRequestHandlers, RespondFn } from "./types.js";

55+

import type { GatewayRequestContext, GatewayRequestHandlers, RespondFn } from "./types.js";

5656
5757

const BOOTSTRAP_FILE_NAMES = [

5858

DEFAULT_AGENTS_FILENAME,

@@ -72,6 +72,41 @@ const agentsHandlerDeps = {

7272

isWorkspaceSetupCompleted,

7373

};

7474
75+

let loggedSlowAgentsListCatalog = false;

76+
77+

const AGENTS_LIST_MODEL_CATALOG_TIMEOUT_MS = 750;

78+
79+

async function loadOptionalAgentsListModelCatalog(

80+

context: GatewayRequestContext,

81+

): Promise<Awaited<ReturnType<GatewayRequestContext["loadGatewayModelCatalog"]>> | undefined> {

82+

let timeout: NodeJS.Timeout | undefined;

83+

const timedOut = Symbol("agents-list-model-catalog-timeout");

84+

const timeoutPromise = new Promise<typeof timedOut>((resolve) => {

85+

timeout = setTimeout(() => resolve(timedOut), AGENTS_LIST_MODEL_CATALOG_TIMEOUT_MS);

86+

timeout.unref?.();

87+

});

88+

try {

89+

const result = await Promise.race([

90+

context.loadGatewayModelCatalog().catch(() => undefined),

91+

timeoutPromise,

92+

]);

93+

if (result === timedOut) {

94+

if (!loggedSlowAgentsListCatalog) {

95+

loggedSlowAgentsListCatalog = true;

96+

context.logGateway.debug(

97+

`agents.list continuing without model catalog after ${AGENTS_LIST_MODEL_CATALOG_TIMEOUT_MS}ms`,

98+

);

99+

}

100+

return undefined;

101+

}

102+

return Array.isArray(result) ? result : undefined;

103+

} finally {

104+

if (timeout) {

105+

clearTimeout(timeout);

106+

}

107+

}

108+

}

109+
75110

export const testing = {

76111

setDepsForTests(

77112

overrides: Partial<{

@@ -451,7 +486,7 @@ async function buildIdentityMarkdownOrRespondUnsafe(params: {

451486

}

452487
453488

export const agentsHandlers: GatewayRequestHandlers = {

454-

"agents.list": ({ params, respond, context }) => {

489+

"agents.list": async ({ params, respond, context }) => {

455490

if (!validateAgentsListParams(params)) {

456491

respond(

457492

false,

@@ -465,7 +500,8 @@ export const agentsHandlers: GatewayRequestHandlers = {

465500

}

466501
467502

const cfg = context.getRuntimeConfig();

468-

const result = listAgentsForGateway(cfg);

503+

const modelCatalog = await loadOptionalAgentsListModelCatalog(context);

504+

const result = listAgentsForGateway(cfg, modelCatalog);

469505

respond(true, result, undefined);

470506

},

471507

"agents.create": async ({ params, respond, context }) => {

Original file line numberDiff line numberDiff line change

@@ -1481,6 +1481,56 @@ describe("gateway session utils", () => {

14811481

const ops = result.agents.find((agent) => agent.id === "ops");

14821482

expect(ops?.model).toEqual({ primary: "anthropic/claude-opus-4-6" });

14831483

});

1484+
1485+

test("listAgentsForGateway reports per-agent thinking defaults from the agent model", () => {

1486+

const cfg = {

1487+

session: { mainKey: "main" },

1488+

agents: {

1489+

defaults: {

1490+

model: { primary: "minimax/MiniMax-M2.7" },

1491+

thinkingDefault: "off",

1492+

},

1493+

list: [

1494+

{ id: "main", default: true },

1495+

{

1496+

id: "investment-master",

1497+

model: { primary: "deepseek/deepseek-v4-flash" },

1498+

thinkingDefault: "xhigh",

1499+

},

1500+

],

1501+

},

1502+

} as OpenClawConfig;

1503+
1504+

const result = listAgentsForGateway(cfg);

1505+

const agent = result.agents.find((row) => row.id === "investment-master");

1506+
1507+

expect(agent?.model).toEqual({ primary: "deepseek/deepseek-v4-flash" });

1508+

expect(agent?.thinkingDefault).toBe("xhigh");

1509+

expect(agent?.thinkingLevels?.map((level) => level.id)).toEqual(

1510+

expect.arrayContaining(["off", "minimal", "low", "medium", "high", "xhigh"]),

1511+

);

1512+

expect(agent?.thinkingOptions).toEqual(agent?.thinkingLevels?.map((level) => level.label));

1513+

});

1514+
1515+

test("listAgentsForGateway uses the model catalog for per-agent thinking metadata", () => {

1516+

const cfg = {

1517+

session: { mainKey: "main" },

1518+

agents: {

1519+

defaults: {

1520+

model: { primary: "local/custom-reasoner" },

1521+

},

1522+

list: [{ id: "main", default: true }],

1523+

},

1524+

} as OpenClawConfig;

1525+
1526+

const result = listAgentsForGateway(cfg, [

1527+

{ provider: "local", id: "custom-reasoner", name: "Custom Reasoner", reasoning: true },

1528+

]);

1529+

const agent = result.agents.find((row) => row.id === "main");

1530+
1531+

expect(agent?.thinkingDefault).toBe("medium");

1532+

expect(agent?.thinkingLevels?.map((level) => level.id)).toContain("medium");

1533+

});

14841534

});

14851535
14861536

describe("resolveSessionModelRef", () => {

Original file line numberDiff line numberDiff line change

@@ -1167,7 +1167,10 @@ function resolveGatewayAgentModel(

11671167

};

11681168

}

11691169
1170-

export function listAgentsForGateway(cfg: OpenClawConfig): {

1170+

export function listAgentsForGateway(

1171+

cfg: OpenClawConfig,

1172+

modelCatalog?: ModelCatalogEntry[],

1173+

): {

11711174

defaultId: string;

11721175

mainKey: string;

11731176

scope: SessionScope;

@@ -1219,6 +1222,11 @@ export function listAgentsForGateway(cfg: OpenClawConfig): {

12191222

const meta = configuredById.get(id);

12201223

const model = resolveGatewayAgentModel(cfg, id);

12211224

const resolvedModel = resolveDefaultModelForAgent({ cfg, agentId: id });

1225+

const thinkingLevels = listThinkingLevelOptions(

1226+

resolvedModel.provider,

1227+

resolvedModel.model,

1228+

modelCatalog,

1229+

);

12221230

return Object.assign(

12231231

{

12241232

id,

@@ -1233,6 +1241,15 @@ export function listAgentsForGateway(cfg: OpenClawConfig): {

12331241

sessionKey: resolveAgentMainSessionKey({ cfg, agentId: id }),

12341242

acpRuntime: false,

12351243

}),

1244+

thinkingLevels,

1245+

thinkingOptions: thinkingLevels.map((level) => level.label),

1246+

thinkingDefault: resolveGatewaySessionThinkingDefault({

1247+

cfg,

1248+

provider: resolvedModel.provider,

1249+

model: resolvedModel.model,

1250+

agentId: id,

1251+

modelCatalog,

1252+

}),

12361253

},

12371254

model ? { model } : {},

12381255

);

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ import type { PluginSessionExtensionProjection } from "../plugins/host-hooks.js"

88

import type {

99

GatewayAgentRuntime,

1010

GatewayAgentRow as SharedGatewayAgentRow,

11+

GatewayThinkingLevelOption,

1112

SessionsListResultBase,

1213

SessionsPatchResultBase,

1314

} from "../shared/session-types.js";

@@ -22,11 +23,6 @@ export type GatewaySessionsDefaults = {

2223

thinkingDefault?: string;

2324

};

2425
25-

type GatewayThinkingLevelOption = {

26-

id: string;

27-

label: string;

28-

};

29-
3026

export type SessionRunStatus = "running" | "done" | "failed" | "killed" | "timeout";

3127
3228

type SubagentRunState = "active" | "interrupted" | "historical";

Original file line numberDiff line numberDiff line change

@@ -17,13 +17,21 @@ export type GatewayAgentRuntime = {

1717

source: "env" | "agent" | "defaults" | "model" | "provider" | "implicit" | "session-key";

1818

};

1919
20+

export type GatewayThinkingLevelOption = {

21+

id: string;

22+

label: string;

23+

};

24+
2025

export type GatewayAgentRow = {

2126

id: string;

2227

name?: string;

2328

identity?: GatewayAgentIdentity;

2429

workspace?: string;

2530

model?: GatewayAgentModel;

2631

agentRuntime?: GatewayAgentRuntime;

32+

thinkingLevels?: GatewayThinkingLevelOption[];

33+

thinkingOptions?: string[];

34+

thinkingDefault?: string;

2735

};

2836
2937

export type SessionsListResultBase<TDefaults, TRow> = {

Original file line numberDiff line numberDiff line change

@@ -862,6 +862,16 @@ function resolveThinkingTargetModel(state: AppViewState): {

862862

};

863863

}

864864
865+

function sessionModelMatchesDefaults(

866+

row: SessionsListResult["sessions"][number] | undefined,

867+

defaults: SessionsListResult["defaults"] | undefined,

868+

): boolean {

869+

return (

870+

(!row?.modelProvider || row.modelProvider === defaults?.modelProvider) &&

871+

(!row?.model || row.model === defaults?.model)

872+

);

873+

}

874+
865875

function buildThinkingOptions(

866876

levels: readonly GatewayThinkingLevelOption[],

867877

currentOverride: string,

@@ -944,17 +954,22 @@ export function resolveChatThinkingSelectState(state: AppViewState): ChatThinkin

944954

typeof persisted === "string" && persisted.trim()

945955

? (normalizeThinkLevel(persisted) ?? persisted.trim())

946956

: "";

957+

const defaults = state.sessionsResult?.defaults;

947958

const { provider, model } = resolveThinkingTargetModel(state);

948959

const levels = resolveThinkingLevelOptions(

949960

activeRow,

950-

state.sessionsResult?.defaults,

961+

defaults,

951962

provider,

952963

model,

953964

state.chatModelCatalog ?? [],

954965

);

966+

const defaultFromSessionDefaults =

967+

(!activeRow || sessionModelMatchesDefaults(activeRow, defaults)) && defaults?.thinkingDefault

968+

? defaults.thinkingDefault

969+

: undefined;

955970

const defaultLevel =

956971

activeRow?.thinkingDefault ??

957-

state.sessionsResult?.defaults?.thinkingDefault ??

972+

defaultFromSessionDefaults ??

958973

(provider && model

959974

? resolveThinkingDefaultForModel({

960975

provider,