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

推荐订阅源

B
Blog RSS Feed
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
Jina AI
Jina AI
G
Google Developers Blog
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
The GitHub Blog
The GitHub Blog
D
Docker
量子位
罗磊的独立博客
腾讯CDC

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
Map ACP thinking to advertised effort key · openclaw/open...
InTheCloudDa · 2026-05-10 · via Recent Commits to openclaw:main

@@ -1,5 +1,11 @@

1+

import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";

12

import { AcpRuntimeError, withAcpRuntimeErrorBoundary } from "../runtime/errors.js";

2-

import type { AcpRuntime, AcpRuntimeCapabilities, AcpRuntimeHandle } from "../runtime/types.js";

3+

import type {

4+

AcpRuntime,

5+

AcpRuntimeCapabilities,

6+

AcpRuntimeHandle,

7+

AcpRuntimeStatus,

8+

} from "../runtime/types.js";

39

import type { SessionAcpMeta } from "./manager.types.js";

410

import { createUnsupportedControlError } from "./manager.utils.js";

511

import type { CachedRuntimeState } from "./runtime-cache.js";

@@ -10,9 +16,39 @@ import {

1016

resolveRuntimeOptionsFromMeta,

1117

} from "./runtime-options.js";

121819+

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

20+

return value && typeof value === "object" && !Array.isArray(value)

21+

? (value as Record<string, unknown>)

22+

: null;

23+

}

24+25+

function extractConfigOptionKeys(value: unknown): string[] {

26+

if (!Array.isArray(value)) {

27+

return [];

28+

}

29+

return value

30+

.map((entry) => {

31+

if (typeof entry === "string") {

32+

return normalizeText(entry);

33+

}

34+

const record = asRecord(entry);

35+

return normalizeText(record?.id ?? record?.key);

36+

})

37+

.filter(Boolean) as string[];

38+

}

39+40+

function extractRuntimeStatusConfigOptionKeys(status: AcpRuntimeStatus | undefined): string[] {

41+

const details = asRecord(status?.details);

42+

return [

43+

...extractConfigOptionKeys(details?.configOptions),

44+

...extractConfigOptionKeys(details?.config_options),

45+

];

46+

}

47+1348

export async function resolveManagerRuntimeCapabilities(params: {

1449

runtime: AcpRuntime;

1550

handle: AcpRuntimeHandle;

51+

includeStatusConfigOptionKeys?: boolean;

1652

}): Promise<AcpRuntimeCapabilities> {

1753

let reported: AcpRuntimeCapabilities | undefined;

1854

if (params.runtime.getCapabilities) {

@@ -32,12 +68,30 @@ export async function resolveManagerRuntimeCapabilities(params: {

3268

if (params.runtime.getStatus) {

3369

controls.add("session/status");

3470

}

35-

const normalizedKeys = (reported?.configOptionKeys ?? [])

36-

.map((entry) => normalizeText(entry))

37-

.filter(Boolean) as string[];

71+

const normalizedKeys = new Set(

72+

(reported?.configOptionKeys ?? [])

73+

.map((entry) => normalizeText(entry))

74+

.filter(Boolean) as string[],

75+

);

76+

if (

77+

normalizedKeys.size === 0 &&

78+

params.includeStatusConfigOptionKeys &&

79+

params.runtime.getStatus

80+

) {

81+

try {

82+

const status = await params.runtime.getStatus({ handle: params.handle });

83+

for (const key of extractRuntimeStatusConfigOptionKeys(status)) {

84+

normalizedKeys.add(key);

85+

}

86+

} catch {

87+

// Status-derived option keys are an optional refinement. Keep the

88+

// capability result usable for runtimes that expose controls but cannot

89+

// answer status before a turn.

90+

}

91+

}

3892

return {

3993

controls: [...controls].toSorted(),

40-

...(normalizedKeys.length > 0 ? { configOptionKeys: normalizedKeys } : {}),

94+

...(normalizedKeys.size > 0 ? { configOptionKeys: [...normalizedKeys] } : {}),

4195

};

4296

}

4397

@@ -55,17 +109,19 @@ export async function applyManagerRuntimeControls(params: {

55109

return;

56110

}

57111112+

const needsConfigOptionKeys = buildRuntimeConfigOptionPairs(options).length > 0;

58113

const capabilities = await resolveManagerRuntimeCapabilities({

59114

runtime: params.runtime,

60115

handle: params.handle,

116+

includeStatusConfigOptionKeys: needsConfigOptionKeys,

61117

});

62118

const backend = params.handle.backend || params.meta.backend;

63119

const runtimeMode = normalizeText(options.runtimeMode);

64-

const configOptions = buildRuntimeConfigOptionPairs(options);

120+

const configOptions = buildRuntimeConfigOptionPairs(options, capabilities.configOptionKeys);

65121

const advertisedKeys = new Set(

66122

(capabilities.configOptionKeys ?? [])

67-

.map((entry) => normalizeText(entry))

68-

.filter(Boolean) as string[],

123+

.map((entry) => normalizeLowercaseStringOrEmpty(entry))

124+

.filter(Boolean),

69125

);

7012671127

await withAcpRuntimeErrorBoundary({

@@ -94,7 +150,10 @@ export async function applyManagerRuntimeControls(params: {

94150

});

95151

}

96152

for (const [key, value] of configOptions) {

97-

if (advertisedKeys.size > 0 && !advertisedKeys.has(key)) {

153+

if (

154+

advertisedKeys.size > 0 &&

155+

!advertisedKeys.has(normalizeLowercaseStringOrEmpty(key))

156+

) {

98157

throw new AcpRuntimeError(

99158

"ACP_BACKEND_UNSUPPORTED_CONTROL",

100159

`ACP backend "${backend}" does not accept config key "${key}".`,