Give Persistent Mind a user-actions query tool and an opt-in review task that proposes automations - #5634
Merged
Merged
Conversation
…tions (#5595) Add a user-actions.query semantic tool (readPortos-gated, agent/mind/MCP scoped, 100-event cap, credential-scrubbed output), a deterministic last-24h operator-action snippet in the mind's wake prompt, and an opt-in install-wide user-action-review scheduled task (on-demand, fileIssues by default) whose generator hook skips silently when the ledger is empty. Reads the user_action_events ledger shipped in #5594. Part of #5593.
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
user-actions.queryas a standalone semantic tool incosToolRegistry—readPortos-gated, scopedagent/mind/ui(agent scope exposes it over Agent Context MCP automatically), limit clamped to 100,sourcereduced to{ route, method }, credential-shaped values scrubbed via newserver/lib/secretText.js.persistentMindUserActions.js): counts-by-type + newest 20 summaries, ~1.5k-char cap, omitted entirely when the ledger is empty. No LLM calls.user-action-reviewas an install-wide, on-demand + enabled scheduled task withfileIssues: true, a v1 default prompt, a description blurb, and a generator hook that skips dispatch when the last 7 days of the ledger are empty (userActionReviewHooks.js).readPortosconsent text to disclose the operator-action ledger read surface; no new capability flag, noPERSISTENT_MIND_CAPABILITIES_SCHEMA_VERSIONbump.INSTALL_WIDE_TASK_TYPESpin and description-parity assertions intaskSchedule.test.js; regenerate the prompt integrity snapshot; barrel + README rows forsecretText.js.Reads the
user_action_eventsledger shipped in #5594. The review task proposes (files issues / queues CoS tasks) — it cannot PATCH settings or flip a schedule type.Closes #5595. Part of #5593.
Test plan
cd server && npm test— full suite; touched suites (cosToolRegistry,persistentMindUserActions,persistentMindAdapter,taskSchedule,taskTypeHooks,userActionReviewHooks,cosTaskGenerator,secretText,lib/index) all green. Only unrelatedsprites/atlas10s-timeout load flakes appeared in the full run; that suite passes in isolation.cd client && npx vitest run src/components/cos/tabs/schedule— green (schedule UI is server-data-driven;fileIssuesCapable/defaultFileIssuesare served for the new type, so no client change needed).TOOL_CAPABILITY_DENIED), limit clamping at 100, invalid-input rejection, MCP catalog inclusion/exclusion by grant.