feat: add memfs option to createAgent (#39)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Sarah Wooders
2026-02-15 18:34:55 -08:00
committed by GitHub
parent 9dbcb70186
commit c12c3392ff
4 changed files with 26 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ describe("transport args", () => {
permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions";
allowedTools?: string[];
disallowedTools?: string[];
memfs?: boolean;
} = {}): string[] {
const transport = new SubprocessTransport(options);
// Access private helper for deterministic argument testing.
@@ -66,4 +67,14 @@ describe("transport args", () => {
expect(args).toContain("--disallowedTools");
expect(args).toContain("EnterPlanMode,ExitPlanMode");
});
test("memfs true forwards --memfs", () => {
const args = buildArgsFor({ memfs: true });
expect(args).toContain("--memfs");
});
test("memfs false/undefined does not forward --memfs", () => {
expect(buildArgsFor({ memfs: false })).not.toContain("--memfs");
expect(buildArgsFor({})).not.toContain("--memfs");
});
});

View File

@@ -367,6 +367,11 @@ export class SubprocessTransport {
args.push("--tags", this.options.tags.join(","));
}
// Memory filesystem
if (this.options.memfs) {
args.push("--memfs");
}
return args;
}

View File

@@ -211,6 +211,9 @@ export interface InternalSessionOptions {
// Tags (only for new agents)
tags?: string[];
// Memory filesystem (only for new agents)
memfs?: boolean;
// Permissions
allowedTools?: string[];
disallowedTools?: string[];
@@ -318,6 +321,12 @@ export interface CreateAgentOptions {
/** Tags to organize and categorize the agent */
tags?: string[];
/**
* Enable git-backed memory filesystem for this newly created agent.
* Maps to Letta Code CLI `--memfs` during agent creation.
*/
memfs?: boolean;
}
// ═══════════════════════════════════════════════════════════════