Keep a bot's workspace memory from reading as the workspace's record
A workspace bot asked to "update the workspace record" wrote to its own memory there, called it the workspace's record, and then, when the user said nothing had changed, denied making any write at all: it checked nothing and confessed to work it had done. - Say in the prompt that the workspace's context is the user's, and that memory in a workspace is the bot's own notes, readable in its settings - Say the same in update_memory and update_instructions results, with where the user reads it and that the workspace's own fields didn't change - Have ActionCheckNote look at what actually happened before agreeing with a user that nothing was done, and never deny work that happened
This commit is contained in:
@@ -35,7 +35,7 @@ export default function updateInstructionsTool({
|
||||
return {
|
||||
name: "update_instructions",
|
||||
description: workspace_id
|
||||
? `Replace your instructions with this full text (markdown). scope "workspace" (the default) is your instructions for this workspace, under "# Your instructions in ..."; "core" is your core instructions, the start of your prompt in every workspace and your own chat. Both are shared: the workspace's with everyone working in it, your core ones with every user you work for. Change them only for how you should work for all of them, such as a standing rule for your job; a preference of this one user goes in your memory of them (update_memory, scope "user"). Keep everything that still applies.`
|
||||
? `Replace your instructions with this full text (markdown). scope "workspace" (the default) is your instructions for this workspace, under "# Your instructions in ...": yours there, not the workspace's description or context; "core" is your core instructions, the start of your prompt in every workspace and your own chat. Both are shared: the workspace's with everyone working in it, your core ones with every user you work for. Change them only for how you should work for all of them, such as a standing rule for your job; a preference of this one user goes in your memory of them (update_memory, scope "user"). Keep everything that still applies.`
|
||||
: `Replace your core instructions with this full text (markdown): the start of your prompt, before any workspace or memory, shared with every user you work for. Change them only for how you should work for every user you work for, such as a standing rule for your job; a preference of this one user goes in your memory of them (update_memory, scope "user"). Keep everything that still applies.`,
|
||||
schema: workspace_id
|
||||
? z.object({ instructions, scope: z.enum(["workspace", "core"]).default("workspace") })
|
||||
@@ -54,7 +54,7 @@ export default function updateInstructionsTool({
|
||||
workspace_id,
|
||||
expected: args.instructions,
|
||||
});
|
||||
return `Instructions for this workspace saved and checked. They apply from your next run here.`;
|
||||
return `Instructions for this workspace saved and checked. They apply from your next run here. They are yours in this workspace, not its context: the workspace's own description and context did not change.`;
|
||||
}
|
||||
|
||||
await updateBotSystemPrompt({
|
||||
|
||||
@@ -28,6 +28,8 @@ const UserScopeNote = `what you remember about this user, under "# Memory about
|
||||
|
||||
const CoreScopeNote = `scope "core" is your core memory, under "# Memory", shared with every user you work for: only general knowledge about your job that holds for anyone, never anything about a particular user.`;
|
||||
|
||||
const WorkspaceScopeNote = `scope "workspace" (the default) is your own memory for this workspace, under "# Memory in ...": what holds for the work here. It is yours, not the workspace's description or context, which the user sets and which you never change from here.`;
|
||||
|
||||
const ReplaceNote = `Anything you leave out is forgotten, so include the parts that still matter.`;
|
||||
|
||||
/**
|
||||
@@ -45,7 +47,7 @@ export default function updateMemoryTool({
|
||||
return {
|
||||
name: "update_memory",
|
||||
description: workspace_id
|
||||
? `Replace a memory with this full text (markdown). scope "workspace" (the default) is your memory for this workspace, under "# Memory in ...": what holds for the work here. scope "user" is ${UserScopeNote} ${CoreScopeNote} ${ReplaceNote}`
|
||||
? `Replace a memory with this full text (markdown). ${WorkspaceScopeNote} scope "user" is ${UserScopeNote} ${CoreScopeNote} ${ReplaceNote}`
|
||||
: `Replace a memory with this full text (markdown). scope "user" (the default) is ${UserScopeNote} ${CoreScopeNote} ${ReplaceNote}`,
|
||||
schema: workspace_id
|
||||
? z.object({ memory, scope: z.enum(["workspace", "user", "core"]).default("workspace") })
|
||||
@@ -60,7 +62,7 @@ export default function updateMemoryTool({
|
||||
if (workspace_id && args.scope == "workspace") {
|
||||
await updateWorkspaceBot({ user_id, workspace_id, bot_id, memory: args.memory });
|
||||
await checkSavedText({ kind: "workspace_memory", bot_id, workspace_id, expected: args.memory });
|
||||
return `Memory for this workspace saved and checked.`;
|
||||
return `Memory for this workspace saved and checked. It is your own memory, not the workspace's description or context: those did not change. The user reads it in the workspace's settings, under this bot's row. Tell the user that, never that you changed the workspace.`;
|
||||
}
|
||||
|
||||
await updateBotUserMemory({ user_id, bot_id, memory: args.memory });
|
||||
|
||||
Reference in New Issue
Block a user