fix(webui): refresh skill suggestions when opening the picker

Refresh the shared skill list when a dollar-reference picker opens so skills installed by the agent appear without reloading the page. Coalesce in-flight requests and preserve the last known list on transient failures.

Cover post-load discovery, Tab completion, removals, request deduplication, cleanup, and retry behavior with regression tests.
This commit is contained in:
Xubin Ren committed 2026-09-09 13:36:50 +08:00
1 parent b5d2a3fb8e
commit 27518ca9fd
4 files changed
+120 -3

No files matched your search

@@ -108,6 +108,7 @@ import {
logoFallbackUrls,
} from "@/lib/provider-brand";
import { sessionHandleColor } from "@/lib/session-handle";
import { requestSkillsRefresh } from "@/lib/skill-events";
import {
isSideChannelLifecycle,
slashCommandLifecycle,
@@ -1121,6 +1122,12 @@ export function ThreadComposer({
};
}, [cursorPosition, interactionDisabled, slashMenuDismissed, value]);
const skillMenuActive = skillQuery !== null;
useEffect(() => {
// Also refresh an empty menu: skills may have been installed by the agent.
if (skillMenuActive) requestSkillsRefresh();
}, [skillMenuActive]);
const visibleSlashCommands = useMemo(() => {
if (!(isStreaming && onStop)) return slashCommands;
const stopCommand = slashCommands.find((command) => command.command === "/stop");