fix: make PawWork memory silent and automatic - #527
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRemoves the SessionMemoryReview UI and its server/client proposal endpoints, simplifies memory parsing to return raw Profile/Archive, eliminates redaction/proposal logic, updates injected memory prompt text, and adjusts tests to use raw save/read/delete behavior. ChangesMemory Review Feature Removal
Backend Memory Architecture Simplification
Session & Prompt Updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request removes the structured session memory review UI and its associated backend logic, transitioning to a model where the agent manages the MEMORY.md file directly as freeform markdown using file editing tools. The system prompt has been updated with instructions for memory management, including guidelines on data sensitivity and persistence. Feedback suggests refining the system prompt by adding character truncation to the memory retrieval example to prevent context bloat and providing an English acknowledgement example to ensure consistent behavior across locales.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/opencode/src/memory/service.ts`:
- Line 127: The current RegExp used in deleteEntry (new RegExp(`\\n?###
[^\\n]*\\bid:${escaped}(?:\\s|$)[\\s\\S]*?(?=\\n### |$)`)) will prematurely stop
at any "###" heading inside an entry body; tighten the lookahead so it only
stops at the next entry header that contains an "id:" field. Replace the
trailing lookahead (?=\\n### |$) with one that asserts the next "###" line
includes an "id:" token, e.g. (?=\\n### [^\\n]*\\bid:|$), and ensure the RegExp
flags (multiline) are correct for line anchors so deleteEntry targets full entry
boundaries only.
In `@packages/opencode/src/session/prompt.ts`:
- Around line 1848-1853: The memory prompt is missing an explicit rule mandating
a single onboarding sentence on the first automatic memory write; add a line to
the pawwork-memory instructions (the same array that currently ends with
"</pawwork-memory>") that tells the assistant: "On the very first automatic
write to MEMORY.md include exactly one concise onboarding sentence for the user
(once only); do not include this onboarding sentence on subsequent updates."
Place this rule among the other bullet strings before the closing
"</pawwork-memory>" entry so the model deterministically performs a one-time
onboarding write and never repeats it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e6ddfd9a-f3af-4a1b-9947-c8a54dba03dd
⛔ Files ignored due to path filters (2)
packages/sdk/js/src/v2/gen/sdk.gen.tsis excluded by!**/gen/**packages/sdk/js/src/v2/gen/types.gen.tsis excluded by!**/gen/**
📒 Files selected for processing (13)
packages/app/e2e/settings/settings-memory.spec.tspackages/app/src/components/memory/session-memory-review.tsxpackages/app/src/i18n/en.tspackages/app/src/i18n/zh.tspackages/app/src/pages/session.tsxpackages/app/src/pages/session/session-main-view.tsxpackages/app/src/shell-frame-contract.test.tspackages/opencode/src/memory/memory.tspackages/opencode/src/memory/proposal.tspackages/opencode/src/memory/service.tspackages/opencode/src/server/instance/memory.tspackages/opencode/src/session/prompt.tspackages/opencode/test/memory/pawwork-memory.test.ts
💤 Files with no reviewable changes (7)
- packages/app/src/pages/session.tsx
- packages/opencode/src/server/instance/memory.ts
- packages/app/src/shell-frame-contract.test.ts
- packages/app/src/pages/session/session-main-view.tsx
- packages/opencode/src/memory/proposal.ts
- packages/app/src/components/memory/session-memory-review.tsx
- packages/opencode/src/memory/memory.ts
Summary
Archiveto freeform markdown while preservingProfileas the only section injected at session start.MEMORY.mdsilently, grep/readArchiveonly on demand, and avoid writing sensitive data.Why
Issue #526 redefines PawWork Memory v1 as silent, AI-maintained local memory. The old
SessionMemoryReviewflow asked the user whether to save memory at session idle, which is the wrong product behavior: memory should not interrupt the user with a confirmation surface.Related Issue
Closes #526
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
packages/opencode/src/session/prompt.ts: memory instructions must stay lean and match the v1 product boundary.packages/opencode/src/memory/*:Profileremains the startup-injected section, whileArchiveaccepts freeform markdown and no longer safe-modes on metadata.packages/app/e2e/settings/settings-memory.spec.ts: old confirmation UI coverage was replaced with absence coverage.Risk Notes
MEMORY.md, not a new UI or structured write protocol.Archiveis no longer structured by enforced metadata. Existing structured entries remain readable as ordinary markdown./memory/review-stateand/memory/proposal/acceptwere removed.<pawwork-memory>block is not injected, so the assistant is not given memory read/write instructions.How To Verify
Screenshots or Recordings
Not included. This PR removes an obsolete UI panel rather than introducing a new visible surface; the absence is covered by the settings memory E2E test.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Release Notes
Feature Removals
Changes