fix: route subagent transcripts and keep tool action enums (#708) (thanks @xMikeMickelson)
This commit is contained in:
@@ -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-"));
|
||||
|
||||
Reference in New Issue
Block a user