fix(x): copilot prompt's Composio section uses the shared connection check

getComposioToolsPrompt still called the raw composio client's
isConfigured; everything else (skill catalog availability, the other
prompt connection blocks) goes through assembly/connections.ts, whose
check wraps in try/catch -> false. On an errored config read the two
could diverge: the prompt advertises Composio tools while the catalog
hides the composio skill the model would need to use them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ramnique Singh 2026-07-10 17:51:23 +05:30
parent 3b6c30fac9
commit 7fdfa32c7e

View file

@ -7,7 +7,6 @@ import {
isSlackAvailable,
} from "../connections.js";
import { composioAccountsRepo } from "../../../composio/repo.js";
import { isConfigured as isComposioConfigured } from "../../../composio/client.js";
import { CURATED_TOOLKITS } from "@x/shared/dist/composio.js";
import { knowledgeSourcesRepo } from "../../../knowledge/sources/repo.js";
import { listApps } from "../../../apps/indexer.js";
@ -52,7 +51,10 @@ When a question matches what an app tracks, PREFER the app over external calls:
* Lists connected toolkits and explains the meta-tool discovery flow.
*/
async function getComposioToolsPrompt(slackConnected: boolean = false, googleConnected: boolean = false): Promise<string> {
if (!(await isComposioConfigured())) {
// connections.js, not the raw composio client: the skill catalog's
// availability filter uses the same check, so the prompt's Composio
// section and the catalog's composio skill can never disagree.
if (!(await isComposioAvailable())) {
return '';
}