Skip to content

Comments

feat: add memfs option to SDK session/agent options#36

Open
cpfiffer wants to merge 3 commits intomainfrom
feature/memfs-support
Open

feat: add memfs option to SDK session/agent options#36
cpfiffer wants to merge 3 commits intomainfrom
feature/memfs-support

Conversation

@cpfiffer
Copy link
Contributor

Summary

  • Adds memfs?: boolean option to CreateSessionOptions, CreateAgentOptions, and InternalSessionOptions
  • Passes --memfs / --no-memfs flags to the CLI subprocess in transport.ts
  • Surfaces memfsEnabled?: boolean on SDKInitMessage so callers can confirm the state
  • Companion PR: letta-ai/letta-code (surfaces memfs_enabled in the headless init message)

Usage

// Enable memfs on an existing agent
const session = createSession(agentId, { memfs: true });
const init = await session.initialize();
console.log(init.memfsEnabled); // true

// Or when creating a new agent
const agentId = await createAgent({ memfs: true });

// Disable memfs
const session = resumeSession(agentId, { memfs: false });

Test plan

  • Verify tsc --noEmit passes (confirmed locally)
  • Test memfs: true with a Letta Cloud agent -- session should initialize with memfs enabled
  • Test memfs: false disables memfs
  • Test memfsEnabled is returned on init message (requires companion letta-code PR)
  • Test omitting memfs option leaves state unchanged

Written by Cameron and Letta Code

"Memory is the diary that we all carry about with us." -- Oscar Wilde

Enables SDK users to toggle memory filesystem (git-backed persistent
memory) via `memfs: true/false` on createSession, resumeSession, and
createAgent. Also surfaces `memfsEnabled` on the init message so callers
can confirm the state.

Written by Cameron and Letta Code

"Memory is the diary that we all carry about with us." -- Oscar Wilde
The Letta API emits approval_request_message (not tool_call_message)
for tools that go through the approval flow. These were being dropped
by transformMessage(), so SDK consumers never saw tool_call events for
approved tools like memory_rethink, Bash, Edit, etc.

Written by Cameron and Letta Code

"The beginning of wisdom is the definition of terms." -- Socrates
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