Closed TheComamba closed 5 months ago
The llm tests are not yet green. I have not yet investigated the three alternatives for limiting the context. Apart from that, the functionality is implemented and tested.
The Foundry integration is not working, and I think it comes down to the fact that I erroneously assumed getFlag to be a synchronous function. Changing that changes a lot. Several tests are now broken. We also need to give serious thought to the fact that Hooks.#call does not await asynchronous hooks. Some of our design probably needs to change.
All will turn out well. Eventually.
The function _createDocuments
in class ClientDatabaseBackend
has a line
const response = await SocketInterface.dispatch("modifyDocument", request);
This response contains the id of the document. So it seems that it is given by the server.
The _preCreate
function that we currently use is called before that. This means that the document does not yet have an id, which in turn means that the setFlag function fails with an error.
Dear oh me.
Ok. The _source field of Document has a flags field. Writing into it with the debugger does indeed persist the data. This means that we do not necessarily need to set flags via the usual mechanism. Another hack 'tis.
I thought about an implementation: As far as I know, Actor and ChatMessage both inherit from the same class that defines the setFlag functions. My proposal is therefore: