Skip to content
Source
Sign inSign up
pingdotgg/t3code

Expose project provider skills in chat #3982

Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/3982/headopened View on GitHub

Showing 36 changed files with 121 additions and 8 deletions (loading 33).

x
0 of 36 viewed, 36 left
47 additions and 5 deletionsapps/mobile/src/features/threads/ThreadComposer.tsxModified
View file
@@ -68,7 +68,13 @@
resolveProviderOptionDescriptors,
} from "../../lib/providerOptions";
import { useComposerPathSearch } from "../../state/use-composer-path-search";
+import { useProviderSkills } from "../../state/queries";
import { ComposerCommandPopover, type ComposerCommandItem } from "./ComposerCommandPopover";
+import {
+ type CachedComposerProviderSkills,
+ getComposerProviderSkillsCacheEntry,
+ resolveComposerProviderSkills,
+} from "@t3tools/client-runtime/state/projects";
​
/**
* Height of the collapsed composer (pill + vertical padding, excluding safe-area inset).
@@ -365,6 +371,38 @@
cwd: composerTrigger?.kind === "path" ? props.projectCwd : null,
query: composerTrigger?.kind === "path" ? composerTrigger.query : null,
});
+ const providerSkills = useProviderSkills({
+ environmentId: props.environmentId,
+ instanceId: selectedProviderStatus?.instanceId ?? null,
+ cwd: props.projectCwd,
Thread on line 377

P2 Badge 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(() => {