fix(canvas): raise Claw skill tag limit
This commit is contained in:
parent
ee5b5d146d
commit
c2fcf11280
@ -225,7 +225,7 @@ function appendMissingCanvasSkillTags(
|
|||||||
return [
|
return [
|
||||||
...tags,
|
...tags,
|
||||||
...additions.filter((tag) => !existingIds.has(tag.id)),
|
...additions.filter((tag) => !existingIds.has(tag.id)),
|
||||||
].slice(0, 30);
|
].slice(0, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeCanvasSkillTags(value: unknown): CanvasSkillTag[] {
|
export function normalizeCanvasSkillTags(value: unknown): CanvasSkillTag[] {
|
||||||
@ -261,7 +261,7 @@ export function normalizeCanvasSkillTags(value: unknown): CanvasSkillTag[] {
|
|||||||
return DEFAULT_CANVAS_SKILL_TAGS;
|
return DEFAULT_CANVAS_SKILL_TAGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return normalized.slice(0, 30);
|
return normalized.slice(0, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeCanvasSkillTagSettings(
|
export function normalizeCanvasSkillTagSettings(
|
||||||
|
|||||||
@ -216,6 +216,23 @@ test.describe.serial("/api/admin/settings", () => {
|
|||||||
expect(normalized.tags).toEqual(customTags);
|
expect(normalized.tags).toEqual(customTags);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("canvas skill tag settings retain more than thirty configured skills", () => {
|
||||||
|
const configuredTags: CanvasSkillTag[] = Array.from({ length: 31 }, (_, index) => ({
|
||||||
|
id: `configured-skill-${index + 1}`,
|
||||||
|
name: `Configured skill ${index + 1}`,
|
||||||
|
prompt: `Run configured skill ${index + 1}`,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const normalized = normalizeCanvasSkillTagSettings({
|
||||||
|
enabled: true,
|
||||||
|
title: "Claw 快捷技能",
|
||||||
|
tags: configuredTags,
|
||||||
|
version: CANVAS_SKILL_TAGS_CONFIG_VERSION,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(normalized.tags).toEqual(configuredTags);
|
||||||
|
});
|
||||||
|
|
||||||
test("canvas skill tags still use defaults when no stored setting exists", () => {
|
test("canvas skill tags still use defaults when no stored setting exists", () => {
|
||||||
const normalized = normalizeCanvasSkillTagSettings(null, {
|
const normalized = normalizeCanvasSkillTagSettings(null, {
|
||||||
requireCurrentVersion: true,
|
requireCurrentVersion: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user