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

推荐订阅源

C
Check Point Blog
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
S
SegmentFault 最新的问题
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - Franky
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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
fix(ui): preserve source config for Control UI saves (#85...
clawsweeper · 2026-05-24 · via Recent Commits to openclaw:main

@@ -87,6 +87,23 @@ function applyConfigSchema(state: ConfigState, res: ConfigSchemaResponse) {

8787

state.configSchemaVersion = res.version ?? null;

8888

}

898990+

function asConfigRecord(value: unknown): Record<string, unknown> | null {

91+

if (!value || typeof value !== "object" || Array.isArray(value)) {

92+

return null;

93+

}

94+

return value as Record<string, unknown>;

95+

}

96+97+

function resolveEditableSnapshotConfig(

98+

snapshot: ConfigSnapshot | null | undefined,

99+

): Record<string, unknown> | null {

100+

return (

101+

asConfigRecord(snapshot?.sourceConfig) ??

102+

asConfigRecord(snapshot?.resolved) ??

103+

asConfigRecord(snapshot?.config)

104+

);

105+

}

106+90107

export function applyConfigSnapshot(

91108

state: ConfigState,

92109

snapshot: ConfigSnapshot,

@@ -95,15 +112,16 @@ export function applyConfigSnapshot(

95112

const preservePendingChanges = state.configFormDirty && options.discardPendingChanges !== true;

96113

const draftBaseHash = state.configDraftBaseHash ?? state.configSnapshot?.hash ?? null;

97114

state.configSnapshot = snapshot;

115+

const editableConfig = resolveEditableSnapshotConfig(snapshot);

98116

const rawAvailable = typeof snapshot.raw === "string";

99117

if (!rawAvailable && state.configFormMode === "raw") {

100118

state.configFormMode = "form";

101119

}

102120

const rawFromSnapshot: string =

103121

typeof snapshot.raw === "string"

104122

? snapshot.raw

105-

: snapshot.config && typeof snapshot.config === "object"

106-

? serializeConfigForm(snapshot.config)

123+

: editableConfig

124+

? serializeConfigForm(editableConfig)

107125

: state.configRaw;

108126

if (!preservePendingChanges || state.configFormMode === "raw") {

109127

state.configRaw = rawFromSnapshot;

@@ -116,8 +134,8 @@ export function applyConfigSnapshot(

116134

state.configIssues = Array.isArray(snapshot.issues) ? snapshot.issues : [];

117135118136

if (!preservePendingChanges) {

119-

state.configForm = cloneConfigObject(snapshot.config ?? {});

120-

state.configFormOriginal = cloneConfigObject(snapshot.config ?? {});

137+

state.configForm = cloneConfigObject(editableConfig ?? {});

138+

state.configFormOriginal = cloneConfigObject(editableConfig ?? {});

121139

state.configRawOriginal = rawFromSnapshot;

122140

state.configFormDirty = false;

123141

state.configDraftBaseHash = snapshot.hash ?? null;

@@ -232,7 +250,7 @@ async function submitConfigChange(

232250233251

function syncConfigDraft(state: ConfigState, nextForm: Record<string, unknown>) {

234252

const original = cloneConfigObject(

235-

state.configFormOriginal ?? state.configSnapshot?.config ?? {},

253+

state.configFormOriginal ?? resolveEditableSnapshotConfig(state.configSnapshot) ?? {},

236254

);

237255

const nextRaw = serializeConfigForm(nextForm);

238256

const originalRaw = serializeConfigForm(original);

@@ -284,7 +302,9 @@ export async function runUpdate(state: ConfigState) {

284302

}

285303286304

function mutateConfigForm(state: ConfigState, mutate: (draft: Record<string, unknown>) => void) {

287-

const base = cloneConfigObject(state.configForm ?? state.configSnapshot?.config ?? {});

305+

const base = cloneConfigObject(

306+

state.configForm ?? resolveEditableSnapshotConfig(state.configSnapshot) ?? {},

307+

);

288308

mutate(base);

289309

syncConfigDraft(state, base);

290310

}

@@ -374,12 +394,7 @@ export function updateConfigFormValue(

374394

}

375395376396

export function stageConfigPreset(state: ConfigState, patch: Record<string, unknown>) {

377-

const snapshotConfig =

378-

state.configSnapshot?.config &&

379-

typeof state.configSnapshot.config === "object" &&

380-

!Array.isArray(state.configSnapshot.config)

381-

? state.configSnapshot.config

382-

: null;

397+

const snapshotConfig = resolveEditableSnapshotConfig(state.configSnapshot);

383398

const baseSource = state.configForm ?? snapshotConfig;

384399

if (!baseSource || (!state.configForm && !state.configSnapshot?.hash)) {

385400

return;

@@ -393,12 +408,11 @@ export function stageConfigPreset(state: ConfigState, patch: Record<string, unkn

393408

}

394409395410

export function resetConfigPendingChanges(state: ConfigState) {

396-

state.configForm = cloneConfigObject(

397-

state.configFormOriginal ?? state.configSnapshot?.config ?? {},

398-

);

411+

const editableConfig = resolveEditableSnapshotConfig(state.configSnapshot);

412+

state.configForm = cloneConfigObject(state.configFormOriginal ?? editableConfig ?? {});

399413

state.configRaw =

400414

state.configRawOriginal ??

401-

serializeConfigForm(state.configFormOriginal ?? state.configSnapshot?.config ?? {});

415+

serializeConfigForm(state.configFormOriginal ?? editableConfig ?? {});

402416

state.configFormDirty = false;

403417

state.configDraftBaseHash = state.configSnapshot?.hash ?? null;

404418

autoAllowlistedPluginIdsByState.delete(state);

@@ -434,8 +448,7 @@ export function ensureAgentConfigEntry(state: ConfigState, agentId: string): num

434448

if (!normalizedAgentId) {

435449

return -1;

436450

}

437-

const source =

438-

state.configForm ?? (state.configSnapshot?.config as Record<string, unknown> | null);

451+

const source = state.configForm ?? resolveEditableSnapshotConfig(state.configSnapshot);

439452

const existingIndex = findAgentConfigEntryIndex(source, normalizedAgentId);

440453

if (existingIndex >= 0) {

441454

return existingIndex;

@@ -451,8 +464,7 @@ export function stageDefaultAgentConfigEntry(state: ConfigState, agentId: string

451464

if (!normalizedAgentId) {

452465

return false;

453466

}

454-

const source =

455-

state.configForm ?? (state.configSnapshot?.config as Record<string, unknown> | null);

467+

const source = state.configForm ?? resolveEditableSnapshotConfig(state.configSnapshot);

456468

const targetIndex = findAgentConfigEntryIndex(source, normalizedAgentId);

457469

if (targetIndex < 0) {

458470

return false;