Gateway: harden custom session-store discovery (#44176)

Merged via squash.

Prepared head SHA: 52ebbf5188
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Gustavo Madeira Santana
2026-03-12 16:44:46 +00:00
committed by GitHub
parent dc3bb1890b
commit 46f0bfc55b
20 changed files with 1146 additions and 183 deletions

View File

@@ -767,7 +767,8 @@ describe("listSessionsFromStore search", () => {
describe("loadCombinedSessionStoreForGateway includes disk-only agents (#32804)", () => {
test("ACP agent sessions are visible even when agents.list is configured", async () => {
await withStateDirEnv("openclaw-acp-vis-", async ({ stateDir }) => {
const agentsDir = path.join(stateDir, "agents");
const customRoot = path.join(stateDir, "custom-state");
const agentsDir = path.join(customRoot, "agents");
const mainDir = path.join(agentsDir, "main", "sessions");
const codexDir = path.join(agentsDir, "codex", "sessions");
fs.mkdirSync(mainDir, { recursive: true });
@@ -792,7 +793,7 @@ describe("loadCombinedSessionStoreForGateway includes disk-only agents (#32804)"
const cfg = {
session: {
mainKey: "main",
store: path.join(stateDir, "agents", "{agentId}", "sessions", "sessions.json"),
store: path.join(customRoot, "agents", "{agentId}", "sessions", "sessions.json"),
},
agents: {
list: [{ id: "main", default: true }],