Repository navigation
feat(learn): /learn can save lessons to the selected memory plugin - #181879
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets the selected memory plugin contribute policy-filtered learning guidance to /learn alongside Skill Workshop. Example: With a participating memory plugin, send /learn remember that I prefer American English.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the previous policy finding is resolved, and this maintainer-directed SDK extension has a concrete intended consumer. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe foreground command handler combines registered memory guidance with conversation tool policy and rewrites the current user turn for execution through existing agent tools. flowchart TD
A[User learn command] --> B[Authorized command handler]
C[Selected memory capability] --> B
D[Conversation tool policy] --> B
B --> E[Rewritten user turn]
E --> F[Agent execution]
F --> G[Workshop or memory tools]
Technical reviewBest possible solution: Keep learning orchestration in the existing command and let the selected memory plugin supply guidance for its existing tools. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the Workshop-only limitation; this is a capability addition, and no target code was executed during review. Is this the best way to solve the issue? The extension fits the existing memory-slot and command owners, preserves Workshop-only behavior, and now supplies ownership metadata to the shared policy filter. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a8aee07e3870. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +122, Tests +89, Docs +16. Total +227 across 9 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 23, 2026, 4:31 PM ET / 20:31 UTC (Revision 2). |
|
Addressed the P2 in 655b635: learning-tool policy probes now carry the memory slot owner's plugin id, so plugin-ID and @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…penclaw#181879) * feat(learn): let /learn route lessons to the selected memory plugin * docs(learn): link the memory runtime contract instead of an unshipped plugin page * fix(learn): apply plugin-ID and group:plugins policy to memory learning tools * refactor(learn): type the plugin policy probe instead of casting it
What Problem This Solves
/learncan only save lessons as Skill Workshop skills. Facts, preferences, decisions and knowledge about a person or project have nowhere to go, and Workshop's own rules tell the agent not to save those as skills. Agents without Skill Workshop can't use/learnat all.User Impact
No change for current installs: with no memory plugin opting in,
/learnsends the same prompt as today and gives the same reply when unavailable.When the plugin that owns the memory slot opts in,
/learnsends repeatable procedures to Skill Workshop and other lessons to that plugin's memory. It also works on agents where only memory is available. If neither can write, the reply now names both instead of only Skill Workshop.Plugin developers get two optional fields on
registerMemoryCapability:learnToolNamesandlearnGuidanceBuilder. This adds to the public plugin SDK, so it needs SDK owner review.Why This Change Was Made
The memory plugin knows how its memory should be written, but not which of its tools the current turn's policy allows. So the plugin declares its write tools, and core runs those names, tagged with the plugin's id, through the same final tool-policy composition and runtime allowlist used for
skill_workshop, so plugin-ID andgroup:pluginsentries apply as they do to the real tools. Core then passes the surviving names to the plugin, which returns a few lines of guidance, or nothing if those tools aren't enough. Core splices the guidance into the/learnturn's user message, so the cached prompt prefix is unchanged.Memory plugins that don't own the memory slot (for example Memory Core running as a dreaming sidecar) have both fields removed at registration, the same treatment
recallToolNamesalready gets./learnadds no new authority: the turn calls the plugin's tools under the access it already had. Undo is still Workshop-only.Evidence
commands-learn(memory-only, combined, neither available, plugin-ID andgroup:pluginsallow/deny, plus the existing policy and undo cases; the plugin-wide policy case fails without the fix),memory-state,registry.dual-kind-memory-gate(an unselected sidecar can't contribute the learning fields),memory-provider-registration,tool-policy-diagnosticandtool-policy-pipeline.agent-tools.prefix-stabilitytest: 8 passed.pnpm tsgo:core,oxlint,oxfmt --checkandgit diff --checkare clean.pnpm plugin-sdk:surface:check: no unauthorized removals against the shipped SDK (v2026.10.5).origin/main, P0–P1): scoped-clean.mainuses the new fields yet, so this PR doesn't change runtime behavior, and the memory path has unit-test proof only. The first user is the Knowledge plugin, landing separately./learnwith a participating plugin has not yet been run end to end through a real Gateway; that proof belongs with the Knowledge change. Merging should wait for an SDK owner's review and that proof.Memory Core
Memory Core doesn't opt in here. It could declare its file tools (
read,write,edit) and return a line telling the agent which topic file undermemory/each lesson goes in. Note that awritegrant isn't limited to memory files, so that rule would be a prompt convention, not an enforced restriction.