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

推荐订阅源

G
Google Developers Blog
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 司徒正美
D
Docker
B
Blog
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
S
SegmentFault 最新的问题
小众软件
小众软件
J
Java Code Geeks
美团技术团队
腾讯CDC
MyScale Blog
MyScale Blog
爱范儿
爱范儿
H
Help Net Security
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】

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 test: merge chat context notice checks · openclaw/openclaw@5c2f4af 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
Agents/tool-loop: enable unknown-tool stream guard by def...
2026-04-16 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

3737

- OpenAI Codex/models: normalize stale native transport metadata in both runtime resolution and discovery/listing so legacy `openai-codex` rows with missing `api` or `https://chatgpt.com/backend-api/v1` self-heal to the canonical Codex transport instead of routing requests through broken HTML/Cloudflare paths, combining the original fixes proposed in #66969 (saamuelng601-pixel) and #67159 (hclsys). (#67635)

3838

- Agents/failover: treat HTML provider error pages as upstream transport failures for CDN-style 5xx responses without misclassifying embedded body text as API rate limits, while still preserving auth remediation for HTML 401/403 pages and proxy remediation for HTML 407 pages. (#67642) Thanks @stainlu.

3939

- Gateway/skills: bump the cached skills-snapshot version whenever a config write touches `skills.*` (for example `skills.allowBundled`, `skills.entries.<id>.enabled`, or `skills.profile`). Existing agent sessions persist a `skillsSnapshot` in `sessions.json` that reuses the skill list frozen at session creation; without this invalidation, removing a bundled skill from the allowlist left the old snapshot live and the model kept calling the disabled tool, producing `Tool <name> not found` loops that ran until the embedded-run timeout. (#67401) Thanks @xantorres.

40+

- Agents/tool-loop: enable the unknown-tool stream guard by default. Previously `resolveUnknownToolGuardThreshold` returned `undefined` unless `tools.loopDetection.enabled` was explicitly set to `true`, which left the protection off in the default configuration. A hallucinated or removed tool (for example `himalaya` after it was dropped from `skills.allowBundled`) would then loop "Tool X not found" attempts until the full embedded-run timeout. The guard has no false-positive surface because it only triggers on tools that are objectively not registered in the run, so it now stays on regardless of `tools.loopDetection.enabled` and still accepts `tools.loopDetection.unknownToolThreshold` as a per-run override (default 10). (#67401) Thanks @xantorres.

4041
4142

## 2026.4.15-beta.1

4243
Original file line numberDiff line numberDiff line change

@@ -424,20 +424,34 @@ describe("resolveAttemptFsWorkspaceOnly", () => {

424424

});

425425
426426

describe("resolveUnknownToolGuardThreshold", () => {

427-

it("returns undefined when loop detection is disabled", () => {

428-

expect(resolveUnknownToolGuardThreshold({ enabled: false, unknownToolThreshold: 4 })).toBe(

429-

undefined,

430-

);

431-

expect(resolveUnknownToolGuardThreshold(undefined)).toBe(undefined);

427+

it("returns the default threshold when no loop-detection config is provided", () => {

428+

expect(resolveUnknownToolGuardThreshold(undefined)).toBe(10);

429+

expect(resolveUnknownToolGuardThreshold({})).toBe(10);

432430

});

433431
434-

it("uses the default threshold when loop detection is enabled without an override", () => {

435-

expect(resolveUnknownToolGuardThreshold({ enabled: true })).toBe(10);

432+

it("stays on even when tools.loopDetection.enabled is false (safety net)", () => {

433+

// The unknown-tool guard has no false-positive surface — the tool is

434+

// objectively not registered — so it is always on regardless of the

435+

// opt-in genericRepeat/pingPong/pollNoProgress detectors.

436+

expect(resolveUnknownToolGuardThreshold({ enabled: false })).toBe(10);

437+

expect(resolveUnknownToolGuardThreshold({ enabled: false, unknownToolThreshold: 3 })).toBe(3);

436438

});

437439
438440

it("uses the configured threshold override when provided", () => {

439441

expect(resolveUnknownToolGuardThreshold({ enabled: true, unknownToolThreshold: 4 })).toBe(4);

440442

});

443+
444+

it("falls back to the default threshold when the override is non-positive", () => {

445+

expect(resolveUnknownToolGuardThreshold({ unknownToolThreshold: 0 })).toBe(10);

446+

expect(resolveUnknownToolGuardThreshold({ unknownToolThreshold: -5 })).toBe(10);

447+

expect(

448+

resolveUnknownToolGuardThreshold({ unknownToolThreshold: Number.NaN }),

449+

).toBe(10);

450+

});

451+
452+

it("floors fractional overrides", () => {

453+

expect(resolveUnknownToolGuardThreshold({ unknownToolThreshold: 3.7 })).toBe(3);

454+

});

441455

});

442456
443457

describe("wrapStreamFnTrimToolCallNames", () => {

Original file line numberDiff line numberDiff line change

@@ -294,11 +294,21 @@ const MAX_BTW_SNAPSHOT_MESSAGES = 100;

294294

export function resolveUnknownToolGuardThreshold(loopDetection?: {

295295

enabled?: boolean;

296296

unknownToolThreshold?: number;

297-

}): number | undefined {

298-

if (loopDetection?.enabled !== true) {

299-

return undefined;

297+

}): number {

298+

// The unknown-tool guard is a safety net against the model hallucinating a

299+

// tool name or calling a tool that has since been removed from the allowlist

300+

// (for example after a `skills.allowBundled` config change). After `threshold`

301+

// consecutive unknown-tool attempts the stream wrapper rewrites the assistant

302+

// message content to tell the model to stop, which breaks otherwise-infinite

303+

// Tool-not-found loops against the provider. Unlike the genericRepeat /

304+

// pingPong / pollNoProgress detectors this guard has no false-positive

305+

// surface because the tool is objectively not registered in this run, so it

306+

// stays on regardless of `tools.loopDetection.enabled`.

307+

const raw = loopDetection?.unknownToolThreshold;

308+

if (typeof raw === "number" && Number.isFinite(raw) && raw > 0) {

309+

return Math.floor(raw);

300310

}

301-

return loopDetection.unknownToolThreshold ?? UNKNOWN_TOOL_THRESHOLD;

311+

return UNKNOWN_TOOL_THRESHOLD;

302312

}

303313
304314

function summarizeMessagePayload(msg: AgentMessage): { textChars: number; imageBlocks: number } {