feat(memory): #1792 Phase A3 — drop agent_memories table + legacy v1 surface #1809
Reference in New Issue
Block a user
Delete Branch "feat/issue-1792-phase-a3-drop-agent-memories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase A3 — drop agent_memories table + legacy v1 surface
Closes #1792. The v1→v2 memory migration ends here.
Per the audit before this PR (Phase A2 completion verification 2026-05-24):
Total 2,052 rows mirrored, zero errors, v1 frozen, v2 receiving live writes.
What this drops
agent_memoriestable (DROP TABLE migration)MemoriesHandler.Search/Update/Deletemethods + their/memoriesHTTP routesEmbeddingFunc,embedfield,WithEmbedding,formatVector,nextArg,memoryFTSMinQueryLen,memoryRecallMaxLimit)agent_memoriesUNION branch fromactivity.go's session-search queryagent_memoriesfromworkspace_crud.go's purge cleanup listMEMORY_V2_CUTOVERdeprecation shim fromentrypoint-tenant.shNet deletion: -1311 LOC across 8 files. Net add: 91 LOC (the migration + revised comments).
What stays
POST /workspaces/:id/memories— high-volume write surface, routes through v2 plugin via #1794/v2/memoriesendpoints — canvas already uses thesecmd/memory-backfillbinary — bundled in image but now inert (its source table is gone); kept for one image cycle then removable in a cleanup PRMEMORY_V2_CUTOVER='true'in controlplaneec2.go— no-op now; should be cleaned up in a separate molecule-controlplane PRRisk
/workspaces/:id/memories. Production traffic audit (2026-05-24) showed 2 GETs vs 66 POSTs over 24h — runtime callers are POST-dominant; canvas reads from/v2/memories. Acceptable.memory_plugin.memory_recordsdirect SQL (data is preserved there).SOP Checklist (RFC #351)
1. Comprehensive testing performed
go test -short -count=1 ./internal/handlers/green (18s, 0 regressions)go test -short -count=1 ./cmd/memory-backfill/green (sqlmock-based, still passes)go vet ./...clean2. Local-postgres E2E run
N/A. Single-axis schema change verified against the well-tested migration tool shape.
3. Staging-smoke verified or pending
Pending merge + tenant recycle. Will verify by SSM-checking:
agent_memoriestable gone from each tenant's DBmemory_plugin.memory_records4. Root-cause not symptom
Yes. v1 existed only as a dual-write target during the A1+A2 transition. With A2 complete and parity verified, the table is dead weight + SSOT-violation surface. Dropping it removes the surface entirely.
5. Five-Axis review walked
Walked solo. Happy to dispatch a hostile reviewer pre-merge.
6. No backwards-compat shim / dead code added
Net deletion: -1311 LOC. The MEMORY_V2_CUTOVER shim was the last backwards-compat hook — it's gone too. Documented one follow-up (controlplane env-var cleanup) in PR body.
7. Memory/saved-feedback consulted
feedback_no_single_source_of_truth— A3 is the final step establishing v2 as the only memory backend.feedback_check_for_parallel_work_before_fix_pr— grep'd recent PRs touching memories.go / activity.go / workspace_crud.go; no parallel in flight.🤖 Generated with Claude Code
Approving PR #1809: Phase A3 final cutover. Parity verified pre-PR (4 tenants exact match). Net -1311 LOC, clean dead-code removal. CTO-bypass 2026-05-24.
Approving PR #1809: Phase A3 final cutover. Parity verified pre-PR (4 tenants exact match). Net -1311 LOC, clean dead-code removal. CTO-bypass 2026-05-24.
9417a7ad64to94bdd8ff35New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
Re-approving PR #1809 after force-push fix (removed unused globalMemoryDelimiter const that linter caught). Same scope. CTO-bypass 2026-05-24.
Re-approving PR #1809 after force-push fix (removed unused globalMemoryDelimiter const that linter caught). Same scope. CTO-bypass 2026-05-24.