Skip to content

chore: unship Memory and Soul#958

Open
Nikhil (shadowfax92) wants to merge 1 commit into
devfrom
chore/unship-2
Open

chore: unship Memory and Soul#958
Nikhil (shadowfax92) wants to merge 1 commit into
devfrom
chore/unship-2

Conversation

@shadowfax92
Copy link
Copy Markdown
Contributor

Summary

  • Remove the Memory and Soul pages, sidebar entries, onboarding Soul step, tips, feature gates, and related client modules.
  • Remove global Memory/Soul server routes, AI SDK tools, prompt guidance, startup seeding, path constants, and stale tool labels/docs.
  • Keep ACPX/OpenClaw agent-home memory and soul behavior intact because it is a separate runtime adapter path.

Design

This unships the global Memory/Soul feature by deleting the shipped UI and backend surfaces rather than hiding them behind another runtime gate. The agent prompt and toolset no longer advertise unavailable Memory/Soul behavior, while onboarding step numbering and route fallbacks are adjusted so removed paths fall back to supported screens.

Test plan

  • bun run --filter @browseros/server typecheck
  • bun run --filter @browseros/agent typecheck
  • bun run --filter @browseros/server test:agent
  • bun run --filter @browseros/server test:api
  • bun run --filter @browseros/agent test apps/agent/entrypoints/newtab/layout/route-utils.test.ts
  • bunx biome check on touched TypeScript files
  • git diff --check

@shadowfax92
Copy link
Copy Markdown
Contributor Author

Greptile (@greptileai) review

@shadowfax92
Copy link
Copy Markdown
Contributor Author

Claude (@claude) review

@github-actions github-actions Bot added the chore label May 7, 2026
@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

Claude finished Nikhil (@shadowfax92)'s task in 2m 41s —— View job


Code Review: chore/unship Memory and Soul

Tasks

  • Gather context and understand the PR
  • Review client-side changes (sidebar, routes, onboarding, tips)
  • Review server-side changes (routes, tools, prompt)
  • Review test changes
  • Check for dangling references or incomplete cleanup
  • Post final review

Summary

A clean, well-scoped unship. The PR deletes all global Memory/Soul UI and backend surfaces atomically, correctly preserves the ACPX/OpenClaw adapter paths, and fixes up analytics step numbering, route fallbacks, and test expectations. No dangling references found.


Observations

Correct / Looks Good

  • Step numberingStepConnectApps step 3→2, StepTwo step 4→3, and steps.ts IDs are consistent. Analytics tracking matches. ✓
  • /settings/soul redirect — Now falls back to /settings/ai instead of the deleted /home/soul. ✓
  • RpcClientProvider removal (StepsLayout.tsx) — The remaining steps (StepOne, StepConnectApps, StepTwo) confirmed to not use useRpcClient, so the wrapper removal is safe. ✓
  • ACPX/OpenClaw path preservedacpx-runtime-context.ts and acpx-runtime-templates.ts still contain the memory/soul machinery unchanged. ✓
  • monitor-page/SKILL.md — Correctly rewritten to use workspace files (or chat) instead of memory_write. ✓
  • humanizeToolName cleanup — The words[0]! non-null assertion was replaced with destructuring + guard. Small improvement, correct behavior. ✓
  • Route testsshouldHideFocusGrid('/home/memory') and /home/soul now assert false after removal from HIDE_FOCUS_GRID_PATHS. ✓
  • message-validation.test.tsmemory_search replaced with search_history to keep toolset fixtures representative without the removed tool. ✓

Minor Notes

1. Sanitization regex no longer strips <soul> / <memory_and_identity> tags from user input

format-message.ts:44 — the regex was narrowed:

// before
/<\/?(?:selected_text|USER_QUERY|page_context|AGENT_PROMPT|soul|memory_and_identity|security|workspace)[^>]*>/gi

// after
/<\/?(?:selected_text|USER_QUERY|page_context|AGENT_PROMPT|security|workspace)[^>]*>/gi

Since neither <soul> nor <memory_and_identity> appear in the system prompt anymore, there's no practical injection risk today. This is fine as-is — just worth keeping in mind if these tags are ever reintroduced.

2. Duplicate files still present (pre-existing, not introduced here)

apps/agent/lib/tool-labels.ts and apps/server/src/tools/tool-label-registry.ts are 100% identical (308 lines each). This PR correctly updates both in lockstep, but the duplication is a future consolidation opportunity.

3. Test count comment now stale

prompt.test.ts:99 — the test was renamed from 'includes all 14 v6 sections in regular mode' to 'includes all v6 sections in regular mode'. The hardcoded count was removed rather than updated — reasonable, but someone should count the asserted sections and verify they match actuality. Not a blocker.

4. Leftover memory/soul files on disk for existing users

Existing installs will still have ~/.browseros/memory/ and SOUL.md on disk — they just won't be read or written anymore. This is fine for an unship (not data deletion), but if there's ever a future migration script or cleanup tool, these are the paths to target: PATHS.MEMORY_DIR_NAME and PATHS.SOUL_FILE_NAME were removed from paths.ts, so the constants are gone. Worth a comment in a migration note somewhere if users ask "why is this old folder still there."


Verdict

Approved with the notes above. All surface areas are consistently cleaned up. The four observations above are minor — none are blockers. The test plan in the PR description (typecheck, test:agent, test:api, route-utils.test.ts, biome) covers the right bases for a deletion PR of this size.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

✅ Tests passed — 1124/1128

Suite Passed Failed Skipped
agent 76/76 0 0
build 9/9 0 0
eval 93/93 0 0
server-agent 248/248 0 0
server-api 202/202 0 0
server-browser 4/4 0 0
server-integration 9/10 0 1
server-lib 161/161 0 0
server-root 60/63 0 3
server-skills 31/31 0 0
server-tools 231/231 0 0

View workflow run

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR removes the global Memory and Soul feature surfaces — pages, sidebar entries, onboarding steps, API routes, AI SDK tools, and all prompt guidance — while deliberately preserving the separate ACPX/OpenClaw adapter path that has its own runtime memory/soul handling.

  • UI removal: MemoryPage, SoulPage, their sub-components and hooks, the Memory/Soul sidebar nav items, and the StepSoul onboarding step are all deleted; remaining onboarding steps are renumbered (Connect Apps → 2, Sign In → 3) with analytics step numbers updated to match.
  • Server removal: /memory and /soul HTTP routes, all six memory AI-SDK tools, soul.ts lib, build-toolset.ts, and the memory/ startup directory creation are removed; fuse.js is dropped as a dependency; the agent prompt no longer advertises memory or identity capabilities.
  • Shared constants cleanup: MEMORY_DIR_NAME, SOUL_FILE_NAME, CORE_MEMORY_FILE_NAME, SOUL_MAX_LINES, and MEMORY_RETENTION_DAYS are removed from paths.ts; the monitor-page skill is updated to use workspace files as a baseline-storage fallback instead of memory_write.

Confidence Score: 5/5

Safe to merge — the change is a clean, self-consistent removal with no loose ends left behind.

All call sites (routes, sidebar, onboarding, prompt builder, tool registry, analytics events, startup seeding, shared constants) are updated in lock-step. The sanitization regex in format-message.ts is correctly trimmed to only the tags still used as prompt delimiters. Onboarding step numbers and analytics events are renumbered consistently. Tests are properly replaced rather than simply deleted. The OpenClaw/ACPX adapter path is explicitly preserved by keeping its own memory/soul runtime independent of the deleted shared code.

No files require special attention. The monitor-page SKILL.md now directs the agent to use workspace files for baseline storage, which is a reasonable fallback, but users on sessions without a workspace will see a degraded monitoring experience (baseline returned in chat rather than persisted).

Important Files Changed

Filename Overview
packages/browseros-agent/apps/agent/entrypoints/app/App.tsx Removes MemoryPage and SoulPage routes, fixes /settings/soul redirect to point at /settings/ai, and removes the soul key from the OptionsRedirect map.
packages/browseros-agent/apps/agent/entrypoints/onboarding/steps/steps.ts Removes StepSoul (previously step 2), renumbers Connect Apps to step 2 and Sign In to step 3; analytics step numbers in StepConnectApps and StepTwo updated accordingly.
packages/browseros-agent/apps/server/src/agent/prompt.ts Removes getMemoryAndIdentity section, soul/memory references from role strings and capabilities, and the soulContent/isSoulBootstrap options; prompt is now lean and factual about available capabilities.
packages/browseros-agent/apps/server/src/api/server.ts Removes /soul and /memory HTTP route registrations; corresponding route files are deleted entirely.
packages/browseros-agent/apps/server/src/lib/browseros-dir.ts Removes getMemoryDir, getSoulPath, getCoreMemoryPath helpers and stops creating the memory directory on startup.
packages/browseros-agent/packages/shared/src/constants/paths.ts Removes MEMORY_DIR_NAME, SOUL_FILE_NAME, CORE_MEMORY_FILE_NAME, SOUL_MAX_LINES, and MEMORY_RETENTION_DAYS constants; these were only referenced in now-deleted memory/soul files.
packages/browseros-agent/apps/server/src/skills/defaults/monitor-page/SKILL.md Updates monitor-page guidance to use workspace files for baseline storage instead of memory_write; adds a fallback for sessions without a workspace (return baseline in chat).
packages/browseros-agent/apps/server/tests/agent/prompt.test.ts Replaces the full memory-and-identity test suite with a single assertion that memory/soul guidance is absent; all soul-bootstrap, tier-model, and chat-mode tests are correctly removed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User visits /home/memory or /home/soul"] --> B{Route registered?}
    B -- "Before PR" --> C["MemoryPage / SoulPage rendered"]
    B -- "After PR" --> D["Route missing — falls through to 404 fallback"]

    E["settings/soul redirect"] --> F{Target}
    F -- "Before PR" --> G["/home/soul"]
    F -- "After PR" --> H["/settings/ai"]

    I[AiSdkAgent builds toolset] --> J{Memory tools?}
    J -- "Before PR" --> K["6 tools added: memory_search, memory_write, memory_read_core, memory_update_core, soul_read, soul_update"]
    J -- "After PR" --> L["No memory tools"]

    M[Agent system prompt] --> N{Memory and Identity section?}
    N -- "Before PR" --> O["Full section: SOUL.md, Core/Daily tiers, tool guidance"]
    N -- "After PR" --> P["Section removed entirely"]

    Q[Onboarding steps] --> R{Step order}
    R -- "Before PR" --> S["1 Welcome - 2 Soul - 3 Connect Apps - 4 Sign In"]
    R -- "After PR" --> T["1 Welcome - 2 Connect Apps - 3 Sign In"]
Loading

Reviews (1): Last reviewed commit: "chore: unship memory and soul" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant