Skip to content

feat(team-member): edit and remove individual memory entries - #168

Open
subhangR wants to merge 3 commits into
mainfrom
feat/team-member-memory-entry-edit-remove
Open

feat(team-member): edit and remove individual memory entries#168
subhangR wants to merge 3 commits into
mainfrom
feat/team-member-memory-entry-edit-remove

Conversation

@subhangR

Copy link
Copy Markdown
Owner

Problem

Team member memory only supported append / list / clear (maestro team-member memory --help). There was no way to edit or delete an individual entry, so trimming a bloated memory meant clearing everything and re-appending the keepers — lossy, irreversible, and awkward for an agent told to "keep memory lean". Raised by Bhargav while trimming the Droplet Steward's memory (6 long entries, no way to drop individual ones).

What changed

Per-entry edit and delete across CLI, server, and UI.

Server (maestro-server)

  • TeamMemberService.editMemoryEntry / removeMemoryEntry — atomic read-modify-write addressed by 0-based index, range-checked (404 NotFoundError when out of range); edit text is trimmed and validated non-empty.
  • New routes following existing team-member patterns:
    • PATCH /team-members/:id/memory/:index — body { projectId, entry }
    • DELETE /team-members/:id/memory/:index?projectId=
  • validation.ts: memoryEntryParamSchema (coerced non-negative int) + editMemoryEntrySchema (Zod).
  • Seeded the two new command ids in default commandPermissions.

CLI (maestro-cli)

  • maestro team-member memory edit <teamMemberId> <index> --entry "<new text>"
  • maestro team-member memory remove <teamMemberId> <index>
  • Index is 1-based to match memory list output, converted to the 0-based API index. Non-positive / non-numeric indices are rejected before any request. Registered in the command catalog + prompts.

UI (maestro-ui)

  • Moved memory out of the cramped, barely-visible inline block into its own "Memory" tab in the Team Member editor (edit mode only).
  • Proper list with per-entry inline edit (textarea; ⌘/Ctrl+Enter to save, Esc to cancel) and a delete button.
  • Persists via the existing updateTeamMember({ memory }); optimistic local state keeps the tab open after each change.

Design note

Memory stays string[] — no schema migration, no changes to TeamMemberSnapshot/mobile. Entries are addressed by index rather than stable id (low-risk); memory list prints the index alongside each entry so edit/remove are usable.

Testing

  • Jest (server): team-member-memory.test.ts (9 service tests) + team-member-memory-routes.test.ts (7 supertest route tests incl. Zod 400s and 404s).
  • Vitest (CLI): team-member-memory.test.ts (4 tests — 1→0 index conversion, correct method/URL/body, pre-request validation).
  • Full suites pass: CLI 476, server 501 (8 todo); UI tsc -b clean. Updated prompt-composer snapshots for the 2 new commands.

Acceptance

  • Delete one memory entry without touching the others
  • Edit one entry's text in place
  • Works from both CLI and Team Member UI
  • Tests: Vitest for maestro-cli, Jest for maestro-server routes/service

🤖 Generated with Claude Code

subhang and others added 3 commits July 18, 2026 18:40
Team member memory previously only supported append/list/clear, so
trimming a bloated memory meant clearing everything and re-appending the
keepers. Add per-entry edit and delete across all three packages.

Server:
- TeamMemberService.editMemoryEntry / removeMemoryEntry: atomic
  read-modify-write by 0-based index, range-checked (404 out of range),
  edit text trimmed + validated non-empty.
- Routes: PATCH  /team-members/:id/memory/:index  (body {projectId,entry})
          DELETE /team-members/:id/memory/:index?projectId=
- validation.ts: memoryEntryParamSchema + editMemoryEntrySchema (Zod).
- Seed the two new command ids in default commandPermissions.

CLI:
- `memory edit <id> <index> --entry` and `memory remove <id> <index>`.
  Index is 1-based (matches `memory list` output), converted to the
  0-based API index; non-positive/non-numeric indices are rejected before
  any request. Registered in command-catalog + prompts.

UI:
- Move memory into its own editable "Memory" tab in the Team Member editor
  (was a cramped inline block). Per-entry inline edit (Cmd/Ctrl+Enter save,
  Esc cancel) and delete, persisted via updateTeamMember({memory}) with
  optimistic local state.

Tests:
- Jest: 9 service tests + 7 supertest route tests (Zod 400s, 404s).
- Vitest: 4 CLI tests (1->0 index conversion, method/URL/body, validation).
- Updated prompt-composer snapshots for the 2 new commands.

Memory stays string[] (no schema migration); entries addressed by index,
which `memory list` prints alongside each entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant