fix: normalize Goosed reply payload and restart agent-run worker on release
Add id/created defaults for user_message, ensure metadata in agent-run gateway before submit, and kickstart the agent-run worker after portal deploy so queued page-generation runs use the latest runtime bundle. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+8
-3
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* Goosed requires user_message.metadata.userVisible (and agentVisible) on /reply.
|
||||
*/
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
/**
|
||||
* Goosed requires user_message.metadata.userVisible/agentVisible and created on /reply.
|
||||
*/
|
||||
export function ensureGooseUserMessageMetadata(userMessage) {
|
||||
if (!userMessage || typeof userMessage !== 'object' || Array.isArray(userMessage)) {
|
||||
return userMessage;
|
||||
@@ -12,8 +13,12 @@ export function ensureGooseUserMessageMetadata(userMessage) {
|
||||
: {};
|
||||
if (metadata.userVisible == null) metadata.userVisible = true;
|
||||
if (metadata.agentVisible == null) metadata.agentVisible = true;
|
||||
const created = Number(userMessage.created ?? 0) || Math.floor(Date.now() / 1000);
|
||||
return {
|
||||
...userMessage,
|
||||
id: userMessage.id ?? crypto.randomUUID(),
|
||||
role: userMessage.role ?? 'user',
|
||||
created,
|
||||
metadata,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user