fix: route subagent transcripts and keep tool action enums (#708) (thanks @xMikeMickelson)

This commit is contained in:
Peter Steinberger
2026-01-11 11:19:38 +00:00
parent dc3c733612
commit 6b46217d19
4 changed files with 42 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import {
buildGroupDisplayName,
deriveSessionKey,
loadSessionStore,
resolveSessionFilePath,
resolveSessionKey,
resolveSessionTranscriptPath,
resolveSessionTranscriptsDir,
@@ -189,6 +190,31 @@ describe("sessions", () => {
}
});
it("uses agent id when resolving session file fallback paths", () => {
const prev = process.env.CLAWDBOT_STATE_DIR;
process.env.CLAWDBOT_STATE_DIR = "/custom/state";
try {
const sessionFile = resolveSessionFilePath("sess-2", undefined, {
agentId: "codex",
});
expect(sessionFile).toBe(
path.join(
path.resolve("/custom/state"),
"agents",
"codex",
"sessions",
"sess-2.jsonl",
),
);
} finally {
if (prev === undefined) {
delete process.env.CLAWDBOT_STATE_DIR;
} else {
process.env.CLAWDBOT_STATE_DIR = prev;
}
}
});
it("updateSessionStoreEntry merges concurrent patches", async () => {
const mainSessionKey = "agent:main:main";
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-sessions-"));