fix(server): discover project skills for Codex and OpenCode #8778
MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/8778/headmerged by maria-rcks 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:L
UtkarshUsername(GitHub profile, opens in a new tab) changed the title
- apps/web/src/components/chat/ChatComposer.tsx line 1099Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1057,0 +1079,21 @@1079+ workspaceRefreshKeyRef.current = null;1080+ }1081+ hadWorkspaceSnapshotRef.current = hasWorkspaceSnapshot;1082+ }, [gitCwd, selectedProviderStatus]);1083+ useEffect(() => {1084+ if (!gitCwd || !selectedProviderEntry) return;1085+ const key = `${environmentId}:${selectedProviderEntry.instanceId}:${gitCwd}`;1086+ const hasWorkspaceSnapshot = selectedProviderStatus?.workspaceSnapshots?.some(1087+ (snapshot) => snapshot.cwd === gitCwd,1088+ );1089+ if (workspaceRefreshKeyRef.current === key) return;1090+ if (hasWorkspaceSnapshot) {1091+ workspaceRefreshKeyRef.current = key;1092+ return;1093+ }1094+ workspaceRefreshKeyRef.current = key;1095+ void refreshProviders({1096+ environmentId,1097+ input: { instanceId: selectedProviderEntry.instanceId, cwd: gitCwd },1098+ }).then(1099+ (result) => {apps/server/src/provider/opencodeRuntime.ts line 867OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -855,5 +863,5 @@855863 Effect.orElseSucceed((): ReadonlyArray<Agent> => []),856864 );857865858- const loadSkills = (client: OpencodeClient) =>866+ const loadOpenCodeSkills: OpenCodeRuntimeShape["loadOpenCodeSkills"] = (client) =>859867 runOpenCodeSdk("app.skills", () => client.app.skills()).pipe(packages/client-runtime/src/state/server.ts line 792OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -788,4 +788,5 @@788788 tag: WS_METHODS.serverRefreshProviders,789789 concurrency: {790790 mode: "singleFlight",791- key: ({ environmentId }) => environmentId,791+ key: ({ environmentId, input }) =>792+ `${environmentId}:${input.instanceId ?? "all"}:${input.cwd ?? "machine"}`,
- apps/web/src/components/chat/ChatComposer.tsx lines 1095 to 1097Resolvedby UtkarshUsername(GitHub profile, opens in a new tab)@@ -1057,0 +1077,21 @@1077+ );1078+ if (hadWorkspaceSnapshotRef.current && !hasWorkspaceSnapshot) {1079+ workspaceRefreshKeyRef.current = null;1080+ }1081+ hadWorkspaceSnapshotRef.current = hasWorkspaceSnapshot;1082+ }, [gitCwd, selectedProviderStatus]);1083+ useEffect(() => {1084+ if (!gitCwd || !selectedProviderEntry) return;1085+ const key = `${environmentId}:${selectedProviderEntry.instanceId}:${gitCwd}`;1086+ const hasWorkspaceSnapshot = selectedProviderStatus?.workspaceSnapshots?.some(1087+ (snapshot) => snapshot.cwd === gitCwd,1088+ );1089+ if (workspaceRefreshKeyRef.current === key) return;1090+ if (hasWorkspaceSnapshot) {1091+ workspaceRefreshKeyRef.current = key;1092+ return;1093+ }1094+ workspaceRefreshKeyRef.current = key;1095+ void refreshProviders({1096+ environmentId,1097+ input: { instanceId: selectedProviderEntry.instanceId, cwd: gitCwd },
- apps/web/src/components/chat/ChatComposer.tsx line 1111Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1057,0 +1086,21 @@1086+ const hasWorkspaceSnapshot = selectedProviderStatus?.workspaceSnapshots?.some(1087+ (snapshot) => snapshot.cwd === gitCwd,1088+ );1089+ if (workspaceRefreshKeyRef.current === key) return;1090+ if (hasWorkspaceSnapshot) {1091+ workspaceRefreshKeyRef.current = key;1092+ return;1093+ }1094+ workspaceRefreshKeyRef.current = key;1095+ void refreshProviders({1096+ environmentId,1097+ input: { instanceId: selectedProviderEntry.instanceId, cwd: gitCwd },1098+ }).then(1099+ (result) => {1100+ if (result._tag !== "Success" && workspaceRefreshKeyRef.current === key) {1101+ workspaceRefreshKeyRef.current = null;1102+ }1103+ },1104+ () => {1105+ if (workspaceRefreshKeyRef.current === key) workspaceRefreshKeyRef.current = null;1106+ },@@ -1631,4 +1631,12 @@16311631 (input.instanceId !== undefined16321632 ? providerRegistry.refreshInstance(input.instanceId)16331633 : providerRegistry.refresh()1634- ).pipe(Effect.map((providers) => ({ providers }))),1634+ ).pipe(1635+ Effect.flatMap((providers) =>1636+ input.cwd !== undefined && input.instanceId !== undefined1637+ ? providerRegistry1638+ .refreshWorkspaceSnapshot({1639+ instanceId: input.instanceId,1640+ cwd: input.cwd,1641+ })1642+ .pipe(Effect.andThen(providerRegistry.getProviders))
UtkarshUsername(GitHub profile, opens in a new tab) changed the title
maria-rcks merged this80a14b6
maria-rcks 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:
259176d0-06ad-4a33-a1f2-b863c5f7bb77You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Warning
Your free Security trial is over. An organization admin can activate Security or dismiss this notice.
Comment `@coderabbitai help` to get the list of available commands.