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

推荐订阅源

A
About on SuperTechFans
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
宝玉的分享
宝玉的分享
美团技术团队
量子位
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
爱范儿
爱范儿
J
Java Code Geeks
博客园 - Franky
Last Week in AI
Last Week in AI
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
GbyAI
GbyAI
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale 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
perf: reuse provider handles and strict tool schemas · op...
steipete · 2026-05-30 · via Recent Commits to openclaw:main

@@ -39,6 +39,11 @@ import { getCurrentPluginMetadataSnapshot } from "../../../plugins/current-plugi

3939

import { buildAgentHookContextChannelFields } from "../../../plugins/hook-agent-context.js";

4040

import { resolveBlockMessage } from "../../../plugins/hook-decision-types.js";

4141

import { getGlobalHookRunner } from "../../../plugins/hook-runner-global.js";

42+

import type { PluginMetadataSnapshot } from "../../../plugins/plugin-metadata-snapshot.types.js";

43+

import {

44+

resolveProviderRuntimePluginHandle,

45+

type ProviderRuntimePluginHandle,

46+

} from "../../../plugins/provider-hook-runtime.js";

4247

import {

4348

extractModelCompat,

4449

resolveToolCallArgumentsEncoding,

@@ -779,6 +784,36 @@ export async function runEmbeddedAttempt(

779784

}

780785

const effectiveCwd = sandbox?.enabled ? effectiveWorkspace : (requestedCwd ?? effectiveWorkspace);

781786

await fs.mkdir(effectiveWorkspace, { recursive: true });

787+

let currentPluginMetadataSnapshotResolved = false;

788+

let currentPluginMetadataSnapshot: PluginMetadataSnapshot | undefined;

789+

const getCurrentAttemptPluginMetadataSnapshot = () => {

790+

if (!currentPluginMetadataSnapshotResolved) {

791+

currentPluginMetadataSnapshot = getCurrentPluginMetadataSnapshot({

792+

config: params.config,

793+

env: process.env,

794+

workspaceDir: effectiveWorkspace,

795+

});

796+

currentPluginMetadataSnapshotResolved = true;

797+

}

798+

return currentPluginMetadataSnapshot;

799+

};

800+

let providerRuntimeHandle: ProviderRuntimePluginHandle | undefined;

801+

const getProviderRuntimeHandle = () => {

802+

if (providerRuntimeHandle?.plugin) {

803+

return providerRuntimeHandle;

804+

}

805+

const resolvedHandle = resolveProviderRuntimePluginHandle({

806+

provider: params.provider,

807+

modelId: params.modelId,

808+

config: params.config,

809+

workspaceDir: effectiveWorkspace,

810+

env: process.env,

811+

});

812+

if (resolvedHandle.plugin) {

813+

providerRuntimeHandle = resolvedHandle;

814+

}

815+

return resolvedHandle;

816+

};

782817

const { sessionAgentId } = resolveSessionAgentIds({

783818

sessionKey: params.sessionKey,

784819

config: params.config,

@@ -1316,6 +1351,7 @@ export async function runEmbeddedAttempt(

13161351

modelId: params.modelId,

13171352

modelApi: params.model.api,

13181353

model: params.model,

1354+

runtimeHandle: getProviderRuntimeHandle(),

13191355

});

13201356

const clientTools = toolsEnabled && !isRawModelRun ? params.clientTools : undefined;

13211357

const bundleMcpEnabled = shouldCreateBundleMcpRuntimeForAttempt({

@@ -1395,6 +1431,7 @@ export async function runEmbeddedAttempt(

13951431

modelId: params.modelId,

13961432

modelApi: params.model.api,

13971433

model: params.model,

1434+

runtimeHandle: getProviderRuntimeHandle(),

13981435

})

13991436

: filteredBundledTools;

14001437

const projectedUncompactedEffectiveTools = filterLocalModelLeanTools({

@@ -1541,6 +1578,7 @@ export async function runEmbeddedAttempt(

15411578

modelId: params.modelId,

15421579

modelApi: params.model.api,

15431580

model: params.model,

1581+

runtimeHandle: getProviderRuntimeHandle(),

15441582

});

1545158315461584

const machineName = await getMachineDisplayName();

@@ -1577,6 +1615,7 @@ export async function runEmbeddedAttempt(

15771615

modelId: params.modelId,

15781616

modelApi: params.model.api,

15791617

model: params.model,

1618+

runtimeHandle: getProviderRuntimeHandle(),

15801619

});

15811620

// Resolve channel-specific message actions for system prompt

15821621

const channelActions = runtimeChannel

@@ -1680,6 +1719,7 @@ export async function runEmbeddedAttempt(

16801719

provider: params.provider,

16811720

config: params.config,

16821721

workspaceDir: effectiveWorkspace,

1722+

runtimeHandle: getProviderRuntimeHandle(),

16831723

context: promptContributionContext,

16841724

});

16851725

@@ -1688,7 +1728,11 @@ export async function runEmbeddedAttempt(

16881728

);

16891729

const attemptSystemPrompt = buildAttemptSystemPrompt({

16901730

isRawModelRun,

1691-

transformProviderSystemPrompt,

1731+

transformProviderSystemPrompt: (transformParams) =>

1732+

transformProviderSystemPrompt({

1733+

...transformParams,

1734+

runtimeHandle: getProviderRuntimeHandle(),

1735+

}),

16921736

embeddedSystemPrompt: {

16931737

config: params.config,

16941738

agentId: sessionAgentId,

@@ -1901,11 +1945,7 @@ export async function runEmbeddedAttempt(

19011945

cwd: effectiveCwd,

19021946

agentDir,

19031947

cfg: params.config,

1904-

pluginMetadataSnapshot: getCurrentPluginMetadataSnapshot({

1905-

config: params.config,

1906-

env: process.env,

1907-

workspaceDir: effectiveWorkspace,

1908-

}),

1948+

pluginMetadataSnapshot: getCurrentAttemptPluginMetadataSnapshot(),

19091949

contextTokenBudget: params.contextTokenBudget,

19101950

});

19111951

const autoCompactionGuardArgs = {

@@ -2412,6 +2452,7 @@ export async function runEmbeddedAttempt(

24122452

provider: params.provider,

24132453

config: params.config,

24142454

workspaceDir: effectiveWorkspace,

2455+

runtimeHandle: getProviderRuntimeHandle(),

24152456

});

24162457

if (providerTextTransforms) {

24172458

activeSession.agent.streamFn = wrapStreamFnTextTransforms({