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

推荐订阅源

月光博客
月光博客
MyScale Blog
MyScale Blog
博客园 - Franky
The Cloudflare Blog
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
腾讯CDC
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
云风的 BLOG
云风的 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
refactor: centralize skills runtime paths · openclaw/open...
shakkernerd · 2026-05-30 · via Recent Commits to openclaw:main

@@ -39,7 +39,9 @@ import {

3939

import { resolveSendPolicy } from "../sessions/send-policy.js";

4040

import { createLazyImportLoader } from "../shared/lazy-promise.js";

4141

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

42-

import { hydrateResolvedSkillsAsync } from "../skills/snapshot-hydration.js";

42+

import { resolveEffectiveAgentSkillFilter } from "../skills/agent-filter.js";

43+

import type { getRemoteSkillEligibility } from "../skills/remote.js";

44+

import type { resolveReusableWorkspaceSkillSnapshot } from "../skills/session-snapshot.js";

4345

import type { SkillSnapshot } from "../skills/types.js";

4446

import { sanitizeForLog } from "../terminal/ansi.js";

4547

import { createTrajectoryRuntimeRecorder } from "../trajectory/runtime.js";

@@ -58,7 +60,6 @@ import {

5860

resolveDefaultAgentId,

5961

resolveEffectiveModelFallbacks,

6062

resolveSessionAgentId,

61-

resolveAgentSkillsFilter,

6263

resolveAgentWorkspaceDir,

6364

} from "./agent-scope.js";

6465

import { isStoredCredentialCompatibleWithAuthProvider } from "./auth-profiles/order.js";

@@ -117,10 +118,10 @@ type CliCompactionRuntime = typeof import("./command/cli-compaction.js");

117118

type TranscriptResolveRuntime = typeof import("../config/sessions/transcript-resolve.runtime.js");

118119

type CliDepsRuntime = typeof import("../cli/deps.js");

119120

type ExecDefaultsRuntime = typeof import("./exec-defaults.js");

120-

type SkillsRuntime = typeof import("../skills/index.js");

121-

type SkillsFilterRuntime = typeof import("../skills/filter.js");

122-

type SkillsRefreshStateRuntime = typeof import("../skills/refresh-state.js");

123-

type SkillsRemoteRuntime = typeof import("../infra/skills-remote.js");

121+

type SkillsRuntime = {

122+

getRemoteSkillEligibility: typeof getRemoteSkillEligibility;

123+

resolveReusableWorkspaceSkillSnapshot: typeof resolveReusableWorkspaceSkillSnapshot;

124+

};

124125125126

const attemptExecutionRuntimeLoader = createLazyImportLoader<AttemptExecutionRuntime>(

126127

() => import("./command/attempt-execution.runtime.js"),

@@ -153,31 +154,16 @@ const cliDepsRuntimeLoader = createLazyImportLoader<CliDepsRuntime>(() => import

153154

const execDefaultsRuntimeLoader = createLazyImportLoader<ExecDefaultsRuntime>(

154155

() => import("./exec-defaults.js"),

155156

);

156-

const skillsRuntimeLoader = createLazyImportLoader<SkillsRuntime>(

157-

() => import("../skills/index.js"),

158-

);

159-

const skillsFilterRuntimeLoader = createLazyImportLoader<SkillsFilterRuntime>(

160-

() => import("../skills/filter.js"),

161-

);

162-

const skillsRefreshStateRuntimeLoader = createLazyImportLoader<SkillsRefreshStateRuntime>(

163-

() => import("../skills/refresh-state.js"),

164-

);

165-

const skillsRemoteRuntimeLoader = createLazyImportLoader<SkillsRemoteRuntime>(

166-

() => import("../infra/skills-remote.js"),

167-

);

168-169-

function createEmptySkillsSnapshot(params: {

170-

skillFilter: string[];

171-

version?: number;

172-

}): SkillSnapshot {

157+

const skillsRuntimeLoader = createLazyImportLoader<SkillsRuntime>(async () => {

158+

const [remote, sessionSnapshot] = await Promise.all([

159+

import("../skills/remote.js"),

160+

import("../skills/session-snapshot.js"),

161+

]);

173162

return {

174-

prompt: "",

175-

skills: [],

176-

resolvedSkills: [],

177-

skillFilter: params.skillFilter,

178-

version: params.version,

163+

getRemoteSkillEligibility: remote.getRemoteSkillEligibility,

164+

resolveReusableWorkspaceSkillSnapshot: sessionSnapshot.resolveReusableWorkspaceSkillSnapshot,

179165

};

180-

}

166+

});

181167182168

function loadAttemptExecutionRuntime(): Promise<AttemptExecutionRuntime> {

183169

return attemptExecutionRuntimeLoader.load();

@@ -227,18 +213,6 @@ function loadSkillsRuntime(): Promise<SkillsRuntime> {

227213

return skillsRuntimeLoader.load();

228214

}

229215230-

function loadSkillsFilterRuntime(): Promise<SkillsFilterRuntime> {

231-

return skillsFilterRuntimeLoader.load();

232-

}

233-234-

function loadSkillsRefreshStateRuntime(): Promise<SkillsRefreshStateRuntime> {

235-

return skillsRefreshStateRuntimeLoader.load();

236-

}

237-238-

function loadSkillsRemoteRuntime(): Promise<SkillsRemoteRuntime> {

239-

return skillsRemoteRuntimeLoader.load();

240-

}

241-242216

async function resolveAgentCommandDeps(deps: CliDeps | undefined): Promise<CliDeps> {

243217

if (deps) {

244218

return deps;

@@ -819,55 +793,33 @@ async function agentCommandInternal(

819793

});

820794

}

821795822-

const [{ getSkillsSnapshotVersion, shouldRefreshSnapshotForVersion }, { matchesSkillFilter }] =

823-

await Promise.all([loadSkillsRefreshStateRuntime(), loadSkillsFilterRuntime()]);

824-

const skillsSnapshotVersion = getSkillsSnapshotVersion(workspaceDir);

825-

const skillFilter = resolveAgentSkillsFilter(cfg, sessionAgentId);

796+

const skillFilter = resolveEffectiveAgentSkillFilter(cfg, sessionAgentId);

826797

const currentSkillsSnapshot = sessionEntry?.skillsSnapshot;

827-

const shouldRefreshSkillsSnapshot =

828-

!currentSkillsSnapshot ||

829-

shouldRefreshSnapshotForVersion(currentSkillsSnapshot.version, skillsSnapshotVersion) ||

830-

!matchesSkillFilter(currentSkillsSnapshot.skillFilter, skillFilter);

831-

const needsSkillsSnapshot = isNewSession || shouldRefreshSkillsSnapshot;

832-

const emptySkillsFilter = skillFilter !== undefined && skillFilter.length === 0;

833-

const buildSkillsSnapshot = async () => {

834-

if (emptySkillsFilter) {

835-

return createEmptySkillsSnapshot({

836-

skillFilter,

837-

version: skillsSnapshotVersion,

838-

});

839-

}

840-

const [

841-

{ buildWorkspaceSkillSnapshot },

842-

{ getRemoteSkillEligibility },

843-

{ canExecRequestNode },

844-

] = await Promise.all([

845-

loadSkillsRuntime(),

846-

loadSkillsRemoteRuntime(),

847-

loadExecDefaultsRuntime(),

848-

]);

849-

return buildWorkspaceSkillSnapshot(workspaceDir, {

850-

config: cfg,

851-

eligibility: {

852-

remote: getRemoteSkillEligibility({

853-

advertiseExecNode: canExecRequestNode({

854-

cfg,

855-

sessionEntry,

856-

sessionKey,

857-

agentId: sessionAgentId,

858-

}),

798+

const [

799+

{ getRemoteSkillEligibility, resolveReusableWorkspaceSkillSnapshot },

800+

{ canExecRequestNode },

801+

] = await Promise.all([loadSkillsRuntime(), loadExecDefaultsRuntime()]);

802+

const skillSnapshotState = resolveReusableWorkspaceSkillSnapshot({

803+

workspaceDir,

804+

config: cfg,

805+

agentId: sessionAgentId,

806+

existingSnapshot: isNewSession ? undefined : currentSkillsSnapshot,

807+

skillFilter,

808+

eligibility: {

809+

remote: getRemoteSkillEligibility({

810+

advertiseExecNode: canExecRequestNode({

811+

cfg,

812+

sessionEntry,

813+

sessionKey,

814+

agentId: sessionAgentId,

859815

}),

860-

},

861-

snapshotVersion: skillsSnapshotVersion,

862-

skillFilter,

863-

agentId: sessionAgentId,

864-

});

865-

};

866-

const skillsSnapshot = needsSkillsSnapshot

867-

? await buildSkillsSnapshot()

868-

: !currentSkillsSnapshot

869-

? undefined

870-

: await hydrateResolvedSkillsAsync(currentSkillsSnapshot, buildSkillsSnapshot);

816+

}),

817+

},

818+

watch: false,

819+

});

820+

const needsSkillsSnapshot =

821+

isNewSession || !currentSkillsSnapshot || skillSnapshotState.shouldRefresh;

822+

const skillsSnapshot = skillSnapshotState.snapshot;

871823872824

if (

873825

skillsSnapshot &&