feat(slack-app phase 4): write tools (create, update, share, soft-delete, child)#29
Merged
feat(slack-app phase 4): write tools (create, update, share, soft-delete, child)#29
Conversation
…ete, child)
Adds 5 write tools to the Slack agent. Bot can now actually create,
update, share/unshare, reply on, and (carefully) delete memories.
New tools in src/slack-agent-tools.ts:
- write_memory: create personal memory by default; share_with_team=true
flips it to shared after creation. origin='slack' for traceability.
- write_child_memory: reply on an existing parent. Inherits team
sharing. Wraps createChildMemory which (post earlier session work)
allows replies on team-visible parents authored by anyone.
- update_memory: wholesale title/content/tags REPLACE on the user's
own memory only. Refuses cleanly when caller doesn't own the row,
pointing them at write_child_memory for teammate threads.
- share_memory: share=true | share=false; "not on a team" error path
for solo users; preserves the personal copy on unshare.
- delete_memory: TWO-CALL CONFIRMATION pattern — confirm=false (default)
returns a preview {id, title, tags, content_preview} + an instruction
to show the user and ask 'reply yes'; only confirm=true actually
soft-deletes (moved to Trash, restorable from the dashboard). The
system prompt explicitly enforces this dance.
System prompt (src/slack-agent.ts) extended with a Writing Guidelines
section + a Destructive Actions section. Calls out:
- Default to personal memories; share with team only when explicitly
asked.
- Use write_child_memory for follow-ups; never update_memory on a
teammate's memory.
- update_memory is wholesale — pass complete new values, not a diff.
- Match user's existing tagging conventions (call get_memory_briefing
if unsure).
- Never delete without showing the preview and getting an explicit
'yes' in chat first.
Tests (+8, 367 -> 375 total):
- write_memory creates personal-by-default; rejects empty title/content.
- write_child_memory creates under a parent.
- update_memory replaces wholesale; refuses non-owned memories with a
clear 'not found / use write_child_memory' message.
- share_memory returns the 'not on a team' note for solo users.
- delete_memory(confirm=false) returns the preview but doesn't delete;
delete_memory(confirm=true) soft-deletes (deleted_at populated).
Refs: parent memory d959bc61.
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4 — adds 5 write tools to the Slack agent. The bot can now create, update, share/unshare, reply on, and (carefully) soft-delete memories.
Full design: `docs/eng-plan-slack-app-v1.md`. Parent memory `d959bc61`.
New tools (`src/slack-agent-tools.ts`)
Safety: the destructive-action dance
System prompt explicitly enforces:
System prompt updates
New `Writing guidelines` + `Destructive actions` sections in `src/slack-agent.ts`. Calls out: default to personal, use write_child_memory for follow-ups, update_memory is wholesale, match existing tagging conventions (call `get_memory_briefing` if unsure), never delete without confirmation.
Tests (+8, 375/375 total)
Test plan
Made with Cursor