fix: Disable memfs for newly spawned subagents [LET-7975] (#1371)
This commit is contained in:
@@ -534,6 +534,9 @@ export function buildSubagentArgs(
|
||||
// Create new agent (original behavior)
|
||||
args.push("--new-agent", "--system", type);
|
||||
args.push("--tags", `type:${type}`);
|
||||
// Default all newly spawned subagents to non-memfs mode.
|
||||
// This avoids memfs startup overhead unless explicitly enabled elsewhere.
|
||||
args.push("--no-memfs");
|
||||
if (model) {
|
||||
args.push("--model", model);
|
||||
}
|
||||
@@ -575,9 +578,6 @@ export function buildSubagentArgs(
|
||||
if (!isDeployingExisting) {
|
||||
if (config.memoryBlocks === "none") {
|
||||
args.push("--init-blocks", "none");
|
||||
if (config.mode === "stateless") {
|
||||
args.push("--no-memfs");
|
||||
}
|
||||
} else if (
|
||||
Array.isArray(config.memoryBlocks) &&
|
||||
config.memoryBlocks.length > 0
|
||||
|
||||
@@ -121,7 +121,7 @@ describe("resolveSubagentLauncher", () => {
|
||||
});
|
||||
|
||||
describe("buildSubagentArgs", () => {
|
||||
const baseConfig: Omit<SubagentConfig, "mode"> = {
|
||||
const baseConfig: SubagentConfig = {
|
||||
name: "test-subagent",
|
||||
description: "test",
|
||||
systemPrompt: "test prompt",
|
||||
@@ -129,31 +129,28 @@ describe("buildSubagentArgs", () => {
|
||||
recommendedModel: "inherit",
|
||||
skills: [],
|
||||
memoryBlocks: "none",
|
||||
mode: "stateful",
|
||||
};
|
||||
|
||||
test("adds --no-memfs for stateless subagents with memoryBlocks none", () => {
|
||||
const args = buildSubagentArgs(
|
||||
"test-subagent",
|
||||
{ ...baseConfig, mode: "stateless" },
|
||||
null,
|
||||
"hello",
|
||||
);
|
||||
test("adds --no-memfs for newly spawned subagents by default", () => {
|
||||
const args = buildSubagentArgs("test-subagent", baseConfig, null, "hello");
|
||||
|
||||
expect(args).toContain("--init-blocks");
|
||||
expect(args).toContain("none");
|
||||
expect(args).toContain("--no-memfs");
|
||||
});
|
||||
|
||||
test("does not add --no-memfs for stateful subagents with memoryBlocks none", () => {
|
||||
test("does not force --no-memfs when deploying an existing subagent agent", () => {
|
||||
const args = buildSubagentArgs(
|
||||
"test-subagent",
|
||||
{ ...baseConfig, mode: "stateful" },
|
||||
baseConfig,
|
||||
null,
|
||||
"hello",
|
||||
"agent-existing",
|
||||
);
|
||||
|
||||
expect(args).toContain("--init-blocks");
|
||||
expect(args).toContain("none");
|
||||
expect(args).toContain("--agent");
|
||||
expect(args).not.toContain("--new-agent");
|
||||
expect(args).not.toContain("--no-memfs");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user