Skip to content

Commit 001be10

Browse files
committed
fix(tui): align runtime prewarm workspace
1 parent 7e3ca01 commit 001be10

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

src/tui/embedded-backend.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ describe("EmbeddedTuiBackend", () => {
611611
expect(loadSessionEntryMock).toHaveBeenCalledWith("global", { agentId: "work" });
612612
});
613613

614-
it("loads runtime plugins before returning embedded history", async () => {
614+
it("loads runtime plugins for the send-path workspace before returning embedded history", async () => {
615615
const cfg = { agents: { list: [{ id: "main" }] } };
616616
loadSessionEntryMock.mockReturnValue({
617617
cfg,
@@ -628,7 +628,7 @@ describe("EmbeddedTuiBackend", () => {
628628
});
629629
expect(ensureRuntimePluginsLoadedMock).toHaveBeenCalledWith({
630630
config: cfg,
631-
workspaceDir: "/tmp/openclaw-custom-workspace",
631+
workspaceDir: "/tmp/openclaw-agent-main",
632632
});
633633
});
634634

src/tui/embedded-backend.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,10 @@ function shouldLoadFullGatewayCatalogForReplaceMode(cfg: OpenClawConfig) {
135135

136136
function ensureEmbeddedHistoryRuntimePluginsLoaded(params: {
137137
cfg: OpenClawConfig;
138-
entry?: Record<string, unknown>;
139138
sessionAgentId: string;
140139
}): { status: "warmed" } | { status: "failed"; error: string } {
141140
try {
142-
const spawnedWorkspaceDir = params.entry?.spawnedWorkspaceDir;
143-
const workspaceDir =
144-
typeof spawnedWorkspaceDir === "string" && spawnedWorkspaceDir.trim()
145-
? spawnedWorkspaceDir
146-
: resolveAgentWorkspaceDir(params.cfg, params.sessionAgentId);
141+
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, params.sessionAgentId);
147142
ensureRuntimePluginsLoaded({
148143
config: params.cfg,
149144
workspaceDir,
@@ -442,7 +437,6 @@ export class EmbeddedTuiBackend implements TuiBackend {
442437
});
443438
const runtimePluginsPrewarm = ensureEmbeddedHistoryRuntimePluginsLoaded({
444439
cfg,
445-
entry,
446440
sessionAgentId,
447441
});
448442
const resolvedSessionModel = resolveSessionModelRef(cfg, entry, sessionAgentId);

0 commit comments

Comments
 (0)