Expose project provider skills in chat #3982
Closed
jakeleventhal(GitHub profile, opens in a new tab)wants to merge 7 commits into
main fromrefs/pull/3982/head·opened View on GitHubShowing 36 changed files with 121 additions and 8 deletions (loading 33).
x
47 additions and 5 deletions+47-5apps/mobile/src/features/threads/ThreadComposer.tsxModifiedView file
@@ -68,7 +68,13 @@
+import { useProviderSkills } from "../../state/queries";
+import {
+ type CachedComposerProviderSkills,
+ getComposerProviderSkillsCacheEntry,
+ resolveComposerProviderSkills,
+} from "@t3tools/client-runtime/state/projects";
@@ -365,6 +371,38 @@
+ const providerSkills = useProviderSkills({
+ environmentId: props.environmentId,
+ instanceId: selectedProviderStatus?.instanceId ?? null,
+ cwd: props.projectCwd,
Thread on line 377
Discover skills from the active mobile worktree
For a thread running in a worktree, ThreadDetailScreen already receives the resolved threadCwd but passes the base projectWorkspaceRoot as this component's projectCwd. Consequently this query and its cache inspect the base checkout while the provider session executes in the worktree, so branch-specific additions or removals produce an incorrect skill menu and selected entries may not invoke anything. Use the active thread cwd for provider-skill discovery, falling back to the project root only when needed.
Useful? React with 👍 / 👎.
+ enabled: composerTrigger?.kind === "skill",
+ });
+ const providerSkillsTargetKey = `${props.environmentId}\0${selectedProviderStatus?.instanceId ?? ""}\0${props.projectCwd ?? ""}`;
+ const [cachedProviderSkills, setCachedProviderSkills] =
+ useState<CachedComposerProviderSkills | null>(null);
+ useEffect(() => {