mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 02:22:25 +00:00
feat(skills): add inherited agent skill allowlists (#59992)
Merged via squash.
Prepared head SHA: 6f60779a57
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
04f59a7227
commit
ddd250d130
@@ -78,7 +78,8 @@ import {
|
||||
resolveThinkingDefault,
|
||||
} from "./model-selection.js";
|
||||
import { buildWorkspaceSkillSnapshot } from "./skills.js";
|
||||
import { getSkillsSnapshotVersion } from "./skills/refresh.js";
|
||||
import { matchesSkillFilter } from "./skills/filter.js";
|
||||
import { getSkillsSnapshotVersion, shouldRefreshSnapshotForVersion } from "./skills/refresh.js";
|
||||
import { normalizeSpawnedRunMetadata } from "./spawned-context.js";
|
||||
import { resolveAgentTimeoutMs } from "./timeout.js";
|
||||
import { ensureAgentWorkspace } from "./workspace.js";
|
||||
@@ -497,17 +498,23 @@ async function agentCommandInternal(
|
||||
});
|
||||
}
|
||||
|
||||
const needsSkillsSnapshot = isNewSession || !sessionEntry?.skillsSnapshot;
|
||||
const skillsSnapshotVersion = getSkillsSnapshotVersion(workspaceDir);
|
||||
const skillFilter = resolveAgentSkillsFilter(cfg, sessionAgentId);
|
||||
const currentSkillsSnapshot = sessionEntry?.skillsSnapshot;
|
||||
const shouldRefreshSkillsSnapshot =
|
||||
!currentSkillsSnapshot ||
|
||||
shouldRefreshSnapshotForVersion(currentSkillsSnapshot.version, skillsSnapshotVersion) ||
|
||||
!matchesSkillFilter(currentSkillsSnapshot.skillFilter, skillFilter);
|
||||
const needsSkillsSnapshot = isNewSession || shouldRefreshSkillsSnapshot;
|
||||
const skillsSnapshot = needsSkillsSnapshot
|
||||
? buildWorkspaceSkillSnapshot(workspaceDir, {
|
||||
config: cfg,
|
||||
eligibility: { remote: getRemoteSkillEligibility() },
|
||||
snapshotVersion: skillsSnapshotVersion,
|
||||
skillFilter,
|
||||
agentId: sessionAgentId,
|
||||
})
|
||||
: sessionEntry?.skillsSnapshot;
|
||||
: currentSkillsSnapshot;
|
||||
|
||||
if (skillsSnapshot && sessionStore && sessionKey && needsSkillsSnapshot) {
|
||||
const current = sessionEntry ?? {
|
||||
|
||||
Reference in New Issue
Block a user