fix(composer): scope skill discovery to workspace #8528
ClosedD3OXY(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/8528/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/web/src/components/chat/ChatComposer.tsx lines 2902 to 2902OutdatedResolvedby D3OXY(GitHub profile, opens in a new tab)@@ -2883,18 +2898,5 @@28832898 composerEditorRef.current?.focusAt(nextCollapsedCursor);28842899 });28852900 },2886- getSendContext: () => ({2887- prompt: promptRef.current,2888- images: composerImagesRef.current,2889- terminalContexts: composerTerminalContextsRef.current,2890- elementContexts: composerElementContextsRef.current,2891- previewAnnotations: composerPreviewAnnotations,2892- reviewComments: composerReviewComments,2893- selectedPromptEffort,2894- selectedModelOptionsForDispatch,2895- selectedModelSelection,2896- providerAvailable: !noProviderAvailable,2897- selectedProvider,2898- selectedModel,2899- selectedProviderModels,2900- }),2901+ getSendContext: () => {2902+ const snapshot = composerEditorRef.current?.readSnapshot();
- apps/server/src/provider/providerSkills.ts lines 29 to 37OutdatedResolvedby D3OXY(GitHub profile, opens in a new tab)@@ -0,0 +17,21 @@17+interface ProviderSkillsThread {18+ readonly projectId: ProjectId;19+ readonly worktreePath: string | null;20+}21+22+interface ProviderSkillsSource {23+ readonly fallbackSkills: ReadonlyArray<ServerProviderSkill>;24+ readonly listSkillsForCwd?: (25+ cwd: string,26+ ) => Effect.Effect<Option.Option<ReadonlyArray<ServerProviderSkill>>>;27+}28+29+export interface ProviderSkillsQueryDependencies {30+ readonly getProvider: (31+ instanceId: ProviderInstanceId,32+ ) => Effect.Effect<ProviderSkillsSource | undefined>;33+ readonly getProject: (34+ projectId: ProjectId,35+ ) => Effect.Effect<Option.Option<ProviderSkillsProject>>;36+ readonly getThread: (threadId: ThreadId) => Effect.Effect<Option.Option<ProviderSkillsThread>>;37+}
- apps/web/src/components/ChatView.tsx lines 5774 to 5778Resolvedby D3OXY(GitHub profile, opens in a new tab)@@ -5656,3 +5667,8 @@56565667 effort: ctxSelectedPromptEffort,56575668 text: messageTextForSend || IMAGE_ONLY_BOOTSTRAP_PROMPT,56585669 });5670+ const outgoingSkillInvocations = remapExplicitSkillInvocations({5671+ sourceText: messageTextForSend,5672+ outgoingText: outgoingMessageText,5673+ invocations: composerSkillInvocations,5674+ });
- apps/web/src/components/ComposerPromptEditor.tsx lines 868 to 871OutdatedResolvedby D3OXY(GitHub profile, opens in a new tab)@@ -865,3 +865,7 @@865865 return [];866866 }867867868+function collectExplicitSkillInvocations(node: LexicalNode): ExplicitSkillInvocation[] {869+ if (node instanceof ComposerSkillNode) {870+ const start = getExpandedAbsoluteOffsetForPoint(node, 0);871+ return [{ name: node.__skillName, start, end: start + node.getTextContentSize() }];
- @@ -5755,3 +5771,8 @@57555771 effort: ctxSelectedPromptEffort,57565772 text: messageTextForSend || ATTACHMENT_ONLY_BOOTSTRAP_PROMPT,57575773 });5774+ const outgoingSkillInvocations = remapExplicitSkillInvocations({5775+ sourceText: messageTextForSend,5776+ outgoingText: outgoingMessageText,5777+ invocations: terminalContextPrompt.ranges,5778+ });
D3OXY(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
de16c932-359e-4993-937c-58d2451d2f0dYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.