Allow ACP sessions.patch lineage fields on ACP session keys (#40995)

Merged via squash.

Prepared head SHA: c1191edc08
Co-authored-by: xaeon2026 <264572156+xaeon2026@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
This commit is contained in:
xaeon2026
2026-03-09 12:08:11 -04:00
committed by GitHub
parent 54be30ef89
commit 425bd89b48
3 changed files with 33 additions and 4 deletions

View File

@@ -252,6 +252,29 @@ describe("gateway sessions patch", () => {
expect(entry.spawnDepth).toBe(2);
});
test("sets spawnedBy for ACP sessions", async () => {
const entry = expectPatchOk(
await runPatch({
storeKey: "agent:main:acp:child",
patch: {
key: "agent:main:acp:child",
spawnedBy: "agent:main:main",
},
}),
);
expect(entry.spawnedBy).toBe("agent:main:main");
});
test("sets spawnDepth for ACP sessions", async () => {
const entry = expectPatchOk(
await runPatch({
storeKey: "agent:main:acp:child",
patch: { key: "agent:main:acp:child", spawnDepth: 2 },
}),
);
expect(entry.spawnDepth).toBe(2);
});
test("rejects spawnDepth on non-subagent sessions", async () => {
const result = await runPatch({
patch: { key: MAIN_SESSION_KEY, spawnDepth: 1 },