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

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security Blog

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): persist default agent via agents list flag · ope...
luyao618 · 2026-04-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -88,6 +88,7 @@ Docs: https://docs.openclaw.ai

8888

- CLI/gateway: reuse cached paired-device auth during `gateway probe` and report post-connect diagnostic failures as degraded reachability, so healthy local gateways are no longer marked unreachable after loopback auth or read timeouts. Fixes #48360. Thanks @RacecarGuy.

8989

- Channels/Discord: give Discord Gateway WebSocket handshakes a 30s timeout so stalled TLS/network transitions emit an error and Carbon can continue its reconnect loop instead of leaving the bot silent until restart. Refs #50046. Thanks @codexGW.

9090

- Channels/Telegram: suppress standalone failed edit/write warning payloads when a user-facing assistant error reply already covers the turn, while keeping unresolved mutating failures visible behind success-looking or suppressed-error replies. Fixes #39631; refs #73750; carries forward #39636 and #39717; leaves #39406 for configurable delivery policy. Thanks @Bartok9 and @Bortlesboat.

91+

- Control UI/agents: persist the Set Default action through `agents.list[].default` instead of writing the unsupported `agents.defaultId` field, so saved default-agent changes survive config validation. Fixes #65565; carries forward #72585. Thanks @luyao618.

9192

- NVIDIA/NIM: persist the `NVIDIA_API_KEY` provider marker and mark bundled NVIDIA Chat Completions models as string-content compatible, so NIM models load from `models.json` and OpenAI-compatible subagent calls send plain text content. Fixes #73013 and #50107; refs #73014. Thanks @bautrey, @iot2edge, @ifearghal, and @futhgar.

9293

- Channels/Discord: let text-only configs drop the `GuildVoiceStates` gateway intent and expose a bounded `/gateway/bot` metadata timeout with rate-limited fallback logs, reducing idle CPU and warning floods. Fixes #73709 and #73585. Thanks @sanchezm86 and @trac3r00.

9394

- Agents/sessions: mark same-turn `sessions_send` and A2A reply prompts with an inter-session `isUser=false` envelope before they reach the model, so foreign session output no longer lands as bare active user text. Fixes #73702; refs #73698, #73609, #73595, and #73622. Thanks @alvelda.

Original file line numberDiff line numberDiff line change

@@ -40,6 +40,7 @@ import {

4040

resetConfigPendingChanges,

4141

runUpdate,

4242

saveConfig,

43+

stageDefaultAgentConfigEntry,

4344

stageConfigPreset,

4445

updateConfigFormValue,

4546

removeConfigFormValue,

@@ -2148,10 +2149,7 @@ export function renderApp(state: AppViewState) {

21482149

updateConfigFormValue(state, basePath, { primary, fallbacks: normalized });

21492150

},

21502151

onSetDefault: (agentId) => {

2151-

if (!configValue) {

2152-

return;

2153-

}

2154-

updateConfigFormValue(state, ["agents", "defaultId"], agentId);

2152+

stageDefaultAgentConfigEntry(state, agentId);

21552153

},

21562154

}),

21572155

)

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ import {

88

resetConfigPendingChanges,

99

runUpdate,

1010

saveConfig,

11+

stageDefaultAgentConfigEntry,

1112

stageConfigPreset,

1213

updateConfigFormValue,

1314

type ConfigState,

@@ -477,6 +478,50 @@ describe("agent config helpers", () => {

477478

},

478479

});

479480

});

481+
482+

it("sets default via agents.list[].default instead of agents.defaultId", () => {

483+

const state = createState();

484+

state.configSnapshot = {

485+

config: {

486+

agents: {

487+

list: [{ id: "alpha", default: true }, { id: "beta" }],

488+

},

489+

},

490+

valid: true,

491+

issues: [],

492+

raw: "{\n}\n",

493+

};

494+
495+

const updated = stageDefaultAgentConfigEntry(state, "beta");

496+
497+

expect(updated).toBe(true);

498+

expect(state.configFormDirty).toBe(true);

499+

expect(state.configForm).toEqual({

500+

agents: {

501+

list: [{ id: "alpha" }, { id: "beta", default: true }],

502+

},

503+

});

504+

});

505+
506+

it("does not stage agents.defaultId when the target agent is absent", () => {

507+

const state = createState();

508+

state.configSnapshot = {

509+

config: {

510+

agents: {

511+

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

512+

},

513+

},

514+

valid: true,

515+

issues: [],

516+

raw: "{\n}\n",

517+

};

518+
519+

const updated = stageDefaultAgentConfigEntry(state, "beta");

520+
521+

expect(updated).toBe(false);

522+

expect(state.configFormDirty).toBe(false);

523+

expect(state.configForm).toBeNull();

524+

});

480525

});

481526
482527

describe("applyConfig", () => {

Original file line numberDiff line numberDiff line change

@@ -359,6 +359,38 @@ export function ensureAgentConfigEntry(state: ConfigState, agentId: string): num

359359

return nextIndex;

360360

}

361361
362+

export function stageDefaultAgentConfigEntry(state: ConfigState, agentId: string): boolean {

363+

const normalizedAgentId = agentId.trim();

364+

if (!normalizedAgentId) {

365+

return false;

366+

}

367+

const source =

368+

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

369+

const targetIndex = findAgentConfigEntryIndex(source, normalizedAgentId);

370+

if (targetIndex < 0) {

371+

return false;

372+

}

373+

mutateConfigForm(state, (draft) => {

374+

const list = (draft as { agents?: { list?: unknown[] } } | null)?.agents?.list;

375+

if (!Array.isArray(list)) {

376+

return;

377+

}

378+

for (let i = 0; i < list.length; i++) {

379+

const entry = list[i];

380+

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

381+

continue;

382+

}

383+

const record = entry as Record<string, unknown>;

384+

if (i === targetIndex) {

385+

record.default = true;

386+

} else {

387+

delete record.default;

388+

}

389+

}

390+

});

391+

return true;

392+

}

393+
362394

export async function openConfigFile(state: ConfigState): Promise<void> {

363395

if (!state.client || !state.connected) {

364396

return;