Skip to content

fix(skills): remove stale letta memory tokens from context-doctor ROOT_MEMORY.md - #4141

Draft
amelia-letta wants to merge 1 commit into
mainfrom
amelia/fix-context-doctor-root-memory-tokens
Draft

amelia-letta wants to merge 1 commit into
mainfrom
amelia/fix-context-doctor-root-memory-tokens

Conversation

@amelia-letta

@amelia-letta amelia-letta commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Builtin-skill-watch: context-doctor@2823362103cc-be7161d9305cdf63

Summary

  • letta memory tokens only scans system/ (memfs-v1 layout) and returns 0 for memfs-v2 agents with root MEMORY.md layout
  • ROOT_MEMORY.md is the file loaded for memfs-v2 agents, so the command reference was stale
  • Replaced with manual byte-count/4 estimation guidance (same heuristic the harness uses)

Test plan

  • bun test src/agent/prompt-assets.test.ts — 23 pass, 0 fail
  • bun test src/tools/skill-tool.test.ts — 20 pass, 0 fail
  • bun run typecheck — 0 errors
  • Existing test "root-only prompt assets contain no system directory paths" still passes

👾 Generated with Letta Code

…OOT_MEMORY.md

The `letta memory tokens` command only scans `system/` (memfs-v1 layout)
and returns 0 for memfs-v2 agents with root `MEMORY.md` layout.
ROOT_MEMORY.md is loaded for memfs-v2 agents, so the command reference
was stale. Replace with manual byte-count/4 estimation guidance.

Co-Authored-By: Letta Code <noreply@letta.com>
@letta-integration

Copy link
Copy Markdown
Contributor

Fixed in #4147. The shared estimator now uses the existing MemFS format detection: v1 still counts system/**/*.md, while v2 counts root-level Markdown files and preserves local MemFS as v1. This also fixes the startup and post-recompile doctor state. On a real v2 agent, both the source CLI and built Node artifact now report 6,021 tokens across the four root Markdown files, matching an independent byte-count calculation. Once #4147 lands, the root-layout context-doctor can keep recommending letta memory tokens instead of removing it.

This branch has not been deployed

No deployments
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