diff --git a/apps/server/src/skills/SkillInventory.ts b/apps/server/src/skills/SkillInventory.ts index c29ae33be5..cf71228a73 100644 --- a/apps/server/src/skills/SkillInventory.ts +++ b/apps/server/src/skills/SkillInventory.ts @@ -49,7 +49,6 @@ const readSkillInstallations = Effect.fn("SkillInventory.readSkillInstallations" directoryPath: path.dirname(skill.path), skillFilePath: skill.path, content, - enabled: skill.enabled, })), ), ); diff --git a/apps/web/src/components/settings/SkillsSettings.test.ts b/apps/web/src/components/settings/SkillsSettings.test.ts index 3c5036a63d..89faf3b29d 100644 --- a/apps/web/src/components/settings/SkillsSettings.test.ts +++ b/apps/web/src/components/settings/SkillsSettings.test.ts @@ -22,7 +22,6 @@ const inventory: SkillInventory = { directoryPath: "/home/test/.codex/skills/review", skillFilePath: "/home/test/.codex/skills/review/SKILL.md", content: "---\nname: review\n---\n\n# Review", - enabled: true, }, { providerInstanceId: ProviderInstanceId.make("claude"), @@ -32,7 +31,6 @@ const inventory: SkillInventory = { directoryPath: "/home/test/.claude/skills/deploy", skillFilePath: "/home/test/.claude/skills/deploy/SKILL.md", content: "---\nname: deploy\n---\n\n# Deploy", - enabled: true, }, ], }; diff --git a/apps/web/src/components/settings/SkillsSettings.tsx b/apps/web/src/components/settings/SkillsSettings.tsx index bd8746f455..ec4f8447d3 100644 --- a/apps/web/src/components/settings/SkillsSettings.tsx +++ b/apps/web/src/components/settings/SkillsSettings.tsx @@ -156,15 +156,16 @@ function EnvironmentSkillInventory({ [query, state], ); const isConnected = Option.isSome(prepared); - const skillCount = displayedSkillCount(visibleInventory, isConnected); + const skillCount = displayedSkillCount( + state.status === "loaded" ? state.inventory : null, + isConnected, + ); const phase = environment.connection.phase; const isSearching = query.trim().length > 0; - const open = !collapsed; - - // Searching would otherwise hide its own matches inside collapsed sections. - useEffect(() => { - if (isSearching) setCollapsed(false); - }, [isSearching]); + const open = isSearching || !collapsed; + const setOpen = (nextOpen: boolean) => { + if (!isSearching) setCollapsed(!nextOpen); + }; return (
@@ -177,7 +178,7 @@ function EnvironmentSkillInventory({ aria-expanded={open} // The panel unmounts while closed, so only reference it when open. aria-controls={open ? panelId : undefined} - onClick={() => setCollapsed((value) => !value)} + onClick={() => setOpen(!open)} className="flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-lg py-2 pl-3 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:pl-4" > @@ -202,7 +203,7 @@ function EnvironmentSkillInventory({ ) : null} - setCollapsed(!next)}> +
{Option.isNone(prepared) ? ( @@ -237,11 +238,6 @@ function SkillHarnessGroups({ ); const groups = useMemo(() => groupSkillsByHarness(inventory.installations), [inventory]); - // Searching would otherwise hide its own matches inside collapsed harnesses. - useEffect(() => { - if (isSearching) setCollapsedHarnesses(new Set()); - }, [isSearching]); - return groups.map((group) => ( - setCollapsedHarnesses((keys) => setKeyCollapsed(keys, group.key, !nextOpen)) - } + open={isSearching || !collapsedHarnesses.has(group.key)} + onOpenChange={(nextOpen) => { + if (!isSearching) { + setCollapsedHarnesses((keys) => setKeyCollapsed(keys, group.key, !nextOpen)); + } + }} /> )); } diff --git a/docs/architecture/skill-manager-plan.html b/docs/architecture/skill-manager-plan.html index 23a68a5c73..451a5d9ad9 100644 --- a/docs/architecture/skill-manager-plan.html +++ b/docs/architecture/skill-manager-plan.html @@ -445,7 +445,7 @@ Codex skills The server calls Codex app-server skills/list and maps name, path, - scope, enabled, and presentation metadata. + scope, and authoritative enablement when the harness exposes it. Reuse parsing knowledge, but inventory independently of a session cwd and configured diff --git a/packages/client-runtime/src/state/skillInventoryHttp.ts b/packages/client-runtime/src/state/skillInventoryHttp.ts index e81c1e0b3b..2a3b6f7a11 100644 --- a/packages/client-runtime/src/state/skillInventoryHttp.ts +++ b/packages/client-runtime/src/state/skillInventoryHttp.ts @@ -24,13 +24,13 @@ export function formatSkillPath(path: string): string { } export function filterSkillInventory(inventory: SkillInventory, query: string): SkillInventory { - const normalizedQuery = query.trim().toLocaleLowerCase(); + const normalizedQuery = query.trim().toLowerCase(); if (!normalizedQuery) return inventory; return { ...inventory, installations: inventory.installations.filter((skill) => [skill.name, skill.description ?? "", skill.directoryPath, skill.harnessDisplayName].some( - (value) => value.toLocaleLowerCase().includes(normalizedQuery), + (value) => value.toLowerCase().includes(normalizedQuery), ), ), }; diff --git a/packages/contracts/src/skillInventory.ts b/packages/contracts/src/skillInventory.ts index 12463263fc..d8c32fae30 100644 --- a/packages/contracts/src/skillInventory.ts +++ b/packages/contracts/src/skillInventory.ts @@ -3,6 +3,11 @@ import * as Schema from "effect/Schema"; import { TrimmedNonEmptyString } from "./baseSchemas.ts"; import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts"; +/** + * Filesystem inventory intentionally omits per-skill enablement. Codex only + * exposes that state through its live RPC, while Claude has no equivalent, + * so persisting it here would make the cross-harness response misleading. + */ export const SkillInventoryInstallation = Schema.Struct({ providerInstanceId: ProviderInstanceId, harness: ProviderDriverKind, @@ -12,7 +17,6 @@ export const SkillInventoryInstallation = Schema.Struct({ directoryPath: TrimmedNonEmptyString, skillFilePath: TrimmedNonEmptyString, content: Schema.String, - enabled: Schema.Boolean, }); export type SkillInventoryInstallation = typeof SkillInventoryInstallation.Type;