Skip to content

Commit ea766da

Browse files
authored
Merge c8a2214 into 453f596
2 parents 453f596 + c8a2214 commit ea766da

13 files changed

Lines changed: 1215 additions & 1017 deletions

scripts/lib/session-accessor-debt-baseline.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@
4848
"src/agents/subagent-spawn.ts": 2,
4949
"src/auto-reply/reply/commands-name.ts": 2,
5050
"src/auto-reply/reply/dispatch-from-config.ts": 2,
51-
"src/auto-reply/reply/session-fork.ts": 2,
5251
"src/commands/doctor-heartbeat-main-session-repair.ts": 2,
5352
"src/commands/doctor-session-state-providers.ts": 2,
5453
"src/commands/doctor-state-integrity.ts": 2,
5554
"src/commands/doctor/shared/codex-route-warnings.ts": 2,
5655
"src/config/sessions/plugin-host-cleanup.ts": 2,
57-
"src/config/sessions/session-accessor.ts": 13,
56+
"src/config/sessions/session-accessor.ts": 14,
5857
"src/config/sessions/session-file.ts": 2,
5958
"src/config/sessions/session-registry-maintenance.ts": 2,
6059
"src/gateway/server-methods/agent.ts": 2,

src/agents/subagent-spawn.context.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from "node:path";
21
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
32
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
43
import {
@@ -61,7 +60,6 @@ describe("sessions_spawn context modes", () => {
6160
fallbackEntry?: Record<string, unknown>;
6261
parentStoreKeys?: string[];
6362
sessionKey: string;
64-
sessionsDir?: string;
6563
}) => {
6664
const parentEntry = params.parentStoreKeys
6765
?.map((key) => store[key])
@@ -94,7 +92,6 @@ describe("sessions_spawn context modes", () => {
9492
const fork = await forkSessionFromParentMock({
9593
parentEntry,
9694
agentId: params.agentId,
97-
sessionsDir: params.sessionsDir,
9895
});
9996
if (!fork) {
10097
return { status: "failed" };
@@ -191,7 +188,6 @@ describe("sessions_spawn context modes", () => {
191188
expect(forkSessionFromParentMock).toHaveBeenCalledWith({
192189
parentEntry: store.main,
193190
agentId: "main",
194-
sessionsDir: path.dirname(storePath),
195191
});
196192
const childSessionKey = requireChildSessionKey(accepted);
197193
const childEntry = requireStoreEntry(store, childSessionKey);
@@ -329,7 +325,6 @@ describe("sessions_spawn context modes", () => {
329325
expect(forkSessionFromParentMock).toHaveBeenCalledWith({
330326
parentEntry: store.main,
331327
agentId: "main",
332-
sessionsDir: path.dirname(storePath),
333328
});
334329
const cleanupRequest = requireGatewayRequest("sessions.delete");
335330
expect(cleanupRequest.params?.key).toBe(result.childSessionKey);

src/agents/subagent-spawn.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
import crypto from "node:crypto";
77
import { promises as fs } from "node:fs";
8-
import path from "node:path";
98
import { finiteSecondsToTimerSafeMilliseconds } from "@openclaw/normalization-core/number-coercion";
109
import {
1110
normalizeOptionalLowercaseString,
@@ -510,7 +509,6 @@ async function prepareSubagentSessionContext(params: {
510509
let parentEntry: SessionEntry | undefined;
511510
let childEntry: SessionEntry | undefined;
512511
let forkFallbackNote: string | undefined;
513-
const sessionsDir = path.dirname(parentTarget.storePath);
514512

515513
try {
516514
if (params.targetAgentId !== params.requesterAgentId) {
@@ -527,7 +525,6 @@ async function prepareSubagentSessionContext(params: {
527525
sessionStoreKeys: childTarget.storeKeys,
528526
fallbackEntry: { sessionId: "", updatedAt: Date.now() },
529527
agentId: params.requesterAgentId,
530-
sessionsDir,
531528
});
532529
if (forkedResult.status === "missing-parent") {
533530
throw new Error(

0 commit comments

Comments
 (0)