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

推荐订阅源

V
Visual Studio Blog
量子位
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell

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: centralize skill status lookup · openclaw/openclaw@...
shakkernerd · 2026-05-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,5 +1,8 @@

1-

import { normalizeSkillIndexName } from "../skills/discovery/skill-index.js";

2-

import type { SkillStatusEntry, SkillStatusReport } from "../skills/discovery/status.js";

1+

import {

2+

resolveSkillStatusEntry,

3+

type SkillStatusEntry,

4+

type SkillStatusReport,

5+

} from "../skills/discovery/status.js";

36

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

47

import { decorativeEmoji, decorativePrefix } from "../terminal/decorative-emoji.js";

58

import { getTerminalTableWidth, renderTable } from "../terminal/table.js";

@@ -104,53 +107,6 @@ function formatSkillMissingSummary(skill: SkillStatusEntry): string {

104107

return missing.join("; ");

105108

}

106109
107-

function normalizeSkillLookupToken(value: string): string {

108-

return normalizeSkillIndexName(value);

109-

}

110-
111-

function resolveSkillByName(

112-

report: SkillStatusReport,

113-

requestedName: string,

114-

): SkillStatusEntry | null {

115-

const raw = requestedName.trim();

116-

if (!raw) {

117-

return null;

118-

}

119-
120-

const direct = report.skills.find((s) => s.name === raw || s.skillKey === raw);

121-

if (direct) {

122-

return direct;

123-

}

124-
125-

const lower = raw.toLowerCase();

126-

const caseInsensitiveMatches = report.skills.filter(

127-

(s) => s.name.toLowerCase() === lower || s.skillKey.toLowerCase() === lower,

128-

);

129-

if (caseInsensitiveMatches.length === 1) {

130-

return caseInsensitiveMatches[0] ?? null;

131-

}

132-

if (caseInsensitiveMatches.length > 1) {

133-

return null;

134-

}

135-
136-

const normalized = normalizeSkillLookupToken(raw);

137-

if (!normalized) {

138-

return null;

139-

}

140-
141-

const normalizedMatches = report.skills.filter(

142-

(s) =>

143-

normalizeSkillLookupToken(s.name) === normalized ||

144-

normalizeSkillLookupToken(s.skillKey) === normalized,

145-

);

146-
147-

if (normalizedMatches.length !== 1) {

148-

return null;

149-

}

150-
151-

return normalizedMatches[0] ?? null;

152-

}

153-
154110

export function formatSkillsList(report: SkillStatusReport, opts: SkillsListOptions): string {

155111

const isReadyForAgent = (skill: SkillStatusEntry) =>

156112

skill.eligible && !skill.blockedByAgentFilter;

@@ -233,7 +189,7 @@ export function formatSkillInfo(

233189

): string {

234190

const requestedName = skillName.trim();

235191

const safeRequestedName = sanitizeJsonString(sanitizeForLog(requestedName));

236-

const skill = resolveSkillByName(report, requestedName);

192+

const skill = resolveSkillStatusEntry(report.skills, requestedName);

237193
238194

if (!skill) {

239195

if (opts.json) {

Original file line numberDiff line numberDiff line change

@@ -28,7 +28,11 @@ import type {

2828

SkillsInstallPreferences,

2929

} from "../types.js";

3030

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

31-

import { buildSkillIndexEntries, type SkillIndexEntry } from "./skill-index.js";

31+

import {

32+

buildSkillIndexEntries,

33+

normalizeSkillIndexName,

34+

type SkillIndexEntry,

35+

} from "./skill-index.js";

3236
3337

export type SkillStatusConfigCheck = RequirementConfigCheck;

3438

@@ -74,6 +78,57 @@ export type SkillStatusReport = {

7478

skills: SkillStatusEntry[];

7579

};

7680
81+

export function resolveSkillStatusEntry(

82+

skills: readonly SkillStatusEntry[],

83+

requestedName: string,

84+

): SkillStatusEntry | null {

85+

const raw = requestedName.trim();

86+

if (!raw) {

87+

return null;

88+

}

89+
90+

const lower = raw.toLowerCase();

91+

const normalized = normalizeSkillIndexName(raw);

92+

let caseInsensitiveMatch: SkillStatusEntry | null = null;

93+

let caseInsensitiveMatches = 0;

94+

let normalizedMatch: SkillStatusEntry | null = null;

95+

let normalizedMatches = 0;

96+
97+

for (const skill of skills) {

98+

if (skill.name === raw || skill.skillKey === raw) {

99+

return skill;

100+

}

101+
102+

const nameLower = skill.name.toLowerCase();

103+

const keyLower = skill.skillKey.toLowerCase();

104+

if (nameLower === lower || keyLower === lower) {

105+

caseInsensitiveMatch = skill;

106+

caseInsensitiveMatches += 1;

107+

continue;

108+

}

109+
110+

if (

111+

normalized &&

112+

(normalizeSkillIndexName(skill.name) === normalized ||

113+

normalizeSkillIndexName(skill.skillKey) === normalized)

114+

) {

115+

normalizedMatch = skill;

116+

normalizedMatches += 1;

117+

}

118+

}

119+
120+

if (caseInsensitiveMatches > 1) {

121+

return null;

122+

}

123+

if (caseInsensitiveMatches === 1) {

124+

return caseInsensitiveMatch;

125+

}

126+

if (normalizedMatches === 1) {

127+

return normalizedMatch;

128+

}

129+

return null;

130+

}

131+
77132

function selectPreferredInstallSpec(

78133

install: SkillInstallSpec[],

79134

prefs: SkillsInstallPreferences,