Fix AI demo workspace skill (#18575)

This PR fixes what allows to have a working demo workspace skill.

- Skill updated many times into something that works
- Fixed infinite loop in AI chat by memoizing ai-sdk output
- Finished navigateToView implementation
- Increased MAX_STEPS to 300 so the chat don't quit in the middle of a
long running skill
- Added CreateManyRelationFields
This commit is contained in:
Lucas Bordeau
2026-03-12 13:19:01 +01:00
committed by GitHub
parent db5b4d9c6c
commit cb3e32df86
12 changed files with 262 additions and 54 deletions
@@ -123,12 +123,41 @@ export class NavigateAppTool implements Tool {
};
}
const { flatObjectMetadataMaps } =
await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
{
workspaceId,
flatMapsKeys: ['flatObjectMetadataMaps'],
},
);
const objectMetadataUniversalIdentifier =
flatObjectMetadataMaps.universalIdentifierById[
matchingView.objectMetadataId
];
const objectMetadata = isDefined(objectMetadataUniversalIdentifier)
? flatObjectMetadataMaps.byUniversalIdentifier[
objectMetadataUniversalIdentifier
]
: undefined;
if (!isDefined(objectMetadata)) {
return {
success: false,
message: `Object metadata for view "${matchingView.name}" not found`,
error: `Could not resolve the object associated with view "${matchingView.name}"`,
};
}
return {
success: true,
message: `Navigating to view "${matchingView.name}"`,
result: {
action: 'navigateToView',
viewId: matchingView.id,
viewName: matchingView.name,
objectNameSingular: objectMetadata.nameSingular,
},
};
}